From 31a3c332bd5b87704f84f258b35b53fc6b59b703 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 28 Aug 2025 22:46:55 -0600 Subject: [PATCH] Explicitly define the MR and Issue create button text Please see: https://gitlab.com/gitlab-org/gitlab/-/issues/543136 for more information. Note these: - "Rails' automatic conversion of class names (model_name.human.downcase) which is not working well for non-English languages". - "does not allow translators to provide appropriate grammatical constructions for their languages" While dynamic humanization and downcasing of the model name is graceful, it's probably not worth the localization harms caused, and the potential overhead of explicitly defining the strings for each type of issuable is not going to be all that challenging (a small handful of items, perhaps). At the moment I believe this is exclusively "merge request" and "issue". Changelog: fixed --- app/views/shared/issuable/_form.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 526f58fe344c2c..6dfe5e524390f4 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -57,7 +57,8 @@ = safe_format(_('Please review the %{strong_start}%{contribution_guidelines_start}contribution guidelines%{contribution_guidelines_end}%{strong_end} for this project.'), tag_pair(''.html_safe, :strong_start, :strong_end), tag_pair(contribution_guidelines, :contribution_guidelines_start, :contribution_guidelines_end)) - if issuable.new_record? - = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", pajamas_button: true, class: 'gl-mr-2 js-issuable-submit-button js-reset-autosave', data: { testid: 'issuable-create-button', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } + - create_issuable_text = issuable.is_a?(MergeRequest) ? _('Create merge request') : _('Create issue') + = form.submit "#{create_issuable_text}", pajamas_button: true, class: 'gl-mr-2 js-issuable-submit-button js-reset-autosave', data: { testid: 'issuable-create-button', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - else = form.submit _('Save changes'), pajamas_button: true, class: 'gl-mr-2 js-issuable-submit-button js-reset-autosave', data: { track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } -- GitLab