Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cfg/projects/Komikku.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"project": "Komikku",
"license": "Apache-2.0",
"projectweb": "https://github.com/komikku-app/komikku",
"fileset": {
"Komikku": {
"url": "https://github.com/komikku-app/komikku.git",
"type": "git"
}
}
}
6 changes: 6 additions & 0 deletions src/builder/convertfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ def _convert_android_resources_files_to_po(self):
if os.path.exists(src) and os.path.exists(tgt):
self._convert_android_file(src, tgt, dir)

# MOKO resources structure: base/strings.xml + ca/strings.xml
moko_src = os.path.join(dir, "base/strings.xml")
moko_tgt = os.path.join(dir, "ca/strings.xml")
if os.path.exists(moko_src) and os.path.exists(moko_tgt):
self._convert_android_file(moko_src, moko_tgt, dir)

logging.info("convert Android directory: {0}".format(self.convert_dir))

def _convert_json_file_to_po(self, jsonfile, source, target):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="action_search">Search</string>
<string name="action_hide">Hide</string>
<string name="action_open_folder">Open folder</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="action_search">Cercar</string>
<string name="action_hide">Amagar</string>
<string name="action_open_folder">Obre la carpeta</string>
</resources>
13 changes: 13 additions & 0 deletions src/tests/builder-tests/testconvertfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,19 @@ def test_convert_android_files_to_po(self):
self.assertEqual("Name is too long", po_file[14].msgid)
self.assertEqual("El nom és massa llarg", po_file[14].msgstr)

def test_convert_moko_files_to_po(self):
moko_dir = path.dirname(path.realpath(__file__))
moko_dir += "/data/conversions/moko/"
convert = ConvertFiles(moko_dir, None)
convert.convert()

po_file, entries = self._get_po_entries(moko_dir)
self._clean_pos(moko_dir)

self.assertEqual(entries, 3)
self.assertEqual("Search", po_file[0].msgid)
self.assertEqual("Cercar", po_file[0].msgstr)

def test_convert_xliff_file_to_po(self):
xliff_dir = path.dirname(path.realpath(__file__))
xliff_dir += "/data/conversions/xliff"
Expand Down