Skip to content

Scripting: create possibility to distinguish if technical strings ('unexpected translations') were localized on purpose or altered by mistake#3309

Merged
tupaschoal merged 11 commits intoOpenRCT2:masterfrom
tygrysek90:origin/scripting-unexpected-modify
Aug 14, 2025
Merged

Scripting: create possibility to distinguish if technical strings ('unexpected translations') were localized on purpose or altered by mistake#3309
tupaschoal merged 11 commits intoOpenRCT2:masterfrom
tygrysek90:origin/scripting-unexpected-modify

Conversation

@tygrysek90
Copy link
Contributor

This PR:

  • changes slightly wording in translation_check.py in line for so-called 'Unexpected' translations, produces warning Warning: Supossed to remain intact <- foremost-ly to avoid possible confusion, to be more clear and understandable for future use

  • since it was found that some so-called technical strings, as found in KEYS_TO_IGNORE are necessary to be localized in a few translations, a warning suppression mechanism is created:

    • this expects each language maintainer reviewing issued warning (checking if localization is needed or string was changed by mistake)
    • in case language maintainer finds that strings must be somehow localized, language maintainer will need to commit PR adding respective STR_numbers to newly created suppress_warning.py
      • this happens while taking advantage of all existing procedures (PR-s, comments, blame history, etc) which we like to use
  • the PR tackles part of problems defined by discussion with @tupaschoal in

  • opening currently as draft - to discuss - if nothing else, there is probably bunch of typos, as I realized i don't have a spellcheck in IDLE

  • thank you for reading

@github-actions
Copy link

github-actions bot commented Aug 9, 2025

Check results

For details go to Translation Check -> Details. Expand Run checks build stage and use the build-in search to find your language (e.g. pl-PL)

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

Other translations

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

ar-EG 277 0 1728
ca-ES 18 0 91
cs-CZ 0 0 150
da-DK 13 0 324
de-DE 11 0 147
en-US 3453 0 1
eo-ZZ 2 0 72
es-ES 8 0 166
fi-FI 97 0 95
fr-CA 3618 0 0
fr-FR 2 0 144
gl-ES 2 0 94
hu-HU 0 0 95
it-IT 20 0 138
ja-JP 97 0 121
ko-KR 0 0 95
nb-NO 186 0 162
nl-NL 11 0 184
pl-PL 60 0 99
pt-BR 0 0 142
ru-RU 0 0 118
sv-SE 8 0 161
tr-TR 515 0 98
uk-UA 181 0 719
vi-VN 25 0 117
zh-CN 8 0 36
zh-TW 44 0 115

Copy link
Member

@tupaschoal tupaschoal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea, of course we should first make sure there are no current wrong "keys_to_ignore", to clean up from the main list, then we can add exclusions here.

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
@github-actions
Copy link

Check results

For details click the build job and expand Run checks on the CI logs.

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

Other translations

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

ar-EG 278 0 1728
ca-ES 19 0 91
cs-CZ 1 0 150
da-DK 14 0 324
de-DE 12 0 147
en-US 3454 0 1
eo-ZZ 3 0 72
es-ES 9 0 166
fi-FI 98 0 95
fr-CA 3619 0 0
fr-FR 3 0 144
gl-ES 3 0 94
hu-HU 1 0 95
it-IT 21 0 138
ja-JP 98 0 121
ko-KR 1 0 95
nb-NO 187 0 162
nl-NL 12 0 184
pl-PL 61 0 99
pt-BR 1 0 142
ru-RU 1 0 118
sv-SE 9 0 161
tr-TR 516 0 98
uk-UA 182 0 719
vi-VN 26 0 117
zh-CN 9 0 36
zh-TW 45 0 115

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
@github-actions
Copy link

Check results

For details click the build job and expand Run checks on the CI logs.

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

Other translations

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

