Navigation Menu

Skip to content

Commit

Permalink
utility: fix detection of gettext in lua files
Browse files Browse the repository at this point in the history
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
  • Loading branch information
Ansuel committed Sep 20, 2019
1 parent 0e4d6ff commit 744f0ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/update_po.py
Expand Up @@ -13,7 +13,7 @@
plural_po_regex = re.compile(r"(?<=msgid\s)\".*?(?<!\\)\"(?=\s+msgid_plural)")

#Detect language in lp and lua files
po_find_regex = re.compile(r'(?<=gettext\.textdomain\(\')[a-z]+-[a-z]*-*[a-z]+(?=\'\))')
po_find_regex = re.compile(r'(?<=gettext\.textdomain\(\'|gettext\.textdomain\(\")[a-z]+-[a-z]*-*[a-z]+(?=\'\)|\"\))')

#Detect T"" in source files
normal_trans_regex = re.compile(r"(?<=\.T|\(T|\{T|\sT|\[T|,T)\".*?(?<!\\)\"(?=,|\s|\s\.\.|\.\.|\)|\}|\")")
Expand Down Expand Up @@ -81,7 +81,7 @@ def gen_po():
for lang in po_string_table:
for file in po_string_table[lang]:
if file in translate_table and file in po_string_table[lang]:

#Normal strings msgid
diff_table = set(translate_table[file]) - set(po_string_table[lang][file])
po_file = open(lang_path+"/"+lang+"/"+file+".po", 'a',encoding='UTF8')
Expand Down

0 comments on commit 744f0ee

Please sign in to comment.