Opened 8 years ago

Last modified 3 years ago

#4250 new defect

sprintf errors out when the translators don't copy the %() tags properly

Reported by: fatherbushido Owned by:
Priority: Should Have Milestone: Backlog
Component: Internationalization & Localization Keywords:
Cc: Patch: Phab:D1674, Phab:D3926, Phab:D4199

Description (last modified by Silier)

The issue caused a segfault with #4053, but it usually just outputs a slew of errors.

Like for #3833, we should automatically check that the translated versions of sprintf'd strings contain the same tags.

Edit: some languages have only one plural, that means our plural string needs to be checked against translation at index 0, which is in other cases translation from singular

For instance: the translation of %(arrows) arrow(s) must be %(arrows) flèche(s) (here in French). The %(arrows) part mustn't be touched by translators. We already check links, we could easily extend ps/trunk/source/tools/i18n/checkTranslationsForSpam.py for sprintf tags.

Attachments (1)

crash.txt (1.9 KB ) - added by fatherbushido 7 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 by fatherbushido, 8 years ago

Always reproductible

Last edited 8 years ago by fatherbushido (previous) (diff)

comment:2 by elexis, 8 years ago

Please, someone fix the italian tower sprintf translation on transifex! select italian and click on a tower in a game.

comment:3 by fatherbushido, 8 years ago

Summary: Segfault when opening the structure tree from the starting screen in Spanish languageSegfault when opening the structure tree from the starting screen in Italian language

comment:4 by fabio, 7 years ago

Which is the problematic string? I could fix it eventually, cannot test currently, however.

comment:5 by fatherbushido, 7 years ago

thanks fabio, i think Gallaecio had yet fixed it. The remaining problem is that why it segfaults ? People with gcc 5 have just warnings but people with gcc 6 have an always reproductible segfault.

by fatherbushido, 7 years ago

Attachment: crash.txt added

in reply to:  5 comment:6 by Itms, 7 years ago

Replying to fatherbushido:

thanks fabio, i think Gallaecio had yet fixed it. The remaining problem is that why it segfaults ? People with gcc 5 have just warnings but people with gcc 6 have an always reproductible segfault.

The segfault is #4053: if you apply the patch there, you should have just the sprintf warnings.

About those warnings, it would be nice to validate the translations as it is done for links. See #3833 for a similar request with tags.

comment:7 by Itms, 7 years ago

In 18801:

Disable some optimizations when building SpiderMonkey with GCC6.
This fixes the segfault issues we encounter when building with this compiler.

According to https://bugzilla.mozilla.org/show_bug.cgi?id=1245783#c33, this is enough to fix this issue. The fixes for SpiderMonkey to address the underlying problem are included in its version 49.

Fixes #4053, refs #4250

comment:8 by Itms, 7 years ago

Component: UI & SimulationI18n & L10n
Description: modified (diff)
Milestone: Alpha 21Backlog
Priority: Release BlockerShould Have
Summary: Segfault when opening the structure tree from the starting screen in Italian languagesprintf errors out when the translators don't copy the %() tags properly

comment:9 by elexis, 5 years ago

Description: modified (diff)
Patch: Phab:D4250

comment:10 by elexis, 5 years ago

Patch: Phab:D4250Phab:D1674

comment:11 by wraitii, 3 years ago

In 25538:

Check translations for spam, broken font tags and sprintf errors.

Supersedes D1674 and D3520.

This still generates some false positives (particularly the singular-plural check), but in general it will suffice to better check bundled languages.

Refs #4250

Differential Revision: https://code.wildfiregames.com/D3926

comment:12 by Silier, 3 years ago

Patch: Phab:D1674Phab:D1674, Phab:D3926, Phab:D4199

comment:13 by Silier, 3 years ago

Description: modified (diff)

comment:14 by Silier, 3 years ago

In 25865:

[scripts]Update translation checks to check pluralised strings

Currently script checks only singular translations
Add branch to check plural strings as well

Differential revision: D4199
Refs: #4250
Comments by: @Stan

Note: See TracTickets for help on using tickets.