ar-EG 278 0 1728
ca-ES 19 0 91
cs-CZ 1 0 150
da-DK 14 0 324
de-DE 12 0 147
en-US 3454 0 1
eo-ZZ 3 0 72
es-ES 9 0 166
fi-FI 98 0 95
fr-CA 3619 0 0
fr-FR 3 0 144
gl-ES 3 0 94
hu-HU 1 0 95
it-IT 21 0 138
ja-JP 98 0 121
ko-KR 1 0 95
nb-NO 187 0 162
nl-NL 12 0 184
pl-PL 61 0 99
pt-BR 1 0 142
ru-RU 1 0 118
sv-SE 9 0 161
tr-TR 516 0 98
uk-UA 182 0 719
vi-VN 26 0 117
zh-CN 9 0 36
zh-TW 45 0 115

@github-actions
Copy link

Check results

For details click the build job and expand Run checks on the CI logs.

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

Other translations

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

ar-EG 278 0 1728
ca-ES 19 0 91
cs-CZ 1 0 150
da-DK 14 0 324
de-DE 12 0 147
en-US 3454 0 1
eo-ZZ 3 0 72
es-ES 9 0 166
fi-FI 98 0 95
fr-CA 3619 0 0
fr-FR 3 0 144
gl-ES 3 0 94
hu-HU 1 0 95
it-IT 21 0 138
ja-JP 98 0 121
ko-KR 1 0 95
nb-NO 187 0 162
nl-NL 12 0 184
pl-PL 61 0 99
pt-BR 1 0 142
ru-RU 1 0 118
sv-SE 9 0 161
tr-TR 516 0 98
uk-UA 182 0 719
vi-VN 26 0 117
zh-CN 9 0 36
zh-TW 45 0 115

@github-actions
Copy link

Check results

For details click the build job and expand Run checks on the CI logs.

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

Other translations

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

ar-EG 278 0 1728
ca-ES 19 0 91
cs-CZ 1 0 150
da-DK 14 0 324
de-DE 12 0 147
en-US 3454 0 1
eo-ZZ 3 0 72
es-ES 9 0 166
fi-FI 98 0 95
fr-CA 3619 0 0
fr-FR 3 0 144
gl-ES 3 0 94
hu-HU 1 0 95
it-IT 21 0 138
ja-JP 98 0 121
ko-KR 1 0 95
nb-NO 187 0 162
nl-NL 12 0 184
pl-PL 61 0 99
pt-BR 1 0 142
ru-RU 1 0 118
sv-SE 9 0 161
tr-TR 516 0 98
uk-UA 182 0 719
vi-VN 26 0 117
zh-CN 9 0 36
zh-TW 45 0 115

@github-actions
Copy link

Check results

For details click the build job and expand Run checks on the CI logs.

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

Other translations

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

ar-EG 278 0 1728
ca-ES 19 0 91
cs-CZ 1 0 150
da-DK 14 0 324
de-DE 12 0 147
en-US 3454 0 1
eo-ZZ 3 0 72
es-ES 9 0 166
fi-FI 98 0 95
fr-CA 3619 0 0
fr-FR 3 0 144
gl-ES 3 0 94
hu-HU 1 0 95
it-IT 21 0 138
ja-JP 98 0 121
ko-KR 1 0 95
nb-NO 187 0 162
nl-NL 12 0 184
pl-PL 61 0 99
pt-BR 1 0 142
ru-RU 1 0 118
sv-SE 9 0 161
tr-TR 516 0 98
uk-UA 182 0 719
vi-VN 26 0 117
zh-CN 9 0 36
zh-TW 45 0 115

@github-actions
Copy link

Check results

For details click the build job and expand Run checks on the CI logs.

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

Other translations

MissingThe translation is not added to translation file. (e.g. STR_9999 is in en-GB but is not available in given language)

Not neededThe translation file contains entries that are not in en-GB and should be removed (e.g. STR_9999 exists in given language but is not in en-GB)

SameThe translation and source string is exactly the same. (e.g. STR_9999 is Umbrella in both en-GB and given language). This may be desired in some cases (e.g. April is the same in English and German)

