Skip to content

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
CleanShot_2022-09-20_at_11.01.52_2x CleanShot_2022-09-20_at_11.42.27_2x

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. Go to you GDK
  2. Find a project with pipeline records.
  3. 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.

Merge request reports

Loading