Broken translation freezes Yakuake #8
Zamknięty
otworzone 4 lat temu przez jstolarek
·
13 komentarzy
Ładowanie…
Reference in new issue
Nie ma jeszcze treści.
Usuń gałąź '%!s(<nil>)'
Usunięcie gałęzi jest trwałe i NIE MOŻE zostać cofnięte. Kontynuować?
Basic information
Description
So I've accidentally broken the translation with
95843ec634
but I don't fully understand what I did wrong and need some guidance. The problem is with added lines 328-329, which are intended to provide translation for phrases "Shell" and "Shell No. %n" used to labels tabs with shells in Yakuake. In the sources the original phrases are stored as:and I translated them as:
but apparently that's not correct since the text in the program now shows as "BROKEN TRANSLATION Shell". Even worse, attempting to create a new shell freezes Yakuake and the only way to recover is to kill Yakuake from a text console (Ctrl+Alt+F1). How are the plural forms intended to work?
Importantly, I might have caused similar problems in Amarok with commit
ac48478ebc
, but the package was not yet rebuild so I can't test it.The problem is that the TDE still uses the old way of writing a plurality of translations. It was created for KDE at a time when gettext did not yet provide such a possibility. The newer gettext already includes a way to write plurality of translations, but it is not compatible with the original KDE way.
Therefore, in TDE translations, the notation
_n:
introduces a plural translation, where this_n:
is not to be part of the translated string. Unfortunately, Weblate reports a translation check error for such translations that needs to be ignored.Your translation should therefore look like this:
I fixed the transltaion via Weblate. Would it be possible to pull it, build the package, and push the fix to the repos?
Now, a few more questions:
_n:
on the first line?_n:
form is the new (TDE) one?_n:
already and I left them unchanged. Many were missing the leading_n:
and I added it.Yes, I'll probably do it this afternoon.
The format using
_n:
was long ago designed by KDE as a way to provide a plurality of translations without having to change the format of PO/MO files. The gettext team later proposed and adopted another solution that became the accepted standard.The format using
_n:
is not a new format, but an old format that TDE inherited from KDE. Therefore, to extract strings to POT templates, we must use an older modified version ofxgettext
, iekde-xgettext
.Here is the intention to modify the tde-i18n engine so that we can convert the strings to the new plural format, which is now standard for gettext.
In short, if a translation starts with
_n:
it is always an old format of plural translations. Weblate properly recognizes the new plural format and displays multiple separate edit lines for each plural variant.You don't have to worry about translations where
_n:
was included in the translated string. I'm now testing the automation of repairing such strings, so then I'll do the repair in bulk.Weblate does not recognize the old plural form of translations proposed by KDE and therefore checks for these translations fail and are reported as requiring attention. Currently, you need to ignore this type of check.
Is that standard documented somehwere? I'm still sort-of guessing how this exactly works and would gladly take a look at the docs.
Ok, so the trend is to get rid of the
_n:
translations, rather than add them. I'm still not sure whether the two are allowed to coexist in the same file. Apparently, I can't safely add_n:
because it potentially breaks things. What about the other way around? Can I remove existing_n:
and be certain that nothing will break?I guess the reason I am worried is because I added
_n:
to several strings and I don't want the repository version of Amarok to end up broken. Do I understand correctly that you will take care of fixing those?I seem to have found the cause.
For Polish, as for many other languages, the plural form expects three variants. However, the current translation contains only two variants.
When I edited your translation and added one more line
Powłoka nr %n
– yes, the same as the second variant – it started to work properly.What are these variants expected to be? In English there are two forms: "Shell" and "Shell No. %n" and these translate one-to-one to Polish.
EDIT: Also, how can I know how many variants are expected so that I can avoid such problems in the future?
The number of plural variants depends on the language. For Polish, as well as for Czech, Italian and many other languages, there are 3. See information about language available in TWTW:
https://mirror.git.trinitydesktop.org/weblate/languages/pl/#information
It is true that the consequence of a bad translation is too fatal, and that it would be good to solve it so that it does not cause an endless loop.
The fact is also that the use of plural translation in this case seems to be not a very good choice, because in this form it is very likely that exactly two variants will always be used.
This is exactly what I needed - thanks! Now the plural forms make sense.
Indeed. I think that getting this right would require the ability to customize the number of plural forms on a per-translation basis.
Any estimate when an updated package will be available in the repo?
Did you edit the translation on TWTW? My test, which I mentioned, was performed only locally.
Ah, I thought ypu pushed the fix :-) Will edit now.
Translations pushed and merged into a stable branch – building is now underway.
I can confirm that everything works now. Closing.