ar-EG 278 0 1728
ca-ES 19 0 91
cs-CZ 1 0 150
da-DK 14 0 324
de-DE 12 0 147
en-US 3454 0 1
eo-ZZ 3 0 72
es-ES 9 0 166
fi-FI 98 0 95
fr-CA 3619 0 0
fr-FR 3 0 144
gl-ES 3 0 94
hu-HU 1 0 95
it-IT 21 0 138
ja-JP 98 0 121
ko-KR 1 0 95
nb-NO 187 0 162
nl-NL 12 0 184
pl-PL 61 0 99
pt-BR 1 0 142
ru-RU 1 0 118
sv-SE 9 0 161
tr-TR 516 0 98
uk-UA 182 0 719
vi-VN 26 0 117
zh-CN 9 0 36
zh-TW 45 0 115

@tygrysek90
Copy link
Contributor Author

At this point, suggested and requested changes were incorporated, typos fixed (spelling of the word suppress...)

Only point remaining that is not fine remains:

print(f'Translation not expected ({len(messages["unexpected"])})\nPlease review and if OK, add to suppress_warning.py:')

Maybe could we call it technical string? And have the message "Technical string modified in translation"?

What do you think @tupaschoal ?

@tupaschoal
Copy link
Member

Maybe could we call it technical string? And have the message "Technical string modified in translation"?

I think it sounds fine, something like:

Technical strings modified (XX).\nIt's not expected for these to be translated, but if it makes sense for your language, add a waiver for them on suppress_warning.py and open a PR explaining why"?

It's a bit lengthy, but I think it's alright (we might want to break into two or three print/lines to make more readable on the actual script.

@tygrysek90
Copy link
Contributor Author

It's a bit lengthy, but I think it's alright (we might want to break into two or three print/lines to make more readable on the actual script.

For me personally, it is better to receive longer, but clearer message than to get stub of sentence that will keep me puzzled for next week ;)

For sake of well-reading formatted to 80 column width:

Technical strings modified (XX).\n
It's not expected for these to be translated, but if it makes sense for your
language, add a waiver for them on suppress_warning.py and open a PR explaining
why.

I will update the PR soon with this version

modify action log message for "unexpected" to "Technical strings modified"
add condition for explanation message to be shown only if there are "technical strings modified"
@tygrysek90
Copy link
Contributor Author

Found that 80 column width is too narrow, hence I chosen to break it in two so it is easier to read and looks logical -
one line is as cause and second as solution

I fined tuned it with commit above, adding condition for the longer (explanation) part of text to be printed only in case there are some "Technical strings modified"

Here is screenshot of output in staged repository:
Snímek obrazovky z 2025-08-11 13-05-40

I feel the PR is ready now.

(We could add Technical strings to comment output, just for one language at time but I would leave that to another time)

@tygrysek90 tygrysek90 marked this pull request as ready for review August 11, 2025 11:33
@tygrysek90 tygrysek90 requested a review from tupaschoal August 11, 2025 11:33
Copy link
Member

@tupaschoal tupaschoal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the suppressions final or do you intend to patch other languages too?

tygrysek90 and others added 2 commits August 12, 2025 12:20
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
@tygrysek90
Copy link
Contributor Author

Are the suppressions final or do you intend to patch other languages too?

Well that is a good question! I have filled the given list with something (so it makes some sense while write-test-review process).

However now I feel I should actually purge the suppression list.

For sake of cleanliness and serving complete process:

  1. language maintainer observes script output (or repo maintainer observes and creates issue for lang maintainer)
  2. language maintainer decides what action to take
  3. language maintainer submits a PR resolving situation - a: reverts translation, b: suppresses warning

Here now, we (together with @tupaschoal ) are standing as script writers. We give a tool - none of us can not say whether it is right or wrong to have it translated (there might be reasons it is good or bad beyond our understanding, beyond facts we can see from our perspectives)

To metaphor, when you buy impact drill, the shop assistant will not tell you where you should drill :)

to have a clean start
@tygrysek90 tygrysek90 requested a review from tupaschoal August 12, 2025 10:38
@tupaschoal tupaschoal merged commit df96aba into OpenRCT2:master Aug 14, 2025
@tygrysek90 tygrysek90 deleted the origin/scripting-unexpected-modify branch September 15, 2025 05:03
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.

2 participants