-
-
Notifications
You must be signed in to change notification settings - Fork 958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stringsdict: Plural forms are not loaded correctly from file #6418
Comments
Most likely the English file path doesn't contain language code. Am I right? Probably the language detection in the translate-toolkit should be improved here... |
The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable). |
Can you plase try if following patch fixes it? --- translate/storage/stringsdict.py
+++ translate/storage/stringsdict.py
@@ -97,6 +97,8 @@ class StringsDictFile(base.DictStore):
match = re.search(r"^(\w*).lproj", parent_dir)
if match is not None:
target_lang = match.group(1)
+ if target_lang == "Base":
+ target_lang = "en"
else:
target_lang = self.sourcelanguage
|
I've created a PR with this: translate/translate#4411 |
Thank you for your report; the issue you have reported has just been fixed.
|
Hi, sorry for the late response. I've just tried the latest My paths are:
|
Okay, it will have different cause then. |
Is it possible that the file is parsed before the target language or filename is set on the |
Yes, that's possible. Other formats return whatever plurals are stored in the file when parsing and they probably don't use language at that stage (they do only on serialization). |
We need access to class attributes during parsing for #6418
Thank you for your report; the issue you have reported has just been fixed.
|
Continuation of #6368
Describe the issue
I'm doing more tests in the bleeding edge version. I've created another project with an existing file (i.e. the same stringsdict file used in the unit test) and tried to add a new language using only the web interface.
After Weblate parses the file, but before saving the changes, it seems to have parsed 6 plural forms for English instead of 3. This becomes visible when writing the translation for another language (Dutch, in my case).
If I edit the English version in Weblate and save it, and then go to Dutch, it does display the text correctly.
I already tried
Describe the steps you tried to solve the problem yourself.
If you didn’t try already, try to search there what you wrote above.
weblate loadpo --force project/component
.To Reproduce the issue
Steps to reproduce the behavior:
Expected behavior
Three strings should be displayed in the source text:
Screenshots
Server configuration and status
Weblate installation: Docker
Weblate deploy checks
Additional context
The stringsdict implementation in Translate Toolkit defaults to using all plural forms when it doesn't know the target language.
The text was updated successfully, but these errors were encountered: