CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.59k stars 4.16k forks source link

russian translation issue #17585

Closed jarmush closed 8 years ago

jarmush commented 8 years ago

pipe combination gun (комбинированный самопал) description contains strange text. 2016-07-07 13-34-19

ghost commented 8 years ago

I've also encountered this problem once, language is Chinese Simplified, but I don't know how to reproduce. This is very rare. Seems like it's not a language specific issue, it may has something to do with gettext.

ghost commented 8 years ago
msgid ""
msgstr ""
"Project-Id-Version: Cataclysm-DDA\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-04 16:48+0300\n"
"PO-Revision-Date: 2016-07-05 08:33+0000\n"
"Last-Translator: Vlasov Vitaly <vnigtha@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/cataclysm-dda-translators/"
"cataclysm-dda/language/ru/)\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
"%100>=11 && n%100<=14)? 2 : 3);\n"

The message you saw is in the header of lang/po/ru.po. One another possible reason is that _("") invoked?

codemime commented 8 years ago

Can reproduce.

it may has something to do with gettext.

Quite probable. The issue appears to be rather "old". 13530 already has it. Weird that it hasn't been spotted for so long: can it be recent and library related?

illi-kun commented 8 years ago

This typically happens due to empty string for translation. I saw empty description for the following entries in file data/json/items/gunmod/underbarrel.json:

These items should either have some description text or be removed (if they're obsolete, I didn't check their use).

codemime commented 8 years ago

This typically happens due to empty string for translation. These items should either have some description text or be removed

If it's the real cause of the issue then describing / removing would rather conceal the issue than fix it. We should treat this case properly: don't try to translate empty strings and [maybe] drop a debug message for some major strings if they're empty (item description is important and shan't be omitted).

illi-kun commented 8 years ago

The message you see on a screenshot is a debug message (but I agree that it's better to have more obvious debug messages).

jarmush commented 8 years ago

seems like Kel-Tec KSG second magazine integrated mod doesn't have description too

codemime commented 8 years ago

The message you see on a screenshot is a debug message

What I see there looks more like a buffer overflow. I always thought that debug messages for the game look like this (taken from another issue):

850c1044-443e-11e6-9886-0b0c052d9293

ghost commented 8 years ago

Working on this.

BevapDin commented 8 years ago

What I see there looks more like a buffer overflow.

It's not, it's the "header entry" from gettext. https://www.gnu.org/software/gettext/manual/gettext.html#Header-Entry - translators should not translate a message to an empty string, it's their bug if they do. If the empty string comes directly from the code (not from a translation), it's a bug in that code.

illi-kun properly meant the text is a debugging message from gettext, not from the game.

codemime commented 8 years ago

It's not, it's the "header entry" from gettext.

Well, I know that (especially since it's first written by @DLaboratory in the second message here). I wrote that it "looks more like a buffer overflow" (and meant that). A proper debug message is as explicit as it can be (like "seeing this is a bug"), not cryptic.

codemime commented 8 years ago

translators should not translate a message to an empty string, it's their bug if they do.

If it wasn't initially empty then yes, I totally agree.

If the empty string comes directly from the code (not from a translation), it's a bug in that code.

How so? I think trying to translate empty strings is perfectly legal (especially since they can come from JSON).

kevingranade commented 8 years ago

If the empty string comes directly from the >> code (not from a translation), it's a bug in that code.

How so? I think trying to translate empty strings is perfectly legal (especially since they can come from JSON).

The empty string is more like a null pointer, it's content-free, therefore untranslatable.