Skip to content

Commit

Permalink
Add new locales
Browse files Browse the repository at this point in the history
We are adding support for:

Croatian: hr
Danish: da
Dutch: nl
Finish fi
Icelandic is
Irish gd
Norwegian: no
Maltese: mt
Slovenian: sl
Swedish: sv

Add the locale codes to `config/application.rb` to enable them and also add
the files to `config/locales`. No translations are currently provided in
the locale files. These will be added at a later date. For now, we just
need to enable adding translations to publications for these languages.

Note that in config/locales/en.yml we've enclosed "no" in quotes. This
is because in YAML no is a [reserved word](https://yaml.org/type/bool.html).
We use rails_translation_manager to regenerate our locale files.
When rails_translation_manager loads the YAML and interprets
"no" as a bool instead of a locale, it breaks.
  • Loading branch information
Bevan Loon committed Apr 1, 2019
1 parent 9f68990 commit 60a16fa
Show file tree
Hide file tree
Showing 12 changed files with 3,508 additions and 5 deletions.
11 changes: 6 additions & 5 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ class Application < Rails::Application

# Explicitly set available locales
config.i18n.available_locales = [
:en, :ar, :az, :be, :bg, :bn, :cs, :cy, :de, :dr, :el,
:es, 'es-419', :et, :fa, :fr, :he, :hi, :hu, :hy, :id,
:it, :ja, :ka, :ko, :lt, :lv, :ms, :pl, :ps, :pt, :ro,
:ru, :si, :sk, :so, :sq, :sr, :sw, :ta, :th, :tk, :tr,
:uk, :ur, :uz, :vi, :zh, 'zh-hk', 'zh-tw'
:en, :ar, :az, :be, :bg, :bn, :cs, :cy, :da, :de, :dr, :el,
:es, 'es-419', :et, :fa, :fi, :fr, :gd, :he, :hi, :hr, :hu,
:hy, :id, :is, :it, :ja, :ka, :ko, :lt, :lv, :ms, :mt, :no,
:nl, :pl, :ps, :pt, :ro, :ru, :si, :sk, :sl, :so, :sq, :sr,
:sv, :sw, :ta, :th, :tk, :tr, :uk, :ur, :uz, :vi, :zh, 'zh-hk',
'zh-tw'
]

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
Expand Down
290 changes: 290 additions & 0 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
da:
content_item:
schema_name:
aaib_report:
one:
other:
announcement:
one:
other:
asylum_support_decision:
one:
other:
authored_article:
one:
other:
business_finance_support_scheme:
one:
other:
case_study:
one:
other:
closed_consultation:
one:
other:
cma_case:
one:
other:
coming_soon:
one:
other:
consultation:
one:
other:
consultation_outcome:
one:
other:
corporate_information_page:
one:
other:
corporate_report:
one:
other:
correspondence:
one:
other:
countryside_stewardship_grant:
one:
other:
decision:
one:
other:
detailed_guide:
one:
other:
dfid_research_output:
one:
other:
document_collection:
one:
other:
draft_text:
one:
other:
drug_safety_update:
one:
other:
employment_appeal_tribunal_decision:
one:
other:
employment_tribunal_decision:
one:
other:
esi_fund:
one:
other:
fatality_notice:
one:
other:
foi_release:
one:
other:
form:
one:
other:
government_response:
one:
other:
guidance:
one:
other:
impact_assessment:
one:
other:
imported:
one:
other:
independent_report:
one:
other:
international_development_fund:
one:
other:
international_treaty:
one:
other:
maib_report:
one:
other:
map:
one:
other:
medical_safety_alert:
one:
other:
national:
one:
other:
national_statistics:
one:
other:
national_statistics_announcement:
one:
other:
news_article:
one:
other:
news_story:
one:
other:
notice:
one:
other:
official:
one:
other:
official_statistics:
one:
other:
official_statistics_announcement:
one:
other:
open_consultation:
one:
other:
oral_statement:
one:
other:
policy:
one:
other:
policy_paper:
one:
other:
press_release:
one:
other:
promotional:
one:
other:
publication:
one:
other:
raib_report:
one:
other:
regulation:
one:
other:
research:
one:
other:
residential_property_tribunal_decision:
one:
other:
service_sign_in:
one:
other:
service_standard_report:
one:
other:
speaking_notes:
one:
other:
speech:
one:
other:
statement_to_parliament:
one:
other:
statistical_data_set:
one:
other:
statistics_announcement:
one:
other:
statutory_guidance:
one:
other:
take_part:
one:
other:
tax_tribunal_decision:
one:
other:
transcript:
one:
other:
transparency:
one:
other:
utaac_decision:
one:
other:
world_location_news_article:
one:
other:
world_news_story:
one:
other:
written_statement:
one:
other:
contents:
metadata:
published:
updated:
publication:
documents:
one:
other:
details:
common:
last_updated:
components:
figure:
image_credit:
published_dates:
hide_all_updates:
last_updated:
published:
see_all_updates:
show_all_updates:
publisher_metadata:
collections:
from:
hide_all:
show_all:
related_navigation:
collections:
external_links:
policies:
publishers:
related_content:
related_guides:
statistical_data_sets:
topical_events:
topics:
world_locations:
share_links:
share_this_page:
corporate_information_page:
about_our_services_html:
corporate_information:
personal_information_charter_html:
publication_scheme_html:
social_media_use_html:
welsh_language_scheme_html:
detailed_guide:
related_guides:
related_mainstream_content:
language_names:
da:
multi_page:
next_page:
previous_page:
print_entire_guide:
service_sign_in:
continue:
error:
option:
title:
time:
formats:
short_ordinal:
travel_advice:
alert_status:
avoid_all_but_essential_travel_to_parts:
avoid_all_but_essential_travel_to_whole_country:
avoid_all_travel_to_parts:
avoid_all_travel_to_whole_country:
10 changes: 10 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ en:
tk: Turkmen
uz: Uzbeki
id: Indonesian
nl: Dutch
"no": Norwegian
hr: Croatian
mt: Maltese
da: Danish
fi: Finish
is: Icelandic
gd: Irish
sl: Slovenian
sv: Swedish
content_item:
schema_name:
# `national` & `official` are old document types for
Expand Down
Loading

0 comments on commit 60a16fa

Please sign in to comment.