Fix three i18n strings broken by stray pipe characters
What does this MR do and why?
This fixes three strings where a stray pipe causes a problem.
A namespace should be a PascalCase prefix followed by a single pipe, like ApprovalRule|day(s): https://docs.gitlab.com/development/i18n/externalization/#namespaces
Three strings have a problem:
-
ee/app/assets/javascripts/ci/pipelines_page/tokens/constants.js:s__('Pipeline|Source|Security Policy')!70182 (merged) renamed this family of strings from
Pipeline|Source|toPipelineSource|, and this one entry was missed. All 14 sibling entries already usePipelineSource|. -
ee/app/assets/javascripts/security_orchestration/components/policy_editor/scan_result/rule/scan_filters/constants.js:s__('ApprovalRule||year(s)').This had a doubled pipe. The three sibling entries above it use a single pipe.
-
app/assets/javascripts/analytics/shared/components/value_streams_dashboard_link.vue:__('Value Streams Dashboard | DORA')Here the pipe is part of the visible label, not a namespace. Translators read it as a namespace anyway and translated only what followed it. All ten locales that have a translation return just "DORA", for example in
locale/ja/gitlab.po:msgid "Value Streams Dashboard | DORA" msgstr "DORA"Now
Value Streams Dashboard (DORA). The@gitlab/require-valid-i18n-helpersESLint rule already flagged this and had been disabled in place. That disable comment is removed. Related to VSA - adding drill-up link to VSD comparison page (!112787 - merged)
For the first two there is no visible change in the UI. The pgettext helper in app/assets/javascripts/locale/index.js splits the key on the pipe character and returns the last segment, so both the old and new keys already render as "Security Policy" and "year(s)". The third is different: it is a real bug in those ten languages, where the link reads "DORA" instead of the full label.
The first two still matter because:
- Any code that strips the namespace up to the first pipe (the canonical rule used by
msgid_without_namespaceinlib/gitlab/i18n/translation_entry.rb) resolves these to the wrong labels:Source|Security Policyand|year(s). - Crowdin shows the namespace to translators as context, so an empty segment and a two part prefix are both misleading.
- These were found while building a documentation linter that checks UI text in docs against
locale/gitlab.pot(!253587 (merged))
References
- Related to Mark UI text with shortcodes and validate it ag... (!253587 - merged)
- Related to Fix multiple strings in translations (|, space,... (!70182 - merged)
- Related to Hugo shortcode to flag UI text instead of relyi... (gitlab-org/technical-writing/docs-gitlab-com#733 - closed)
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
This merge request was drafted with Claude Code.