Skip to content
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

Translate msgid "battery" bug in all *.po files in 4fa18e9 commit #23561

Closed
akirashirosawa opened this issue Apr 21, 2018 · 21 comments
Closed

Translate msgid "battery" bug in all *.po files in 4fa18e9 commit #23561

akirashirosawa opened this issue Apr 21, 2018 · 21 comments

Comments

@akirashirosawa
Copy link
Contributor

Game version:
4fa18e9 and higher

Expected behavior

battery in russian like батарея

Actual behavior

battery shown like 99d8b20cf7042be43c3855ac670d4ec2_pl_0
1
2
3

Steps to reproduce the behavior

Try to run some no english version of game. In all *.po files:

#: lang/json/AMMO_from_json.py
msgid "battery"
msgid_plural "batteries"
msgstr[0] "99d8b20cf7042be43c3855ac670d4ec2_pl_0"
msgstr[1] "99d8b20cf7042be43c3855ac670d4ec2_pl_1"
msgstr[2] "99d8b20cf7042be43c3855ac670d4ec2_pl_2"
msgstr[3] "99d8b20cf7042be43c3855ac670d4ec2_pl_3"

Steps to fix

For ru.po:

#: lang/json/AMMO_from_json.py
msgid "battery"
msgid_plural "batteries"
msgstr[0] "батарея"
msgstr[1] "батареи"
msgstr[2] "батарей"
msgstr[3] "батарея"
@gastamper
Copy link
Contributor

If someone adds translations for other languages I'll include them in the PR but unfortunately only know Russian and Japanese for sure at the moment.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Apr 21, 2018

I confirm this bug.

I can show to you we can blame Transifex (or maybe the configuration) for that one. The faulty string comes from a bad export from Transifex. I have noticed this bug in my daily manual PO export from Transifex. That was before the routine Transifex pull, previously done on April 20, 2018.

I disagree with the suggested fix. Editing the PO files by hand will not help you they will just be overwritten in the next routine pull.

To see the problem really comes from Transifex, just go to Transifex and request a PO file to be exported for a language. Then look inside for the “battery” string.

Also note that in Transifex, if you try to edit the battery/batteries string, Transifex, for some reason, always edits all plural forms at once. Something seems to be very wrong with Transifex here.

How to export the PO file from Transifex (because it's not obvious)

  1. Go to the Dashboard: https://www.transifex.com/cataclysm-dda-translators/cataclysm-dda/dashboard/
  2. Select a language (e.g. German), click “View Resources”
  3. Select master-cataclysm-dda
  4. Click “Download for use”

How to find the battery string in Transifex

  1. Search for “batteries” (NOT “battery”)

Note, as of today, the string hash (in Transifex) of the affected string is 99d8b20cf7042be43c3855ac670d4ec2

Translation for German

#: lang/json/AMMO_from_json.py
msgid "battery"
msgid_plural "batteries"
msgstr[0] "Batterie"
msgstr[1] "Batterien"

@gastamper
Copy link
Contributor

Looks like this probably requires someone with the Reviewer status on Transifex to fix, I sure can't do anything to change the string or otherwise play around to try to troubleshoot why it isn't exporting properly.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Apr 22, 2018

The affected string is not reviewed so it can be updated by any translator.
Maybe you run into a different bug?
As I already said, I can change the string, but changing the plural also changes the singular at the same time, and vice-versa, thus making it impossible to translate properly.

I believe Transifex needs to be contacted for this problem (Message sent, I hope they wlll reply soon).

@gastamper
Copy link
Contributor

Yeah I hadn't even tried to change the string since it was correct, just revert previous changes (which didn't work).

You are right that this is a problem with Transifex and not the translation or CDDA source it seems so hopefully you having contacted them will resolve it.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Apr 25, 2018

I got a reply from Transifex Support on April 23 which I like to quote here:

Regarding your case, after further looking into this, I found out that
on 2016-12-16, the following PO entry was created in Transifex:

msgid "battery" msgstr "battery"
and on 2018-04-13 23:21:07, this entry was converted to a pluralized
string as follows:

msgid "battery" msgid_plural "batteries" msgstr[0] "battery"
msgstr[1] "batteries"
In the old version of our parser (v=1), if a PO entry that was hosted
in Transifex was a non-pluralized string and in an updated version of
your source file, you converted this to a pluralized one (the msgid
remained the same), then the parser was getting confused. As a result:
-- The plural forms in the translation box area were not available (as
it is happening in your case). As a result, you could not apply a
different translation to each form.
-- While exporting your translation file from Transifex, the hash was
included in the file instead of the translatable text (e.g.
99d8b20cf7042be43c3855ac670d4ec2_pl_0)

