Skip to content

Conversation

@Calinou
Copy link
Member

@Calinou Calinou commented Oct 27, 2025

  • Wrap localization pages to around 80 characters.

Note that I can't get this to work locally, see godotengine/godot#112073 (comment). I'm running into the same issue with plurals according to the example CSV given.

Also, is it possible to make either of these features work when using IDs for translation keys instead of plain English strings? We still recommend using IDs for CSV translation in general, so it's strange to see the documentation suddenly shift to English IDs with no explanation.

@Calinou Calinou added enhancement area:manual Issues and PRs related to the Manual/Tutorials section of the documentation topic:i18n Related to internationalization. labels Oct 27, 2025
@Calinou Calinou force-pushed the i18n-add-csv-plural-context branch from 0fe0e95 to 4572c4b Compare October 27, 2025 18:50
@mhilbrunner
Copy link
Member

@Calinou This needs a rebase now after the CI was fixed

@Calinou Calinou force-pushed the i18n-add-csv-plural-context branch from 4572c4b to e29e21e Compare October 30, 2025 22:45
@mhilbrunner
Copy link
Member

cc @timothyqiu @bruvzg Would be great if we could get either of you to give this a brief glance :) (Also see the questions in the PR description)

@timothyqiu
Copy link
Member

Note that I can't get this to work locally, see godotengine/godot#112073 (comment). I'm running into the same issue with plurals according to the example CSV given.

I can't reproduce the problem. Try the test project here: godotengine/godot#112073 (comment)

is it possible to make either of these features work when using IDs for translation keys instead of plain English strings?

It already works.

Generally speaking, IDs shouldn't be ambiguous, right?

# This already works.
tr("SOME_ID", "Context A")
tr("SOME_ID", "Context B")

# But this is more ideal, and can use auto-translation.
tr("CONTEXT_A_SOME_ID")
tr("CONTEXT_B_SOME_ID")

For plurals, I'd say tr_n() models the gettext ngettext() and is therefore designed for plain English strings.

It's a plural message as long as ?plural is non-empty. So I'd suggest setting it to something consistent and meaningful when using IDs.

# This already works.
tr_n("SOME_ID", "Plural", n)
tr_n("ANOTHER_ID", "Plural", n)
key,?plural,en
SOME_ID,Plural,Singular Form
,,Plural Form
ANOTHER_ID,Plural,Another singular form
,,Another plural form

it's strange to see the documentation suddenly shift to English IDs with no explanation.

In the class reference of ResourceImporterCSVTranslation, I used this as an introduction:

Although keys in the first column typically use uppercase string identifiers,
it is not uncommon to directly use strings appearing in the game as keys.

Since both context and plural functionality require the use of tr() or tr_n() in the script, I recommend mentioning these functions in the documentation, like in the class ref.

…preadsheets

- Wrap localization pages to around 80 characters.
@Calinou Calinou force-pushed the i18n-add-csv-plural-context branch from e29e21e to e64fed5 Compare November 3, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement topic:i18n Related to internationalization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants