Skip to content
代码片段 群组 项目
提交 ea91ae50 编辑于 作者: Eduardo Sanz García's avatar Eduardo Sanz García
浏览文件

Remove hard coded language

By removing the hard coded language we enable a better experience with
the language switcher.

Changelog: changed
上级 92c68caf
No related branches found
No related tags found
1 合并请求!1915Draft: debug loading events execution error
- add_page_specific_style 'page_bundles/login' - add_page_specific_style 'page_bundles/login'
- custom_text = custom_sign_in_description - custom_text = custom_sign_in_description
!!! 5 !!! 5
%html.html-devise-layout{ lang: "en" } %html.html-devise-layout{ lang: I18n.locale }
= render "layouts/head", { startup_filename: 'signin' } = render "layouts/head", { startup_filename: 'signin' }
%body.gl-h-full.login-page.navless{ class: "#{system_message_class} #{user_application_theme} #{client_class_list}", data: { page: body_data_page, qa_selector: 'login_page' } } %body.gl-h-full.login-page.navless{ class: "#{system_message_class} #{user_application_theme} #{client_class_list}", data: { page: body_data_page, qa_selector: 'login_page' } }
= header_message = header_message
......
- add_page_specific_style 'page_bundles/login' - add_page_specific_style 'page_bundles/login'
!!! 5 !!! 5
%html.html-devise-layout{ lang: "en" } %html.html-devise-layout{ lang: I18n.locale }
= render "layouts/head" = render "layouts/head"
%body.gl-h-full.login-page.navless{ class: "#{system_message_class} #{user_application_theme} #{client_class_list}" } %body.gl-h-full.login-page.navless{ class: "#{system_message_class} #{user_application_theme} #{client_class_list}" }
= header_message = header_message
......
- add_page_specific_style 'page_bundles/signup' - add_page_specific_style 'page_bundles/signup'
- add_page_specific_style 'page_bundles/login' - add_page_specific_style 'page_bundles/login'
!!! 5 !!! 5
%html.html-devise-layout{ lang: 'en' } %html.html-devise-layout{ lang: I18n.locale }
= render "layouts/head" = render "layouts/head"
%body.signup-page.navless{ class: "#{system_message_class} #{user_application_theme} #{client_class_list}", data: { page: body_data_page, qa_selector: 'signup_page' } } %body.signup-page.navless{ class: "#{system_message_class} #{user_application_theme} #{client_class_list}", data: { page: body_data_page, qa_selector: 'signup_page' } }
= header_message = header_message
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
end end
it_behaves_like 'a layout which reflects the application theme setting' it_behaves_like 'a layout which reflects the application theme setting'
it_behaves_like 'a layout which reflects the preferred language'
describe 'layouts/_user_notification_dot' do describe 'layouts/_user_notification_dot' do
let(:track_selector) { '[data-track-action="render"][data-track-label="show_buy_ci_minutes_notification"]' } let(:track_selector) { '[data-track-action="render"][data-track-label="show_buy_ci_minutes_notification"]' }
......
# frozen_string_literal: true
RSpec.shared_examples 'a layout which reflects the preferred language' do
context 'when changing the a preferred language' do
before do
Gitlab::I18n.locale = :es
end
after do
Gitlab::I18n.use_default_locale
end
it 'renders the correct `lang` attribute in the html element' do
render
expect(rendered).to have_css('html[lang=es]')
end
end
end
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
end end
it_behaves_like 'a layout which reflects the application theme setting' it_behaves_like 'a layout which reflects the application theme setting'
it_behaves_like 'a layout which reflects the preferred language'
describe "visual review toolbar" do describe "visual review toolbar" do
context "ENV['REVIEW_APPS_ENABLED'] is set to true" do context "ENV['REVIEW_APPS_ENABLED'] is set to true" do
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
RSpec.describe 'layouts/devise', feature_category: :user_management do RSpec.describe 'layouts/devise', feature_category: :user_management do
it_behaves_like 'a layout which reflects the application theme setting' it_behaves_like 'a layout which reflects the application theme setting'
it_behaves_like 'a layout which reflects the preferred language'
describe 'logo' do describe 'logo' do
it 'renders GitLab logo' do it 'renders GitLab logo' do
......
...@@ -4,4 +4,5 @@ ...@@ -4,4 +4,5 @@
RSpec.describe 'layouts/devise_empty' do RSpec.describe 'layouts/devise_empty' do
it_behaves_like 'a layout which reflects the application theme setting' it_behaves_like 'a layout which reflects the application theme setting'
it_behaves_like 'a layout which reflects the preferred language'
end end
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
end end
it_behaves_like 'a layout which reflects the application theme setting' it_behaves_like 'a layout which reflects the application theme setting'
it_behaves_like 'a layout which reflects the preferred language'
describe 'sidebar' do describe 'sidebar' do
context 'when nav is set' do context 'when nav is set' do
......
...@@ -4,4 +4,5 @@ ...@@ -4,4 +4,5 @@
RSpec.describe 'layouts/signup_onboarding' do RSpec.describe 'layouts/signup_onboarding' do
it_behaves_like 'a layout which reflects the application theme setting' it_behaves_like 'a layout which reflects the application theme setting'
it_behaves_like 'a layout which reflects the preferred language'
end end
...@@ -10,4 +10,5 @@ ...@@ -10,4 +10,5 @@
end end
it_behaves_like 'a layout which reflects the application theme setting' it_behaves_like 'a layout which reflects the application theme setting'
it_behaves_like 'a layout which reflects the preferred language'
end end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册