Skip to content

Show values and apostrophes in translated messages - #27735

Merged
MarkEWaite merged 1 commit into
jenkinsci:masterfrom
ityashag:fix-translation-messageformat
Nov 13, 2026
Merged

MarkEWaite merged 1 commit into
jenkinsci:masterfrom
ityashag:fix-translation-messageformat

Conversation

@ityashag

@ityashag ityashag commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Lone apostrophes doubled in 55 messages, keeping the deliberate '{' / '}' escapes, and leaving keys whose English text quotes on purpose (the search bar's '{0}', which is formatted twice).
  • Arguments the code never passes removed: 9 noWorkspace translations still linked to {0}/{1}build after 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.
  • English: the safe restart page's "if you don't supply one" read "dont".
  • A test checks every translation of a localizer bundle or a Jelly/Groovy view for both mistakes, and formats two real messages to show the fix.

Files read with ResourceBundle.getString (win32errors) or by the setup wizard's JavaScript are left alone, since they don't go through MessageFormat.

Testing done

  • TranslationFormatTest, new: on master it fails with 67 problems in 55 files, and ComputerSet.SlaveAlreadyExists formats as "O agente chamado {0} já existe" in pt-BR. With this change it passes: the same message reads "O agente chamado 'build-01' já existe", and the Italian Hudson.MustBeAtLeast keeps "dev'essere".
  • mvn -pl core test: 21,593 tests, 2 failures. Both are unreadableFile… tests in TarArchiverTest and ZipArchiverTest, which fail the same way on master here because the container runs as root.
  • mvn -pl core spotless:apply makes 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

  • Show values and apostrophes in translated messages that displayed {0} or dropped the apostrophe.

Proposed changelog category

/label localization

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, new or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 MarkEWaite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@comment-ops-bot comment-ops-bot Bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Nov 11, 2026
@MarkEWaite MarkEWaite added the pct-successful This PR has successfully passed the full plugin-compatibility-test suite label Nov 12, 2026
@MarkEWaite
MarkEWaite merged commit aacbe92 into jenkinsci:master Nov 13, 2026
19 checks passed
@welcome

welcome Bot commented Nov 13, 2026

Copy link
Copy Markdown

Congratulations on getting your very first Jenkins core pull request merged 🎉🥳

This is a fantastic achievement, and we're thrilled to have you as part of our community! Thank you for your valuable input, and we look forward to seeing more of your contributions in the future!

We would like to invite you to join the community chats and forums to meet other Jenkins contributors 😊
Don't forget to check out the participation page to learn more about how to contribute to Jenkins.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

localization pct-successful This PR has successfully passed the full plugin-compatibility-test suite ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants