Avoid plural forms in non-GUI translatable strings (lacks %n support) #31890

issue hebasto openend this issue on February 17, 2025
  1. hebasto commented at 2:50 pm on February 17, 2025: member

    In non-GUI code, translatable strings with format specifiers rely on the tinyformat::format implementation, which does not support the %n specifier that is crucial for pluralising with Qt translation tools.

    Therefore, it may be worth considering rephrasing translatable strings to avoid potential plural forms.

    This issue was initially reported on Transifex: https://app.transifex.com/bitcoin/bitcoin/translate/#fr/qt-translation-029x/570550303/.

    Here is an example of such a string: https://github.com/bitcoin/bitcoin/blob/db36a92c02b83f2e6477a5a55fc061319f7cc6a3/src/init.cpp#L991

  2. maflcko added the label Brainstorming on Feb 17, 2025
  3. maflcko added the label GUI on Feb 17, 2025
  4. maflcko added the label Utils/log/libs on Feb 17, 2025
  5. laanwj commented at 11:15 am on February 25, 2025: member

    Do we know how %n is implemented? Could this be added to tinyformat? Or does it rely on Qt specific state?

    Edit: no, i don’t think this is possible, it would need the translation engine while formatting.

  6. fanquake commented at 5:49 pm on March 4, 2025: member

    I’m not really sure what we can do here. We could try and change all the strings now, but then it’s whack-a-mole with requirements that developers are not really aware off, nor are enforced by anything (similar thoughts for changes like #31987).

    Here is an example of such a string: “Not enough file descriptors available. %d available, %d required.”

    What would you change the string to in this case? How many strings are there that need changing?

  7. hebasto commented at 6:22 pm on March 4, 2025: member

    What would you change the string to in this case?

    I’ve asked our translators.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-03-31 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me