Closed liminspace closed 4 years ago
The problem is that your source language is "en" and you also have translation for "en", what doesn't make much sense. Either remove the English translation or set Weblate to ignore it using language regex. I've added such explanation to the alert in 60e14ceaa63faf0d69bf83847e4ef152e4a71290.
Thank you for your report, the issue you have reported has just been fixed.
@nijel how can you enable translation from "en" to "en" to override the strings used in the code for the base language? is that possible at all?
It's not possible for bilingual translations. The problem is that this would change the English translation, but not the source string for all other languages, what could easily lead to inconsistencies in them. The better approach for this is to fix the strings in the source code (for example with help of source string review) or switching to monolingual translations, where the source code contains just identifiers and the English translation is at same level as others.
But there a case when you are not editing the source strings, that's when you generate a PO file for the source language in a bilingual setup. For instance if the source language is English then the locale/en/LC_MESSAGES/django.po file is generated. We have that setup that helps us to reduce development time by letting the translators correct strings in the source by themselves. We can implement this as a opt-in option if you see this as a valid use case.
What you can do in this case is to change source language on the project. Creating something like English (developer) (en@devel
) will make it clear what is going on and will avoid conflict with existing English translation.
@nijel thanks for the suggestion, after some trial and error is clear that the solution we are looking for is achieved by using a monolingual setup. It's working perfectly, the only part that is not very easy to understand is the concept of "intermediate file", what would be a use case for that setting?
Something is described at https://docs.weblate.org/en/latest/admin/projects.html#intermediate-language-file, I will try to extend it
I think that we at OpenWrt have stumbled to a bit similar situation with weblate. We have
That "en" English confuses weblate, and we get "duplicate language alerts".
The mostly unused English also seems to lock strings in case somebody has accidentally a edited a string in the "English translation" of a component. Then all empty strings in "en" are evaluated as untranslated source strings and are shown as "Source in review" in other languages and locked from translation to other languages.
Based on the discussion above,
^[^.]+$
there. What would be the acceptable regex to exclude "en" English from the scanned translation files?
(as far as I understand, that setting would need to be done separately for each component, right?)I've made changes to the alert text and documentations to cover your questions.
See https://hosted.weblate.org/projects/openwrt/luciapplicationsopkg/#alerts
Thanks. I tried changing the source language to "English (Developer)".
But since then I have noticed that some components cause errors when I try visiting translation strings in them, and in some components part of the strings are shown as "read only". Almost like weblate still remembers the status it set for the string when the source language was previously "English". That might still be due to something like no upstream git change, so weblate has not updated its source string table, or something like that.
So I wonder if I need to perform some weblate-wide cleanup or refresh action after the change of "source language".
Additionally, can we somehow lock the "English (developer)", so that nobody can translate to that? Worst case would be that somebody clicks the visible offer of translating the "English (developer)" and we end up in the same situation as earlier. "English (developer)" should remain disabled as translation language for casual users..
(And naturally we don't have any actual po/en_devel/xxx.po files at our repo, so we would not like weblate to start to introduce such ones.)
Or should we also edit the language filter somehow? Would hiding the English devel file be a better option?
Thanks. Your commit on preventing caching of English seems to have cleared most problems, so far.
I still wonder how to prevent polluting "English (developer)" from translations. Sooner or later somebody used the "pen" icon next to source strings, or otherwise semi-accidentally starts to translate that.
Could it possible to declare the source language "read-only" in the project settings? (or any language?)
The source language is read only in bilingual translations. It was messed up before because Weblate didn't properly handle migration when actual translation becomes source one.
I always get Duplicated translation alert and can't understand how to fix it.
Used django generated PO-files: en, da, de, et, etc. The main (source) language is EN. All (except EN) PO-files contain some translations. I created new component using
from version control
andgettext PO file
. PO files are imported successfully. Thesource language
of the translation project is English.In
Repository changes
block I get messages: None Found duplicated languageen (en, en)
In
Alerts
tab I get messages: Duplicated translation. The component contains several translation files mapped to single language in Weblate. The following occurrences were found: Language Language codes English en, en Please fix this by removing one of the duplicated strings from the translation files.BUT. When I change
source language
into some non-existing language, this alert is disappeared.