Draft: Update extract_gettext_all to handle escaped characters
What does this MR do and why?
Update scripts/frontend/extract_gettext_all.js
to handle escaped characters
When using the HTML entity code for angle brackets
according to https://docs.gitlab.com/ee/development/i18n/externalization.html#including-angle-brackets
the translation file generates the unescaped value which
looks like gettext-extractor
behavior.
This change reverses this behaviour.
Adds custom form for GAR integration settings (!144704 - merged) adds text GoogleArtifactRegistry|View them in %{strongStart}Deploy > Google Artifact Registry%{strongEnd}.
We get pipeline error: https://gitlab.com/gitlab-org/gitlab/-/jobs/6168126519
**** bin/rake gettext:lint failed with the following error(s):
Linting po files: |============================================================|
Errors in `/builds/gitlab-org/gitlab/locale/gitlab.pot`:
GoogleArtifactRegistry|View them in %{strongStart}Deploy > Google Artifact Registry%{strongEnd}.
contains < or >. Use variables to include HTML in the string, or the < and > codes for the symbols. For more info see: https://docs.gitlab.com/ee/development/i18n/externalization.html#html
Updated to use HTML entity codes. Running tooling/bin/gettext_extractor locale/gitlab.pot
did not result any change in locale/gitlab.pot
file, so it results in the same pipeline error.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Update any
.html.haml
file with translation text that contains>
- Similarly, update any
.vue
file with translation text that contains>
. - Run
tooling/bin/gettext_extractor locale/gitlab.pot
. Observe that thelocale/gitlab.pot
files have the newly added text. - Update the translations to use
>
instead of>
. Re-runtooling/bin/gettext_extractor locale/gitlab.pot
. - In
locale/gitlab.pot
, notice that the text added in the.html.haml
file gets updated to use the HTML entity code but the text added in the.vue
file still renders>
. - Apply this patch.
- Re-run
tooling/bin/gettext_extractor locale/gitlab.pot
. The text added in the.vue
file should now be rendered>