Commit 7c1647dc authored by Igor Drozdov's avatar Igor Drozdov

Rename master to main in views placeholders

As we migrate from master to main, let's rename the branch in
views as well
parent 069f2a6e
...@@ -18,7 +18,7 @@ module NotifyHelper ...@@ -18,7 +18,7 @@ module NotifyHelper
when "Developer" when "Developer"
s_("InviteEmail|As a developer, you have full access to projects, so you can take an idea from concept to production.") s_("InviteEmail|As a developer, you have full access to projects, so you can take an idea from concept to production.")
when "Maintainer" when "Maintainer"
s_("InviteEmail|As a maintainer, you have full access to projects. You can push commits to master and deploy to production.") s_("InviteEmail|As a maintainer, you have full access to projects. You can push commits to the default branch and deploy to production.")
when "Owner" when "Owner"
s_("InviteEmail|As an owner, you have full access to projects and can manage access to the group, including inviting new members.") s_("InviteEmail|As an owner, you have full access to projects and can manage access to the group, including inviting new members.")
when "Minimal Access" when "Minimal Access"
......
...@@ -2539,7 +2539,7 @@ class Project < ApplicationRecord ...@@ -2539,7 +2539,7 @@ class Project < ApplicationRecord
def default_branch_or_main def default_branch_or_main
return default_branch if default_branch return default_branch if default_branch
Gitlab::DefaultBranch.value(project: self) Gitlab::DefaultBranch.value(object: self)
end end
def ci_config_path_or_default def ci_config_path_or_default
......
...@@ -315,7 +315,7 @@ class Snippet < ApplicationRecord ...@@ -315,7 +315,7 @@ class Snippet < ApplicationRecord
override :default_branch override :default_branch
def default_branch def default_branch
super || Gitlab::DefaultBranch.value(project: project) super || Gitlab::DefaultBranch.value(object: project)
end end
def repository_storage def repository_storage
......
= form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-default-branch-name'), html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-default-branch-name'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
- fallback_branch_name = '<code>master</code>' - fallback_branch_name = "<code>#{Gitlab::DefaultBranch.value}</code>"
%fieldset %fieldset
.form-group .form-group
= f.label :default_branch_name, _('Default initial branch name'), class: 'label-light' = f.label :default_branch_name, _('Default initial branch name'), class: 'label-light'
= f.text_field :default_branch_name, placeholder: 'master', class: 'form-control gl-form-input' = f.text_field :default_branch_name, placeholder: Gitlab::DefaultBranch.value, class: 'form-control gl-form-input'
%span.form-text.text-muted %span.form-text.text-muted
= (_("Changes affect new repositories only. If not specified, Git's default name %{branch_name_default} will be used.") % { branch_name_default: fallback_branch_name } ).html_safe = (_("Changes affect new repositories only. If not specified, Git's default name %{branch_name_default} will be used.") % { branch_name_default: fallback_branch_name } ).html_safe
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
.settings-content .settings-content
= form_for @group, url: group_path(@group, anchor: 'js-default-branch-name'), html: { class: 'fieldset-form' } do |f| = form_for @group, url: group_path(@group, anchor: 'js-default-branch-name'), html: { class: 'fieldset-form' } do |f|
= form_errors(@group) = form_errors(@group)
- fallback_branch_name = '<code>master</code>' - fallback_branch_name = "<code>#{Gitlab::DefaultBranch.value(object: @group)}</code>"
%fieldset %fieldset
.form-group .form-group
= f.label :default_branch_name, _('Default initial branch name'), class: 'label-light' = f.label :default_branch_name, _('Default initial branch name'), class: 'label-light'
= f.text_field :default_branch_name, value: group.namespace_settings&.default_branch_name, placeholder: 'master', class: 'form-control' = f.text_field :default_branch_name, value: group.namespace_settings&.default_branch_name, placeholder: Gitlab::DefaultBranch.value(object: @group), class: 'form-control'
%span.form-text.text-muted %span.form-text.text-muted
= (_("Changes affect new repositories only. If not specified, either the configured application-wide default or Git's default name %{branch_name_default} will be used.") % { branch_name_default: fallback_branch_name }).html_safe = (_("Changes affect new repositories only. If not specified, either the configured application-wide default or Git's default name %{branch_name_default} will be used.") % { branch_name_default: fallback_branch_name }).html_safe
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
%h3.page-title %h3.page-title
= _("Compare Git revisions") = _("Compare Git revisions")
.sub-header-block .sub-header-block
- example_master = capture do - example_branch = capture do
%code.ref-name master %code.ref-name= @project.default_branch_or_main
- example_sha = capture do - example_sha = capture do
%code.ref-name 4eedf23 %code.ref-name 4eedf23
= html_escape(_("Choose a branch/tag (e.g. %{master}) or enter a commit (e.g. %{sha}) to see what's changed or to create a merge request.")) % { master: example_master.html_safe, sha: example_sha.html_safe } = html_escape(_("Choose a branch/tag (e.g. %{branch}) or enter a commit (e.g. %{sha}) to see what's changed or to create a merge request.")) % { branch: example_branch.html_safe, sha: example_sha.html_safe }
%br %br
= html_escape(_("Changes are shown as if the %{b_open}source%{b_close} revision was being merged into the %{b_open}target%{b_close} revision.")) % { b_open: '<b>'.html_safe, b_close: '</b>'.html_safe } = html_escape(_("Changes are shown as if the %{b_open}source%{b_close} revision was being merged into the %{b_open}target%{b_close} revision.")) % { b_open: '<b>'.html_safe, b_close: '</b>'.html_safe }
......
---
title: Rename master to main in views placeholders
merge_request: 61252
author:
type: changed
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
# Class is used while we're migrating from master to main # Class is used while we're migrating from master to main
module Gitlab module Gitlab
module DefaultBranch module DefaultBranch
def self.value(project: nil) def self.value(object: nil)
Feature.enabled?(:main_branch_over_master, project, default_enabled: :yaml) ? 'main' : 'master' Feature.enabled?(:main_branch_over_master, object, default_enabled: :yaml) ? 'main' : 'master'
end end
end end
end end
...@@ -6337,7 +6337,7 @@ msgstr "" ...@@ -6337,7 +6337,7 @@ msgstr ""
msgid "Choose File..." msgid "Choose File..."
msgstr "" msgstr ""
msgid "Choose a branch/tag (e.g. %{master}) or enter a commit (e.g. %{sha}) to see what's changed or to create a merge request." msgid "Choose a branch/tag (e.g. %{branch}) or enter a commit (e.g. %{sha}) to see what's changed or to create a merge request."
msgstr "" msgstr ""
msgid "Choose a file" msgid "Choose a file"
...@@ -17909,7 +17909,7 @@ msgstr "" ...@@ -17909,7 +17909,7 @@ msgstr ""
msgid "InviteEmail|As a guest, you can view projects, leave comments, and create issues." msgid "InviteEmail|As a guest, you can view projects, leave comments, and create issues."
msgstr "" msgstr ""
msgid "InviteEmail|As a maintainer, you have full access to projects. You can push commits to master and deploy to production." msgid "InviteEmail|As a maintainer, you have full access to projects. You can push commits to the default branch and deploy to production."
msgstr "" msgstr ""
msgid "InviteEmail|As a reporter, you can view projects and reports, and leave comments on issues." msgid "InviteEmail|As a reporter, you can view projects and reports, and leave comments on issues."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment