[go: up one dir, main page]

Skip to content

Improve localizability of 'Create merge request' button on 'New merge request' form

Problem

The current implementation of the "Create merge request" button on the "New merge request" form uses a construction that makes proper localization difficult:

https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/views/shared/issuable/_form.html.haml#L60

= form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", ...

The current implementation

  • only externalizes the verb "Create" for translation
  • uses Rails' automatic conversion of class names (model_name.human.downcase) which is not working well for non-English languges
  • results in mixed-language buttons in non-English UI (e.g., "作成 merge request" in Japanese
  • does not allow translators to provide appropriate grammatical constructions for their languages, because the 'merge request' text is not externalized for translation

The issue was brought up by the Japanese localization team. See screenshots of the Slack thread in this note: #543136 (comment 2509416089)

Goal

Replace the current dynamic string composition with separate full-sentence and externalized strings based on the issuable type

Past reference

Edited by 🤖 GitLab Bot 🤖