However, in the new version of our PO parser (v=2), this issue is no
longer present. So, in order to fix this, you need to upload this file
as a new resource to Transifex
so that the content will be parsed by
the v=2 PO parser.

(emphasis by me)

Can whoever is the manager of the Cataclysm-DDA project on Transifex do as suggested above, please? (I don't know who manages the project).
Please be careful not to destroy existing translations.

@cainiaowu
Copy link
Contributor

@BrettDong Check this issue.

@cainiaowu
Copy link
Contributor

Uploading as new resource may be problematic since we will lost all the translation memory in the past.

1 similar comment
@cainiaowu
Copy link
Contributor

Uploading as new resource may be problematic since we will lost all the translation memory in the past.

@BrettDong
Copy link
Member

I moved the old resource to master-cataclysm-dda-deprecated and tried to migrate all translations to the newly created master-cataclysm-dda, but when I was pushing translations, I got the following issue:

brett@debian:~/Cataclysm-DDA$ tx push -r cataclysm-dda.master-cataclysm-dda -s -
t --force
tx INFO: Pushing resource cataclysm-dda.master-cataclysm-dda
Warning: By using --force, the uploaded files will overwrite remote translations, even if they are newer than your uploaded files.
Are you sure you want to continue? [y/N]: y
tx INFO: Pushing source file (lang/po/cataclysm-dda.pot)
tx WARNING: Pushing 'ru' translations (file: lang/po/ru.po)
tx ERROR: Error received from server: Could not import file: Incomplete plural forms found on the entry with msgid `RM13 combat armor` and msgid_plural `RM13 combat armors`.
tx ERROR: Could not push translations. You can use --skip to ignore this error and continue the execution.
tx ERROR: Error received from server: Could not import file: Incomplete plural forms found on the entry with msgid `RM13 combat armor` and msgid_plural `RM13 combat armors`.

I sent a message to Transifex, awaiting response.

@BrettDong
Copy link
Member

In case of inconsistency, translations are temporarily suspended. #23610 will be imported to Transifex after the technical issues are solved.

@korick
Copy link

korick commented Apr 29, 2018

about this ERROR: in 'ru' translations - in this string RM13 combat armor - delete ru translations, add translations later
some like this:

msgid "RM13 combat armor"
msgid_plural "RM13 combat armors"
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgstr[3] ""

Notify or Alert when solved or find other solution

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Apr 30, 2018

@BrettDong: How's the progress on the Transifex update going?

@BrettDong
Copy link
Member

The issue of 'incomplete plural forms' I commented above was solved, but I'm now getting HTTP 500 error when pushing French, Italian, Spanish and Korean (however other languages are fine). I wrote an email to Transifex, but they haven't replied yet.

@korick
Copy link

korick commented May 1, 2018

in transifex, po-file strange or bad uploading
when translating in transifex i use not-fully manually construct po-file with only string when i translate and success upload on server transifex
try this solution
manually correct structure po-file for different languages (fr, it, sp, kr etc) use some like this Notepad++
[head] - only this section manually correct, with this head (bottom), po-file correctly uploading
IMPORTANT - it's for Ru-translating, for another languages maybe some changes in charset=UTF-8
[structure string English] - don't touch
[structure string translate] - don't touch
some like this:
[head]

msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

[structure]

#: lang/json/BIONIC_ITEM_from_json.py
msgid "EMP Projector CBM"
msgid_plural "EMP Projector CBMs"
msgstr[0] "КБМ: ЭМИ излучатель"
msgstr[1] "КБМ: ЭМИ излучатель"
msgstr[2] "КБМ: ЭМИ излучатель"
msgstr[3] "КБМ: ЭМИ излучатель"
etc

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented May 9, 2018

@BrettDong: Still no reply from the Transifex people? Because the resources are still locked.

@korick: FYI: It's HTTP error 500 … That means the bug is on the server-side, i.e. Transifex.

@BrettDong
Copy link
Member

BrettDong commented May 10, 2018 via email

@BrettDong
Copy link
Member

@Wuzzy2 is this issue addressed in the latest master branch?

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented May 27, 2018

Yes.
However, you have destroyed the “Reviewed” status of all strings in Transifex. xD (but this is a different issue).

This issue can now be closed.

@BrettDong
Copy link
Member

Hadn't I migrated the resource, the review status would also be lost when implementing #23434 .

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented May 29, 2018

Yeah, that's true. Meh, maybe this is a neccessary evil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

8 participants