Skip to content

Add i18n support for message on todos page

What does this MR do and why?

This MR adds i18n support for message on todos page.

In a non-English environment, the todos page still displays English sentences. The reason is that gitlab just reads sentences from config/no_todos_messages.yml and didn't consider i18n.

Why use crowdin instead of yaml?

  1. One yaml file cannot automatically switch languages.
  2. Multiple yaml files are difficult to manage. If we create a yaml for each language, we still have to deal with language switching ourselves. Crowdin has already done this for us, we don't have to work so hard. What's more, if we want to update a statement and have to change all the yml files...
  3. We don't need to update config/no_todos_messages.yml frequently. The only advantage of yaml seems to be that it's easy to update, but this yaml hasn't been updated in three years.

How to set up and validate locally

Page kink: https://gitlab.com/dashboard/todos

  1. Do not carry any parameters after the path
  2. Make sure you have resolved all todos in this page
  3. Change the page language to Chinese (or any language except English)

Screenshots or screen recordings

When switching the page language to Chinese:

Before After
image image

After merged, remember to update crowdin about these new keywords in gitlab.pot @luzhiyuan.deer

cc @tonygodspeed92 & JH EM @prajnamas

Edited by Zhiyuan Lu

Merge request reports

Loading