From be0cf9c9269d0529ed4a2f2153e5617df4e01e29 Mon Sep 17 00:00:00 2001 From: Alan Gabbianelli Date: Wed, 16 Dec 2020 11:07:13 +0000 Subject: [PATCH 1/3] Sort available_locales + consistently use symbols --- config/application.rb | 128 +++++++++++++++++++++--------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/config/application.rb b/config/application.rb index 2a4934add..c05068a38 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,70 +35,70 @@ class Application < Rails::Application config.i18n.default_locale = :en # Explicitly set available locales - config.i18n.available_locales = [ - :en, - :ar, - :az, - :be, - :bg, - :bn, - :cs, - :cy, - :da, - :de, - :dr, - :el, - :es, - "es-419", - :et, - :fa, - :fi, - :fr, - :gd, - :gu, - :he, - :hi, - :hr, - :hu, - :hy, - :id, - :is, - :it, - :ja, - :ka, - :kk, - :ko, - :lt, - :lv, - :ms, - :mt, - :no, - :nl, - :pa, - :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", + config.i18n.available_locales = %i[ + en + ar + az + be + bg + bn + cs + cy + da + de + dr + el + es + es-419 + et + fa + fi + fr + gd + gu + he + hi + hr + hu + hy + id + is + it + ja + ka + kk + ko + lt + lv + ms + mt + no + nl + pa + 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 From a98893692596def3ced5ec1d92f9a00d076e4cf6 Mon Sep 17 00:00:00 2001 From: Alan Gabbianelli Date: Wed, 16 Dec 2020 11:21:38 +0000 Subject: [PATCH 2/3] Sort language_names by their key (locale code) --- config/locales/en.yml | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index d968418da..73b6f39ac 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -64,68 +64,68 @@ en: see_all_updates: "see all updates" language_names: ar: Arabic + az: Azeri + be: Belarusian + bg: Bulgarian + bn: Bangla + cs: Czech + cy: Welsh + da: Danish de: German dr: Dari + el: Greek en: English - cy: Welsh es: Spanish es-419: Latin American Spanish et: Estonian fa: Persian + fi: Finish fr: French + gd: Irish gu: Gujarati - it: Italian - ja: Japanese - pt: Portuguese - ru: Russian - tr: Turkish - ur: Urdu - zh: Chinese - zh-hk: Cantonese - zh-tw: Traditional Chinese - bg: Bulgarian - cs: Czech he: Hebrew - ko: Korean - pa: Punjabi - pl: Polish - ro: Romanian - sr: Serbian - th: Thai - uk: Ukrainian - vi: Vietnamese - sq: Albanian + hi: Hindi + hr: Croatian + hu: Hungarian hy: Armenian - az: Azeri - bn: Bangla - be: Belarusian + id: Indonesian + is: Icelandic + it: Italian + ja: Japanese ka: Georgian - el: Greek - hu: Hungarian - hi: Hindi - lv: Latvian + kk: Kazakh + ko: Korean lt: Lithuanian + lv: Latvian ms: Malay + mt: Maltese + nl: Dutch + "no": Norwegian + pa: Punjabi + pl: Polish ps: Pashto + pt: Portuguese + ro: Romanian + ru: Russian si: Sinhala sk: Slovakian + sl: Slovenian so: Somali + sq: Albanian + sr: Serbian + sv: Swedish sw: Swahili ta: Tamil + th: Thai tk: Turkmen + tr: Turkish + uk: Ukrainian + ur: Urdu uz: Uzbeki - id: Indonesian - nl: Dutch - "no": Norwegian - hr: Croatian - mt: Maltese - da: Danish - fi: Finish - is: Icelandic - gd: Irish - sl: Slovenian - sv: Swedish - kk: Kazakh + vi: Vietnamese + zh: Chinese + zh-hk: Cantonese + zh-tw: Traditional Chinese content_item: schema_name: # `national` & `official` are old document types for From 653b02d3452a537b231ba5b0e91358a21558b55f Mon Sep 17 00:00:00 2001 From: Alan Gabbianelli Date: Wed, 16 Dec 2020 12:00:37 +0000 Subject: [PATCH 3/3] Add pa-ur locale (Punjabi Shahmukhi - Urdu script) We already support `pa`, Punjabi Gurmukhi, a language used in Punjab, India. This is to add `pa-ur`, Punjabi Shahmukhi, a language used in Punjab, Pakistan, that uses the Urdu script. More information on the two languages can be found on this Wikipedia page: https://en.wikipedia.org/wiki/Punjabi_language The reason `pa-ur` was chosen as locale code is that `pa` is the language code for Punjabi and `ur` is the script subtag for Urdu. More information on this can be found on this Mozilla developer docs page: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax Docs followed: https://docs.publishing.service.gov.uk/manual/add-translation-whitehall.html Zendesk ticket: https://govuk.zendesk.com/agent/tickets/4371686 Related PRs: - https://github.com/alphagov/whitehall/pull/5915 - https://github.com/alphagov/government-frontend/pull/1942/commits - https://github.com/alphagov/govuk-content-schemas/pull/1034 - https://github.com/alphagov/content-store/pull/791 - https://github.com/alphagov/publishing-api/pull/1883 --- config/application.rb | 1 + config/locales/en.yml | 1 + config/locales/pa-ur.yml | 290 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 292 insertions(+) create mode 100644 config/locales/pa-ur.yml diff --git a/config/application.rb b/config/application.rb index c05068a38..19fd64ddf 100644 --- a/config/application.rb +++ b/config/application.rb @@ -75,6 +75,7 @@ class Application < Rails::Application no nl pa + pa-ur pl ps pt diff --git a/config/locales/en.yml b/config/locales/en.yml index 73b6f39ac..5f418d7e0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -102,6 +102,7 @@ en: nl: Dutch "no": Norwegian pa: Punjabi + pa-ur: Punjabi Shahmukhi pl: Polish ps: Pashto pt: Portuguese diff --git a/config/locales/pa-ur.yml b/config/locales/pa-ur.yml new file mode 100644 index 000000000..018fdd5db --- /dev/null +++ b/config/locales/pa-ur.yml @@ -0,0 +1,290 @@ +pa-ur: + 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: + pa-ur: پن٘جابی + 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: