Skip to content

Fix: client translations file will not load even when exists

What does this MR do and why?

The background

We are currently developing JH edition GitLab, and according to the agreement, JH cannot use the brand name GitLab instead we use JiHu GitLab, so that we will need to override some English content in our i18n translations.

The problem we encountered

For now, in the code, https://gitlab.com/gitlab-jh/jh-team/gitlab-fork/-/blob/835d3421ff8685cdc834cb5d57dde9916cb94c5d/app/views/layouts/_head.html.haml#L60

image

We have this line above, when the language is English, we will just skip load the translation file.

In fact, when you run the task rake gettext:po_to_json, there will be no translation file emitted for English, but in JH, we have generated a translation (override) file to override the text.

The fix

Since I mentioned above, when the user preferred language is English, GitLab will not load anything to the client side.

/cc @godfat-gitlab @iamphill

Describe in detail what your merge request does and why.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading