Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@snowtimeglass
Copy link
Contributor

@snowtimeglass snowtimeglass commented Sep 17, 2025

An example of the timebox message:
image

Currently, the timebox dialog message is built from two separate strings (and a space), each containing one variable:
{ $count } cards studied in + + { $count } minutes.
image
image
As a result, translators cannot flexibly reorder the variables in their translation.

(In contrast, they can do so for Studied x cards in y minutes today (z s/card) on the deck list and the statistics screen.)
image
image
image

This PR's commit introduces a single string with both variables for the timebox message, allowing translators to adjust the order for more natural expressions in their languages.

@snowtimeglass snowtimeglass marked this pull request as draft September 17, 2025 01:52
@snowtimeglass snowtimeglass force-pushed the unify_timebox_string branch 5 times, most recently from 38df4e3 to d2a80ec Compare September 17, 2025 04:00
Currently, the timebox dialog message is built from two separate strings,
each containing one variable:
"{ $count } cards studied in" + "{ $count } minutes."

As a result, translators cannot freely reorder the variables in their translations.

This change introduces a single string with both variables, allowing translators
to adjust the order for more natural expressions in their languages.
@snowtimeglass snowtimeglass marked this pull request as ready for review September 17, 2025 04:14
@dae
Copy link
Member

dae commented Sep 17, 2025

Thanks!

@dae dae merged commit c295774 into ankitects:main Sep 17, 2025
1 check passed
@sommerluk
Copy link
Contributor

It's a small change, but one that makes translators' lives a lot easier.

Word puzzles composed of two or more strings that combine into a single final message are extremely difficult to translate. Unfortunately, Anki contains many of them. I would love to see them eliminated.

@snowtimeglass Thanks so much for your work and this pull request!

@snowtimeglass
Copy link
Contributor Author

@sommerluk Thanks a lot for your encouraging words!

@snowtimeglass snowtimeglass deleted the unify_timebox_string branch September 17, 2025 09:23
AmandaSternberg-creator pushed a commit to AmandaSternberg-creator/anki that referenced this pull request Sep 25, 2025
…ects#4338)

* Make timebox message translatable with flexible variable order

Currently, the timebox dialog message is built from two separate strings,
each containing one variable:
"{ $count } cards studied in" + "{ $count } minutes."

As a result, translators cannot freely reorder the variables in their translations.

This change introduces a single string with both variables, allowing translators
to adjust the order for more natural expressions in their languages.

* Preserve old string for now

* Ensure message doesn't display over two lines

---------

Co-authored-by: Damien Elmes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants