Opened 11 years ago

Closed 6 years ago

#431 closed improve feature (wontfix)

MOD_words: Don't use vsprintf() when there are no arguments defined. (half solution)

Reported by: lemon-head Owned by:
Priority: major Milestone: unassigned
Component: BW Internationalization Keywords: MOD_words


In MOD_words, the vsprintf() is used to replace %d in the translations with arguments defined in the php code. However, some words have % symbols inside, which are not meant to be replaced. In this case, if not enough arguments are given for all the % symbols, the vsprintf function will produce an error.

To reduce the problems caused by this, it would be better to only use vsprintf(), if there are actually some arguments defined.

An advanced solution will be to analyze the string for % symbols, and visualize the problem for translators, so that they can edit the word and clean up the % symbols.

Change History (4)

comment:1 Changed 7 years ago by TimLoal

  • Component changed from BW General to BW Internationalization

comment:2 Changed 7 years ago by jsfan

  • Milestone Future deleted

Milestone Future deleted

comment:3 Changed 6 years ago by shevek

  • Milestone set to unassigned

If we really need to have an % sign in a translatable item that isn't to be replaced it has to be escaped as %%! Closing as this can't be fixed programmatically.

comment:4 Changed 6 years ago by shevek

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.