Add translations for rails date order

Not doing so caused crashes on applications which don't fall back to
English when a translation is missing.

We're adding them in a separate file so we can exclude it from crowdin
and so translators don't translate symbols as if they were words which
need translation.
This commit is contained in:
Javi Martín
2018-12-21 19:31:03 +01:00
parent d4013ee664
commit e34a827c48
53 changed files with 315 additions and 4 deletions

View File

@@ -93,7 +93,9 @@
</div> </div>
<div class="small-12 medium-3 clear"> <div class="small-12 medium-3 clear">
<%= f.submit t("verification.residence.new.verify_residence"), class: "button success expanded" %> <%= f.submit t("verification.residence.new.verify_residence"),
id: "new_residence_submit",
class: "button success expanded" %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -22,6 +22,7 @@ data:
## Another gem (replace %#= with %=): ## Another gem (replace %#= with %=):
# - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml" # - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"
- config/locales/custom/%{locale}/*.yml - config/locales/custom/%{locale}/*.yml
- config/locales/%{locale}/rails_date_order.yml
- config/locales/%{locale}/general.yml - config/locales/%{locale}/general.yml
- config/locales/%{locale}/activerecord.yml - config/locales/%{locale}/activerecord.yml
- config/locales/%{locale}/activemodel.yml - config/locales/%{locale}/activemodel.yml
@@ -124,6 +125,7 @@ ignore_unused:
- 'budgets.index.section_header.*' - 'budgets.index.section_header.*'
- 'activerecord.*' - 'activerecord.*'
- 'activemodel.*' - 'activemodel.*'
- 'date.order'
- 'unauthorized.*' - 'unauthorized.*'
- 'admin.officials.level_*' - 'admin.officials.level_*'
- 'admin.comments.index.filter*' - 'admin.comments.index.filter*'

View File

@@ -0,0 +1,6 @@
ar:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
ast:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
ca:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
de:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
en-GB:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
en-US:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
en:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
es-AR:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-BO:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-CL:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-CO:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-CR:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-DO:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-EC:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-GT:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-HN:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-MX:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-NI:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-PA:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-PE:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-PR:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-PY:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-SV:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-UY:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es-VE:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
es:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
eu:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
fa:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
fi:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
fr:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
gl:
date:
order:
- :day
- :month
- :year

View File

@@ -0,0 +1,6 @@
he:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
id:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
it:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
nl:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
pap:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
pl:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
pt-BR:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
ru:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
sl:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
so:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
sq:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
sv-FI:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
sv:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
tr:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
val:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
zh-CN:
date:
order:
- :year
- :month
- :day

View File

@@ -0,0 +1,6 @@
zh-TW:
date:
order:
- :year
- :month
- :day

View File

@@ -1,6 +1,8 @@
files: files:
- source: /config/locales/en/**.yml - source: /config/locales/en/**.yml
translation: /config/locales/%locale%/%original_file_name% translation: /config/locales/%locale%/%original_file_name%
ignore:
- /config/locales/**/rails_date_order.yml
update_option: update_without_changes update_option: update_without_changes
languages_mapping: languages_mapping:
locale: locale:

View File

@@ -24,4 +24,19 @@ feature 'Level two verification' do
expect(page).to have_content 'Code correct' expect(page).to have_content 'Code correct'
end end
context "In Spanish, with no fallbacks" do
before do
skip unless I18n.available_locales.include?(:es)
allow(I18n.fallbacks).to receive(:[]).and_return([:es])
end
scenario "Works normally" do
user = create(:user)
login_as(user)
visit verification_path(locale: :es)
verify_residence
end
end
end end

View File

@@ -10,12 +10,14 @@ module Verifications
def verify_residence def verify_residence
select 'DNI', from: 'residence_document_type' select 'DNI', from: 'residence_document_type'
fill_in 'residence_document_number', with: "12345678Z" fill_in 'residence_document_number', with: "12345678Z"
select_date '31-December-1980', from: 'residence_date_of_birth' select_date "31-#{I18n.l(Date.current.at_end_of_year, format: "%B")}-1980",
from: "residence_date_of_birth"
fill_in 'residence_postal_code', with: '28013' fill_in 'residence_postal_code', with: '28013'
check 'residence_terms_of_service' check 'residence_terms_of_service'
click_button 'Verify residence' click_button "new_residence_submit"
expect(page).to have_content 'Residence verified' expect(page).to have_content I18n.t("verification.residence.create.flash.success")
end end
def officing_verify_residence def officing_verify_residence