Browse Source

Update Polish translations. (#7525)

* Sync pl.po to source code.
* Fix "U.S. Sales" translation.
* Change "żywotność" to "witalność" so it flows better in character stats screen.
* Button combo bindings translation.
* Player inspection translations.
* Debug commands translations.
* Inventory sorting translations.
* Quick spell translations.
* Chat log translations.
* Consistent translations for "armor" and "armor class".
* Update store label translations.
* Different take on resists translation on character screen.
* Shorten Experience translation to avoid overflowing.
* Improve the validate_translations.py script.
pull/7528/head
Krzysztof Pawlik 1 year ago committed by GitHub
parent
commit
d61ab52e51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3125
      Translations/pl.po
  2. 21
      tools/validate_translations.py

3125
Translations/pl.po

File diff suppressed because it is too large Load Diff

21
tools/validate_translations.py

@ -1,27 +1,29 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import re
from glob import glob
import polib
import re
def validateEntry(original, translation):
if translation == '':
return True
# Find fmt arguments in source message
src_arguments = re.findall("{.*?}", original)
if len(src_arguments) == 0:
src_arguments = re.findall(r"{.*?}", original)
if not src_arguments:
return True
# Find fmt arguments in translation
translated_arguments = re.findall("{.*?}", translation)
translated_arguments = re.findall(r"{.*?}", translation)
# If paramteres are untyped with order, sort so that they still appear equal if reordered
# Note: This does no hadle cases where the translator reordered arguments where not expected
# by the source. Or other advanced but valid usages of the fmt syntax
isOrdered = True
for argument in src_arguments:
if re.search("^{\d+}$", argument) == None:
if not re.search(r"^{\d+}$", argument):
isOrdered = False
break
@ -32,7 +34,7 @@ def validateEntry(original, translation):
if src_arguments == translated_arguments:
return True
print ("\033[36m" + original + "\033[0m != \033[31m" + translation + "\033[0m")
print(f"\033[36m{original}\033[0m != \033[31m{translation}\033[0m")
return False
@ -40,10 +42,9 @@ def validateEntry(original, translation):
status = 0
files = glob('Translations/*.po')
files.sort()
for path in files:
for path in sorted(files):
po = polib.pofile(path)
print ("\033[32mValidating " + po.metadata['Language'] + "\033[0m : " + str(po.percent_translated()) + "% translated")
print(f"\033[32mValidating {po.metadata['Language']}\033[0m : {po.percent_translated()}% translated")
for entry in po:
if entry.fuzzy:

Loading…
Cancel
Save