Fix: locale on pipeline infos page
What does this MR do and why?
Reason
The pipeline infos page now contains lots of unlocalized texts, this MR is meant to fix them.
/cc @prajnamas @orozot @qk44077907
Elaborations
pipeline_presenter.rb
The current implementation in pipeline_presenter.rb
uses syntax:
_('texts %{placeholder1}' % { ...replacements } )
Which will be formatted by %
before it gets processed by _
method. For English, it was ok because English did not have a translation file in the first place, but for other languages other than English it will be a problem since the formatted key was not found in the translation file thus the key will be directly rendered to the client, it causes the issue in the before
screenshot: 1 related 合并请求. -- A mixed content.
time_helper.rb
For this file, I replaced the usage of pluralize
to n_
since this is how we localize pluralized forms of text. As for to_sentence
, I left it untouched since I have no idea what is the better way to fix it, since the translated output for to_sentence
method in Chinese did not make any since to me as a native speaker.
Screenshots or screen recordings
before | after |
---|---|
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Go to you GDK
- Find a project with pipeline records.
- Go to any pipeline detail page, and Observe.
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.
-
I have evaluated the MR acceptance checklist for this MR.