Opened 3 years ago

Last modified 6 months 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:D4250

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

Download all attachments as: .zip

Change History (10)

comment:1 Changed 3 years ago by fatherbushido

Always reproductible

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

comment:2 Changed 3 years ago by elexis

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

comment:3 Changed 3 years ago by fatherbushido

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 Changed 3 years ago by fabio

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

comment:5 Changed 3 years ago by 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.

Changed 3 years ago by fatherbushido

Attachment: crash.txt added

comment:6 in reply to:  5 Changed 3 years ago by Itms

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 Changed 3 years ago by Itms

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 Changed 3 years ago by Itms

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 Changed 6 months ago by elexis

Description: modified (diff)
Patch: Phab:D4250
Note: See TracTickets for help on using tickets.