-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gettext po: fix broken syntax due to missing quotations, unescape
|
…
…, add test also fix duplicate msgids
- Loading branch information
Showing
3 changed files
with
96 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ python -m pip install \ | |
python-idzip \ | ||
lxml==5.3 \ | ||
marisa-trie \ | ||
mistune | ||
mistune \ | ||
polib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import sys | ||
import unittest | ||
from os.path import abspath, dirname | ||
|
||
rootDir = dirname(dirname(abspath(__file__))) | ||
sys.path.insert(0, rootDir) | ||
|
||
from glossary_v2_test import TestGlossaryBase | ||
|
||
|
||
class TestGlossaryGetttestPo(TestGlossaryBase): | ||
def __init__(self, *args, **kwargs): | ||
TestGlossaryBase.__init__(self, *args, **kwargs) | ||
|
||
self.dataFileCRC32.update( | ||
{ | ||
"100-en-fa.po": "694de186", | ||
"100-en-fa.po.txt": "f0c3ea53", | ||
}, | ||
) | ||
|
||
def convert_txt_po(self, fname, fname2, **convertArgs): | ||
self.convert( | ||
f"{fname}.txt", | ||
f"{fname}-2.po", | ||
compareText=f"{fname2}.po", | ||
**convertArgs, | ||
) | ||
|
||
def convert_po_txt(self, fname, fname2, **convertArgs): | ||
self.convert( | ||
f"{fname}.po", | ||
f"{fname}-2.txt", | ||
compareText=f"{fname2}.txt", | ||
**convertArgs, | ||
) | ||
|
||
def test_convert_txt_po_1(self): | ||
self.convert_txt_po("100-en-fa", "100-en-fa") | ||
|
||
# TODO | ||
def test_convert_po_txt_1(self): | ||
self.convert_po_txt( | ||
"100-en-fa", | ||
"100-en-fa.po", | ||
infoOverride={"input_file_size": None}, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |