Commit 3cee98a9 authored by Carl Schwan's avatar Carl Schwan

Add StaticMessages.sh

parent cd9aa5c4
#!/usr/bin/env bash
function export_pot_file # First parameter will be the path of the pot file we have to create, includes $FILENAME
{
potfile=$1
python3 translations.py extract $potfile
}
function import_po_files # First parameter will be a path that will contain several .po files with the format LANG.po
{
podir=$1
python3 translations.py import $podir
python3 translations.py generate-translations
rm -rf locale
}
......@@ -14,15 +14,15 @@ def webpage_list():
return ['content/about-kate.md']
@cli.command()
@click.argument("directory")
def extract(directory):
@click.argument("pot")
def extract(pot):
"""
First parameter will be the path of the directory where we have to store the pot files
"""
webpages = ""
for webpage in webpage_list():
webpages += " --master \"" + webpage + "\""
command = "po4a-gettextize --format asciidoc " + webpages + " --master-charset \"UTF-8\" --po \"" + directory + "\"/kate-editor-org.pot"
command = "po4a-gettextize --format asciidoc " + webpages + " --master-charset \"UTF-8\" --po \"" + pot + "\""
subprocess.run(command, shell=True, check=True, text=True)
......@@ -47,7 +47,6 @@ def generate_translations():
extension = os.path.splitext(webpage)[1]
basename = os.path.splitext(webpage)[0]
translated = basename + "." + translations + extension
print(translated)
command = "po4a-translate --format asciidoc --po \"locale/" + translations + "/LC_MESSAGES/kate-editor-org.po\" --master \"" + webpage + "\" --localized \"" + translated + "\" --master-charset \"UTF-8\""
subprocess.run(command, shell=True, check=True, text=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment