mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
don't use implicit $ in extract-po-strings
This commit is contained in:
parent
f28b32cf75
commit
a85bca51b2
1 changed files with 3 additions and 3 deletions
|
@ -10,7 +10,7 @@ import polib
|
|||
# extract a translated string from the gettext catalogs and insert it into ftl
|
||||
# eg:
|
||||
# $ python extract-po-string.py media-check.ftl delete-unused "Delete Unused Media" "", 1
|
||||
# $ python extract-po-string.py media-check.ftl delete-unused "%(a)s %(b)s" "%(a)s=val1,%(b)s=val2" 0
|
||||
# $ python extract-po-string.py media-check.ftl delete-unused "%(a)s %(b)s" "%(a)s=$val1,%(b)s=$val2" 0
|
||||
ftl_filename, key, msgid, repls, dry_run = sys.argv[1:]
|
||||
|
||||
replacements = []
|
||||
|
@ -34,7 +34,7 @@ for (lang, cat) in cats:
|
|||
msg = entry.msgstr
|
||||
if replacements:
|
||||
for (old,new) in replacements:
|
||||
msg = msg.replace(old, f"{{${new}}}")
|
||||
msg = msg.replace(old, f"{{{new}}}")
|
||||
print(lang, "has", msg)
|
||||
to_insert.append((lang, msg))
|
||||
break
|
||||
|
@ -47,7 +47,7 @@ for (lang, cat) in cats:
|
|||
for _k, msg in plurals:
|
||||
if replacements:
|
||||
for (old,new) in replacements:
|
||||
msg = msg.replace(old, f"{{${new}}}")
|
||||
msg = msg.replace(old, f"{{{new}}}")
|
||||
adjusted.append(msg)
|
||||
print(lang, "has", adjusted)
|
||||
if len(adjusted) > 1:
|
||||
|
|
Loading…
Reference in a new issue