Repository navigation
Show values and apostrophes in translated messages - #27735
Conversation
Localizer messages and Jelly view text go through MessageFormat, where a
lone apostrophe starts a quoted run: the apostrophe is dropped and a {0}
inside the run is printed as is. 55 translations wrote a single quote
where the English files write '', and 12 read arguments their callers
never pass, so users saw "O agente chamado {0} já existe" or
"Il valore devessere maggiore o uguale a {0}". The English safe restart
text read "dont".
TranslationFormatTest checks every translation of a localizer bundle or a
Jelly/Groovy view for both mistakes.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the localization formatting fixes and regression checks.
No open issues 🎉
What changed in this PR
This PR corrects message formatting in Jenkins core translations so argument values and apostrophes display correctly, and adds regression checks for localization resources.
Changes:
- Escape literal apostrophes in translations and the English safe-restart description while preserving intentional formatting escapes.
- Remove obsolete workspace links and argument references that callers no longer supply.
- Add translation-wide validation and formatting assertions for Brazilian Portuguese and Italian messages.
| File | Description |
|---|---|
core/src/test/java/jenkins/util/TranslationFormatTest.java |
Adds translation validation and formatting regression tests. |
core/src/main/resources/lib/hudson/thirdPartyLicenses_ru.properties |
Preserves the apostrophe in the Maven label. |
core/src/main/resources/lib/hudson/project/config-scm_ru.properties |
Escapes the checkout label’s apostrophe. |
core/src/main/resources/jenkins/slaves/systemInfo/Messages_ru.properties |
Preserves the class-loader label’s apostrophe. |
core/src/main/resources/jenkins/security/ResourceDomainConfiguration/config_tr.properties |
Escapes the resource URL label’s apostrophe. |
core/src/main/resources/jenkins/security/Messages_it.properties |
Preserves an apostrophe in token guidance. |
core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_tr.properties |
Corrects apostrophe escaping in relationship help. |
core/src/main/resources/jenkins/model/Jenkins/oops_ru.properties |
Preserves an apostrophe in error-reporting guidance. |
core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sr.properties |
Preserves quotes around .jar. |
core/src/main/resources/jenkins/model/Jenkins/_safeRestart.properties |
Preserves the apostrophe in “don't.” |
core/src/main/resources/jenkins/model/CoreEnvironmentContributor/buildEnv_sr.properties |
Preserves punctuation quotes without altering brace escapes. |
core/src/main/resources/jenkins/model/CoreEnvironmentContributor/buildEnv_fr.properties |
Escapes an apostrophe in executor guidance. |
core/src/main/resources/jenkins/appearance/Messages_tr.properties |
Preserves the appearance description’s apostrophe. |
core/src/main/resources/jenkins/agents/Messages_tr.properties |
Enables cloud-name substitution inside quotes. |
core/src/main/resources/hudson/util/IncompatibleAntVersionDetected/index_nl.properties |
Preserves quotes around class-loader terminology. |
core/src/main/resources/hudson/util/IncompatibleAntVersionDetected/index_de.properties |
Escapes an apostrophe in Ant guidance. |
core/src/main/resources/hudson/triggers/SCMTrigger/BuildAction/index_es.properties |
Preserves quotes in polling-log text. |
core/src/main/resources/hudson/triggers/SCMTrigger/AdministrativeMonitorImpl/message_bg.properties |
Preserves HTML link attribute quotes. |
core/src/main/resources/hudson/tasks/Messages_sr.properties |
Removes an unavailable script-name argument. |
core/src/main/resources/hudson/tasks/Messages_pl.properties |
Escapes apostrophes in Ant messages. |
core/src/main/resources/hudson/tasks/Fingerprinter/FingerprintAction/index_tr.properties |
Preserves an apostrophe in fingerprint text. |
core/src/main/resources/hudson/tasks/Fingerprinter/FingerprintAction/index_de.properties |
Preserves a trailing apostrophe in fingerprint text. |
core/src/main/resources/hudson/slaves/SimpleScheduledRetentionStrategy/help_it.properties |
Escapes apostrophes in scheduled-agent help. |
core/src/main/resources/hudson/slaves/RetentionStrategy/Demand/help_it.properties |
Escapes apostrophes in demand-based retention help. |
core/src/main/resources/hudson/slaves/RetentionStrategy/Always/help_it.properties |
Escapes apostrophes in always-online help. |
core/src/main/resources/hudson/slaves/Messages_es.properties |
Aligns Java-version placeholders with supplied arguments. |
core/src/main/resources/hudson/slaves/JNLPLauncher/help_fr.properties |
Preserves an apostrophe in connection guidance. |
core/src/main/resources/hudson/security/LegacySecurityRealm/config_ja.properties |
Preserves quotes around the URL slash. |
core/src/main/resources/hudson/model/Slave/help-retentionStrategy_it.properties |
Escapes an apostrophe in agent-retention help. |
core/src/main/resources/hudson/model/Run/delete_pt_BR.properties |
Enables build-name substitution inside quotes. |
core/src/main/resources/hudson/model/Messages_pt_BR.properties |
Restores quoted argument values and punctuation. |
core/src/main/resources/hudson/model/Messages_it.properties |
Preserves apostrophes and numeric validation limits. |
core/src/main/resources/hudson/model/Messages_de.properties |
Removes an unavailable argument and escapes an apostrophe. |
core/src/main/resources/hudson/model/Fingerprint/index_de.properties |
Preserves a trailing apostrophe in fingerprint text. |
core/src/main/resources/hudson/model/BuildAuthorizationToken/config_tr.properties |
Escapes an apostrophe in remote-build guidance. |
core/src/main/resources/hudson/model/AbstractProject/configure-common_pt_BR.properties |
Preserves quotes around build-log terminology. |
core/src/main/resources/hudson/model/AbstractProject/changes_tr.properties |
Preserves apostrophes and change-range arguments. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_zh_TW.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_sk.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_ru.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_pt_PT.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_lv.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_lt.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_ko.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_et.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/model/AbstractItem/noWorkspace_ca.properties |
Removes the obsolete parameterized build link. |
core/src/main/resources/hudson/Messages_sr.properties |
Preserves quotes around the wildcard character. |
core/src/main/resources/hudson/markup/EscapedMarkupFormatter/config_ja.properties |
Preserves quotes around HTML-sensitive characters. |
core/src/main/resources/hudson/logging/LogRecorderManager/index_nl.properties |
Preserves the log label’s apostrophe. |
core/src/main/resources/hudson/lifecycle/Messages_pt_BR.properties |
Enables agent-directory substitution inside quotes. |
core/src/main/resources/hudson/diagnosis/TooManyJobsButNoView/message_zh_TW.properties |
Preserves quotes around the add-view symbol. |
core/src/main/resources/hudson/diagnosis/TooManyJobsButNoView/message_nl.properties |
Preserves quotes around the add-view symbol. |
core/src/main/resources/hudson/diagnosis/TooManyJobsButNoView/message_ja.properties |
Preserves quotes around the add-view symbol. |
core/src/main/resources/hudson/diagnosis/TooManyJobsButNoView/message_de.properties |
Preserves quotes around the add-view symbol. |
core/src/main/resources/hudson/diagnosis/TooManyJobsButNoView/message_da.properties |
Preserves quotes around the add-view symbol. |
core/src/main/resources/hudson/diagnosis/NullIdDescriptorMonitor/message_it.properties |
Escapes an apostrophe in error-reporting guidance. |
core/src/main/resources/hudson/cli/Messages_lt.properties |
Preserves an apostrophe in the session-ID description. |
Review effort: Balanced
MarkEWaite
left a comment
There was a problem hiding this comment.
Thanks!
This PR is now ready for merge. We will merge it when merging is allowed, if there is no negative feedback. Please see the merge process documentation for more information about the merge process.
/label ready-for-merge
|
Congratulations on getting your very first Jenkins core pull request merged 🎉🥳 |
In 55 translation files across 21 languages, a message shows
{0}instead of its value, loses its apostrophe, or reads an argument the code never passes. For example, a Brazilian Portuguese user creating an agent whose name is taken reads "O agente chamado {0} já existe", and an Italian user reads "Il valore devessere maggiore o uguale a {0}", with neither the apostrophe nor the number.Both localizer messages and the text of Jelly views go through
MessageFormat, where a lone'starts a quoted run: the apostrophe is dropped, and a{0}inside the run is printed as is. The English files already write''for this (didn''t,controller''s); these translations didn't.'{'/'}'escapes, and leaving keys whose English text quotes on purpose (the search bar's'{0}', which is formatted twice).noWorkspacetranslations still linked to{0}/{1}buildafter the English text dropped the link, and the German, Serbian and Spanish versions of three messages read{0}or{2}that their callers don't pass.Files read with
ResourceBundle.getString(win32errors) or by the setup wizard's JavaScript are left alone, since they don't go throughMessageFormat.Testing done
TranslationFormatTest, new: onmasterit fails with 67 problems in 55 files, andComputerSet.SlaveAlreadyExistsformats as "O agente chamado {0} já existe" inpt-BR. With this change it passes: the same message reads "O agente chamado 'build-01' já existe", and the ItalianHudson.MustBeAtLeastkeeps "dev'essere".mvn -pl core test: 21,593 tests, 2 failures. Both areunreadableFile…tests inTarArchiverTestandZipArchiverTest, which fail the same way onmasterhere because the container runs as root.mvn -pl core spotless:applymakes no changes.Screenshots (UI changes only)
Before
O agente chamado {0} já existe(pt-BR),Il valore devessere maggiore o uguale a {0}(it),…if you dont supply one.(en)After
O agente chamado 'build-01' já existe,Il valore dev'essere maggiore o uguale a 5,…if you don't supply one.Proposed changelog entries
{0}or dropped the apostrophe.Proposed changelog category
/label localization
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@mention
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered.