Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Norwegian translation (#2492) #2495

Merged
merged 15 commits into from Nov 27, 2023
4 changes: 2 additions & 2 deletions app/helpers/localization_helper.rb
Expand Up @@ -15,9 +15,9 @@ def theft_alert_plan_title(plan)
#
# [<localized language name>, <language key (from Blog::LANGUAGE_ENUM)>]
def language_choices
# Currently skipping norwegian on the frontend
@language_choices ||=
I18n
.available_locales
(I18n.available_locales - [:nb])
.map { |locale| [t(locale, scope: [:locales]), locale.to_s] }
.sort_by { |language_name, _| language_name.downcase }
end
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Expand Up @@ -45,7 +45,7 @@ class Application < Rails::Application
config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**", "*.{rb,yml}").to_s]
config.i18n.enforce_available_locales = false
config.i18n.default_locale = :en
config.i18n.available_locales = %i[en nl]
config.i18n.available_locales = %i[en nl nb]
config.i18n.fallbacks = {"en-US": :en, "en-GB": :en}

config.middleware.use Rack::Throttle::Minute,
Expand Down
3 changes: 3 additions & 0 deletions config/i18n-tasks.yml
Expand Up @@ -21,10 +21,13 @@ data:
## Default:
- config/locales/doorkeeper.en.yml
- config/locales/doorkeeper.nl.yml
- config/locales/doorkeeper.nb.yml
- config/locales/gflash.en.yml
- config/locales/gflash.nl.yml
- config/locales/gflash.nb.yml
- config/locales/en.yml
- config/locales/nl.yml
- config/locales/nb.yml

# Locale files to write new keys to, based on a list of key pattern => file
# rules. Matched from top to bottom:
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/translation.rb
Expand Up @@ -3,7 +3,7 @@
TranslationIO.configure do |config|
config.api_key = ENV["TRANSLATION_IO_API_KEY"]
config.source_locale = "en"
config.target_locales = ["nl"]
config.target_locales = %w[nl nb]

# Uncomment this if you don't want to use gettext
config.disable_gettext = true
Expand Down
2 changes: 1 addition & 1 deletion config/locales/.translation_io
@@ -1,2 +1,2 @@
---
timestamp: 1699243342
timestamp: 1701112839
2 changes: 2 additions & 0 deletions config/locales/en.yml
Expand Up @@ -3828,6 +3828,7 @@ en:
please_fix_the_following: Please fix the following %{errors}
locales:
en: English
nb: Norwegian (Bokmål)
nl: Nederlands (Dutch)
locks:
edit:
Expand Down Expand Up @@ -3978,6 +3979,7 @@ en:
en: USD
en-GB: GBP
es: EUR
nb: EUR
nl: EUR
my_accounts:
edit:
Expand Down
67 changes: 67 additions & 0 deletions config/locales/localization.nb.yml
@@ -0,0 +1,67 @@
# THIS FILE CONTAINS LOCALIZATION KEYS : date and number formats, number precisions,
# number separators and all non-textual values depending on the language.
# These values must not reach the translator, so they are separated in this file.
#
# More info here: https://translation.io/blog/gettext-is-better-than-rails-i18n#localization
#
# You can edit and/or add new localization keys here, they won't be touched by Translation.io.
#
# If you want to add a new localization key prefix, use the option described here:
# https://github.com/translation/rails#custom-localization-key-prefixes
#
---
nb:
date:
formats:
default: "%d-%m-%Y"
long: "%e %B %Y"
short: "%e %b"
order:
- :day
- :month
- :year
number:
currency:
format:
delimiter: "."
format: "%u %n"
precision: 2
separator: ","
significant: false
strip_insignificant_zeros: false
unit: "€"
format:
delimiter: "."
precision: 2
separator: ","
significant: false
strip_insignificant_zeros: false
human:
decimal_units:
format: "%n %u"
units:
unit: ''
format:
delimiter: ''
precision: 3
significant: true
strip_insignificant_zeros: true
storage_units:
format: "%n %u"
percentage:
format:
delimiter: ''
format: "%n%"
precision:
format:
delimiter: ''
support:
array:
last_word_connector: " en "
two_words_connector: " en "
words_connector: ", "
time:
formats:
default: "%a %d %b %Y %H:%M:%S %Z"
long: "%d %B %Y %H:%M"
short: "%d %b %H:%M"