Opened 5 years ago

Last modified 4 weeks 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

Description (last modified by elexis)

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.

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 5 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by fatherbushido, 5 years ago

Always reproductible

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

comment:2 by elexis, 5 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, 5 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, 5 years ago

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

comment:5 by fatherbushido, 5 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, 5 years ago

Attachment: crash.txt added

in reply to:  5 comment:6 by Itms, 5 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, 5 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, 5 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, 2 years ago

Description: modified (diff)
Patch: Phab:D4250

comment:10 by elexis, 23 months ago

Patch: Phab:D4250Phab:D1674

comment:11 by wraitii, 4 weeks 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

Note: See TracTickets for help on using tickets.