Merge pull request #2949 from consul/i18n-language-names
Display language name or language key
This commit is contained in:
@@ -48,4 +48,31 @@ feature 'Localization' do
|
||||
expect(page).not_to have_content('Language')
|
||||
expect(page).not_to have_css('div.locale')
|
||||
end
|
||||
|
||||
context "Missing language names" do
|
||||
|
||||
let!(:default_enforce) { I18n.enforce_available_locales }
|
||||
let!(:default_locales) { I18n.available_locales.dup }
|
||||
|
||||
before do
|
||||
I18n.enforce_available_locales = false
|
||||
I18n.available_locales = default_locales + [:wl]
|
||||
I18n.locale = :wl
|
||||
end
|
||||
|
||||
after do
|
||||
I18n.enforce_available_locales = default_enforce
|
||||
I18n.available_locales = default_locales
|
||||
I18n.locale = I18n.default_locale
|
||||
end
|
||||
|
||||
scenario 'Available locales without language translation display locale key' do
|
||||
visit '/'
|
||||
|
||||
within('.locale-form .js-location-changer') do
|
||||
expect(page).to have_content 'wl'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -162,7 +162,7 @@ feature "Custom Pages" do
|
||||
scenario "Add a translation in Português", :js do
|
||||
visit @edit_page_url
|
||||
|
||||
select "Português", from: "translation_locale"
|
||||
select "Português brasileiro", from: "translation_locale"
|
||||
fill_in 'site_customization_page_title_pt_br', with: 'Titulo em Português'
|
||||
|
||||
click_button 'Update Custom page'
|
||||
@@ -174,7 +174,7 @@ feature "Custom Pages" do
|
||||
click_link "Español"
|
||||
expect(page).to have_field('site_customization_page_title_es', with: 'Titulo en Español')
|
||||
|
||||
click_link "Português"
|
||||
click_link "Português brasileiro"
|
||||
expect(page).to have_field('site_customization_page_title_pt_br', with: 'Titulo em Português')
|
||||
end
|
||||
|
||||
|
||||
@@ -91,11 +91,11 @@ feature "Translations" do
|
||||
scenario "Add a translation for a locale with non-underscored name", :js do
|
||||
visit @edit_answer_url
|
||||
|
||||
select('Português', from: 'translation_locale')
|
||||
select('Português brasileiro', from: 'translation_locale')
|
||||
fill_in_ckeditor 'poll_question_answer_description_pt_br', with: 'resposta em Português'
|
||||
click_button 'Save'
|
||||
|
||||
select('Português', from: 'locale-switcher')
|
||||
select('Português brasileiro', from: 'locale-switcher')
|
||||
expect(page).to have_content("resposta em Português")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user