Replies: 4 comments 13 replies
-
Let's be honest, complete 100% is not easily achievable, especially as features are added or tweaked around. Even at around 98%, it's very likely the translated editor is usable without any major slip-ups. |
Beta Was this translation helpful? Give feedback.
-
I don't think a cutoff at < 100% completion is a good idea. It's too strict and will often end up not being reached anymore following a Godot update. What I'd do instead is list the completion percentage next to each translation in the language selection dropdown. Incomplete translations are already excluded from the editor binary. As of writing, the completion cutoffs are < 30% (editor) and < 10% (class reference). We can make the cutoff stricter as time goes on. |
Beta Was this translation helpful? Give feedback.
-
@Calinou Here's a snippet that works for me: import re
# pick any of the the three
path = r"[godot_docs_l10n_repo]\weblate\de.po"
path = r"[godot_repo]\editor\translations\editor\de"
path = r"[godot_repo]\editor\translations\properties\de"
with open(path, encoding="utf-8") as f:
text = f.read()
# Total count and untranslated count could be off by 1 but the precision is not needed
# and it makes for more readable code.
# Count all occurrences of 'msgid' at the start of a line.
total_count = len(re.findall(r'[\r\n]msgid', text))
# Count all occurrences of 'msgstr ""' at the start of a line
# with any trailing whitespace or linebreaks.
# The hash character marks the next translation string.
# This is necessary because translated strings sometimes take
# the form 'msgstr ""' followed by the actual translation in the next line.
untranslated_count = len(re.findall(r'[\r\n]msgstr ""[\r\n\w]*#', text))
# Count all occurrences of the fuzzy marker
fuzzy_count = len(re.findall(r'[\r\n]#, fuzzy', text))
translated_percentage = 1 - (untranslated_count + fuzzy_count) / total_count
translated_percentage_int = int(100*translated_percentage)
# This should print the percentage that weblate shows for de.
print(f"{translated_percentage_int}%") |
Beta Was this translation helpful? Give feedback.
-
They will acknowledge the problem after 3 years, don't waste your time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Do not activate by default if the translation is not 100%. When the first installation is done, an interface with two languages mixed is not nice at all.
Proposal

.Beta Was this translation helpful? Give feedback.
All reactions