diff --git a/.travis.yml b/.travis.yml index e16eac7..7f367db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ - nodejs - wkhtmltopdf + addons: + artifacts: + s3_region: "eu-west-2" + matrix: fast_finish: true include: diff --git a/app/models/language.rb b/app/models/language.rb index a6492f4..0d7da23 100644 --- a/app/models/language.rb +++ b/app/models/language.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == Schema Information # # Table name: languages @@ -10,6 +12,7 @@ # class Language < ActiveRecord::Base + # frozen_string_literal: true include ValidationValues @@ -20,7 +23,7 @@ ABBREVIATION_MAXIMUM_LENGTH = 5 - ABBREVIATION_FORMAT = /\A[a-z]{2}(\_[A-Z]{2})?\Z/ + ABBREVIATION_FORMAT = /\A[a-z]{2}(\-[A-Z]{2})?\Z/ NAME_MAXIMUM_LENGTH = 20 @@ -47,6 +50,12 @@ validates :default_language, inclusion: { in: BOOLEAN_VALUES } + # ============= + # = Callbacks = + # ============= + + before_validation :format_abbreviation, if: :abbreviation_changed? + # ========== # = Scopes = # ========== @@ -58,7 +67,20 @@ where(abbreviation: abbreviation).pluck(:id).first } + # ======================== + # = Public class methods = + # ======================== + def self.many? Rails.cache.fetch([model_name, "many?"], expires_in: 1.hour) { all.many? } end + + private + + def format_abbreviation + abbreviation.downcase! + return if abbreviation.blank? || abbreviation =~ /\A[a-z]{2}\Z/i + self.abbreviation = LocaleFormatter.new(abbreviation, format: :i18n).to_s + end + end diff --git a/app/views/org_admin/phases/_phase.html.erb b/app/views/org_admin/phases/_phase.html.erb index 37736ac..cb088e3 100644 --- a/app/views/org_admin/phases/_phase.html.erb +++ b/app/views/org_admin/phases/_phase.html.erb @@ -6,7 +6,7 @@ <%= phase.title %>
<% if template.customization_of.present? && template.latest? %> - <%= link_to _('Customize phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> + <%= link_to _('Customise phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> <% elsif modifiable %> <%= link_to _('Edit phase'), edit_org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> <% else %> diff --git a/app/views/org_admin/templates/_show.html.erb b/app/views/org_admin/templates/_show.html.erb index 0780400..61be031 100644 --- a/app/views/org_admin/templates/_show.html.erb +++ b/app/views/org_admin/templates/_show.html.erb @@ -16,14 +16,14 @@ <%= _('Original funder template has changed!') %> <% else %> <% if template.published? %> - <%= template.customization_of.present? ? _('Customizations are published') : _('Published') %> + <%= template.customization_of.present? ? _('Customisations are published') : _('Published') %> <% elsif template.draft? %> <% tooltip = _('You have unpublished changes! Select "Publish changes" in the Actions menu when you are ready to make them available to users.') %> - <%= template.customization_of.present? ? _('Customizations are published') :_('Published')%> + <%= template.customization_of.present? ? _('Customisations are published') :_('Published')%> <%= tooltip %>    <% else %> - <%= template.customization_of.present? ? _('Customizations are unpublished') :_('Unpublished') %> + <%= template.customization_of.present? ? _('Customisations are unpublished') :_('Unpublished') %> <% end %> <% end %> diff --git a/app/views/org_admin/templates/index.html.erb b/app/views/org_admin/templates/index.html.erb index de858a9..8cddce3 100644 --- a/app/views/org_admin/templates/index.html.erb +++ b/app/views/org_admin/templates/index.html.erb @@ -59,7 +59,7 @@ <% if !current_user.org.funder_only? %> <% end %> diff --git a/config/environments/development.rb b/config/environments/development.rb index b55ece1..16b7c89 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,7 +1,5 @@ Rails.application.configure do - config.i18n.available_locales = %w[en en_GB] - # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development diff --git a/config/environments/test.rb b/config/environments/test.rb index 40e3ea4..d50d50c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -4,10 +4,6 @@ # Disable memory store cache set in application.rb config.cache_store = :null_store - # This is required for the Faker gem. See this issue here: - # https://github.com/stympy/faker/issues/266 - config.i18n.available_locales = %w[en en_GB] - # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb index d812f4a..25dc19a 100644 --- a/config/initializers/fast_gettext.rb +++ b/config/initializers/fast_gettext.rb @@ -1,19 +1,21 @@ # When Travis runs this, the DB isn't always built yet. if Language.table_exists? def default_locale - Language.default.try(:abbreviation) || 'en_GB' + Language.default.try(:abbreviation) || 'en-GB' end def available_locales - Language.sorted_by_abbreviation.pluck(:abbreviation).presence || [default_locale] + LocaleSet.new( + Language.sorted_by_abbreviation.pluck(:abbreviation).presence || [default_locale] + ) end else def default_locale - Rails.application.config.i18n.available_locales.first + Rails.application.config.i18n.available_locales.first || 'en-GB' end def available_locales - Rails.application.config.i18n.available_locales + Rails.application.config.i18n.available_locales = LocaleSet.new(['en-GB', 'en']) end end @@ -24,6 +26,10 @@ report_warning: false, }) +I18n.available_locales += available_locales.for(:i18n) +FastGettext.default_available_locales = available_locales.for(:fast_gettext) + FastGettext.default_text_domain = 'app' -FastGettext.default_locale = default_locale -FastGettext.default_available_locales = available_locales + +I18n.default_locale = available_locales.for(:i18n).first +FastGettext.default_locale = available_locales.for(:fast_gettext).first diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index 4f18d7f..bfebb7b 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -1,24 +1,7 @@ -# This initilializer should not be removed unless all internationalisation is handled by gettext_rails -DMPRoadmap::Application.config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s] -module I18n - class Config - def locale - FastGettext.locale - end - def locale=(new_locale) - FastGettext.locale = (new_locale) - end - def default_locale - FastGettext.default_locale - end - def default_locale=(new_default_locale) - FastGettext.default_locale = (new_default_locale) - end - def available_locales - FastGettext.default_available_locales - end - def available_locales=(new_available_locales) - FastGettext.default_available_locales = (new_available_locales) - end - end -end \ No newline at end of file +# frozen_string_literal: true + +# This initilializer should not be removed unless all internationalisation is handled by +# gettext_rails +DMPRoadmap::Application.config.i18n.load_path += Dir[ + Rails.root.join('config', 'locales', '**', '*.yml').to_s +] diff --git a/config/locales/bootstrap/en-GB.bootstrap.yml b/config/locales/bootstrap/en-GB.bootstrap.yml new file mode 100644 index 0000000..8f6b06d --- /dev/null +++ b/config/locales/bootstrap/en-GB.bootstrap.yml @@ -0,0 +1,18 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en-GB: + helpers: + actions: "Actions" + links: + back: "Back" + cancel: "Cancel" + confirm: "Are you sure?" + destroy: "Delete" + new: "New" + edit: "Edit" + titles: + edit: "Edit" + save: "Save" + new: "New" + delete: "Delete" \ No newline at end of file diff --git a/config/locales/bootstrap/en-US.bootstrap.yml b/config/locales/bootstrap/en-US.bootstrap.yml new file mode 100644 index 0000000..4d377ce --- /dev/null +++ b/config/locales/bootstrap/en-US.bootstrap.yml @@ -0,0 +1,18 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en-US: + helpers: + actions: "Actions" + links: + back: "Back" + cancel: "Cancel" + confirm: "Are you sure?" + destroy: "Delete" + new: "New" + edit: "Edit" + titles: + edit: "Edit" + save: "Save" + new: "New" + delete: "Delete" diff --git a/config/locales/bootstrap/en_GB.bootstrap.yml b/config/locales/bootstrap/en_GB.bootstrap.yml deleted file mode 100644 index d2482c1..0000000 --- a/config/locales/bootstrap/en_GB.bootstrap.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -en_GB: - helpers: - actions: "Actions" - links: - back: "Back" - cancel: "Cancel" - confirm: "Are you sure?" - destroy: "Delete" - new: "New" - edit: "Edit" - titles: - edit: "Edit" - save: "Save" - new: "New" - delete: "Delete" \ No newline at end of file diff --git a/config/locales/bootstrap/en_US.bootstrap.yml b/config/locales/bootstrap/en_US.bootstrap.yml deleted file mode 100644 index a86d68b..0000000 --- a/config/locales/bootstrap/en_US.bootstrap.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -en_US: - helpers: - actions: "Actions" - links: - back: "Back" - cancel: "Cancel" - confirm: "Are you sure?" - destroy: "Delete" - new: "New" - edit: "Edit" - titles: - edit: "Edit" - save: "Save" - new: "New" - delete: "Delete" diff --git a/config/locales/bootstrap/fr-FR.bootstrap.yml b/config/locales/bootstrap/fr-FR.bootstrap.yml new file mode 100644 index 0000000..6570c15 --- /dev/null +++ b/config/locales/bootstrap/fr-FR.bootstrap.yml @@ -0,0 +1,17 @@ + +fr-FR: + helpers: + actions: "Actions" + links: + back: "Retour" + cancel: "Annuler" + confirm: "Êtes-vous sûr?" + destroy: "Supprimer" + new: "Nouveau" + edit: "Modifier" + titles: + edit: "Modifier" + save: "Enregistrer" + new: "Nouveau" + delete: "Supprimer" + diff --git a/config/locales/bootstrap/fr_FR.bootstrap.yml b/config/locales/bootstrap/fr_FR.bootstrap.yml deleted file mode 100644 index 13928b1..0000000 --- a/config/locales/bootstrap/fr_FR.bootstrap.yml +++ /dev/null @@ -1,17 +0,0 @@ - -fr_FR: - helpers: - actions: "Actions" - links: - back: "Retour" - cancel: "Annuler" - confirm: "Êtes-vous sûr?" - destroy: "Supprimer" - new: "Nouveau" - edit: "Modifier" - titles: - edit: "Modifier" - save: "Enregistrer" - new: "Nouveau" - delete: "Supprimer" - diff --git a/config/locales/bootstrap/pt-BR.bootstrap.yml b/config/locales/bootstrap/pt-BR.bootstrap.yml new file mode 100644 index 0000000..5edcf69 --- /dev/null +++ b/config/locales/bootstrap/pt-BR.bootstrap.yml @@ -0,0 +1,18 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +pt-BR: + helpers: + actions: "Ações" + links: + back: "Volte" + cancel: "Cancelar" + confirm: "Are you sure?" + destroy: "Você tem certeza?" + new: "Novo" + edit: "Editar" + titles: + edit: "Editar" + save: "Salve" + new: "Novo" + delete: "Excluir" \ No newline at end of file diff --git a/config/locales/bootstrap/pt_BR.bootstrap.yml b/config/locales/bootstrap/pt_BR.bootstrap.yml deleted file mode 100644 index 8c72113..0000000 --- a/config/locales/bootstrap/pt_BR.bootstrap.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -pt_BR: - helpers: - actions: "Ações" - links: - back: "Volte" - cancel: "Cancelar" - confirm: "Are you sure?" - destroy: "Você tem certeza?" - new: "Novo" - edit: "Editar" - titles: - edit: "Editar" - save: "Salve" - new: "Novo" - delete: "Excluir" \ No newline at end of file diff --git a/config/locales/contact_us/contact_us.en-GB.yml b/config/locales/contact_us/contact_us.en-GB.yml new file mode 100644 index 0000000..1b809b0 --- /dev/null +++ b/config/locales/contact_us/contact_us.en-GB.yml @@ -0,0 +1,25 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en-GB: + contact_us: + contact_mailer: + contact_email: + sent_by_contact_form: "Sent by contact form from %{email}" + sent_by_name: "Sent by %{name} from %{email}" + subject: "Contact Us message from %{email}" + contacts: + new: &new + contact_us: "Contact Us" + email: "Email" + message: "Message" + name: "Name" + subject: "Subject" + submit: "Submit" + new_formtastic: + <<: *new + new_simple_form: + <<: *new + notices: + error: "You must enter both fields." + success: "Contact email was successfully sent." diff --git a/config/locales/contact_us/contact_us.en-US.yml b/config/locales/contact_us/contact_us.en-US.yml new file mode 100644 index 0000000..33f5573 --- /dev/null +++ b/config/locales/contact_us/contact_us.en-US.yml @@ -0,0 +1,25 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en-US: + contact_us: + contact_mailer: + contact_email: + sent_by_contact_form: "Sent by contact form from %{email}" + sent_by_name: "Sent by %{name} from %{email}" + subject: "Contact Us message from %{email}" + contacts: + new: &new + contact_us: "Contact Us" + email: "Email" + message: "Message" + name: "Name" + subject: "Subjecter" + submit: "Submit" + new_formtastic: + <<: *new + new_simple_form: + <<: *new + notices: + error: "You must enter both fields." + success: "Contact email was successfully sent." diff --git a/config/locales/contact_us/contact_us.en_GB.yml b/config/locales/contact_us/contact_us.en_GB.yml deleted file mode 100644 index 01ff8a0..0000000 --- a/config/locales/contact_us/contact_us.en_GB.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -en_GB: - contact_us: - contact_mailer: - contact_email: - sent_by_contact_form: "Sent by contact form from %{email}" - sent_by_name: "Sent by %{name} from %{email}" - subject: "Contact Us message from %{email}" - contacts: - new: &new - contact_us: "Contact Us" - email: "Email" - message: "Message" - name: "Name" - subject: "Subject" - submit: "Submit" - new_formtastic: - <<: *new - new_simple_form: - <<: *new - notices: - error: "You must enter both fields." - success: "Contact email was successfully sent." diff --git a/config/locales/contact_us/contact_us.en_US.yml b/config/locales/contact_us/contact_us.en_US.yml deleted file mode 100644 index 054a40e..0000000 --- a/config/locales/contact_us/contact_us.en_US.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -en_US: - contact_us: - contact_mailer: - contact_email: - sent_by_contact_form: "Sent by contact form from %{email}" - sent_by_name: "Sent by %{name} from %{email}" - subject: "Contact Us message from %{email}" - contacts: - new: &new - contact_us: "Contact Us" - email: "Email" - message: "Message" - name: "Name" - subject: "Subjecter" - submit: "Submit" - new_formtastic: - <<: *new - new_simple_form: - <<: *new - notices: - error: "You must enter both fields." - success: "Contact email was successfully sent." diff --git a/config/locales/contact_us/contact_us.fr-FR.yml b/config/locales/contact_us/contact_us.fr-FR.yml new file mode 100644 index 0000000..578c331 --- /dev/null +++ b/config/locales/contact_us/contact_us.fr-FR.yml @@ -0,0 +1,25 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +fr-FR: + contact_us: + contact_mailer: + contact_email: + sent_by_contact_form: "Envoyé depuis le fomulaire de contact par %{email}" + sent_by_name: "Envoyé par %{name} depuis %{email}" + subject: "Message 'Contactez nous' de %{email}" + contacts: + new: &new + contact_us: "Contactez Nous" + email: "Email" + message: "Message" + name: "Nom" + subject: "Sujet" + submit: "Envoyer" + new_formtastic: + <<: *new + new_simple_form: + <<: *new + notices: + error: "Merci de saisir les deux champs." + success: "Votre message a bien été envoyé." diff --git a/config/locales/contact_us/contact_us.fr_FR.yml b/config/locales/contact_us/contact_us.fr_FR.yml deleted file mode 100644 index d2f5fe8..0000000 --- a/config/locales/contact_us/contact_us.fr_FR.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -fr_FR: - contact_us: - contact_mailer: - contact_email: - sent_by_contact_form: "Envoyé depuis le fomulaire de contact par %{email}" - sent_by_name: "Envoyé par %{name} depuis %{email}" - subject: "Message 'Contactez nous' de %{email}" - contacts: - new: &new - contact_us: "Contactez Nous" - email: "Email" - message: "Message" - name: "Nom" - subject: "Sujet" - submit: "Envoyer" - new_formtastic: - <<: *new - new_simple_form: - <<: *new - notices: - error: "Merci de saisir les deux champs." - success: "Votre message a bien été envoyé." diff --git a/config/locales/contact_us/contact_us.pt_BR.yml b/config/locales/contact_us/contact_us.pt_BR.yml deleted file mode 100644 index 9a50162..0000000 --- a/config/locales/contact_us/contact_us.pt_BR.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -pt_BR: - contact_us: - contact_mailer: - contact_email: - sent_by_contact_form: "Enviado pelo formulário de contato. %{email}" - sent_by_name: "Enviado por %{name} de %{email}" - subject: "Contate-nos: nova mensagem de %{email}" - contacts: - new: &new - contact_us: "Contate-nos" - email: "Email" - message: "Mensagem" - name: "Nome" - subject: "Assunto" - submit: "Enviar" - new_formtastic: - <<: *new - new_simple_form: - <<: *new - notices: - error: "Você tem de preencher ambos os campos." - success: "Email de contato foi enviado com sucesso." diff --git a/config/locales/contact_us/contact_us.zh-TW.yml b/config/locales/contact_us/contact_us.zh-TW.yml index 3dde793..9c71c09 100644 --- a/config/locales/contact_us/contact_us.zh-TW.yml +++ b/config/locales/contact_us/contact_us.zh-TW.yml @@ -1,4 +1,4 @@ -zh: +zh-TW: contact_us: contact_mailer: contact_email: diff --git a/config/locales/devise/devise.en-GB.yml b/config/locales/devise/devise.en-GB.yml new file mode 100644 index 0000000..4937af8 --- /dev/null +++ b/config/locales/devise/devise.en-GB.yml @@ -0,0 +1,60 @@ +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n + +en-GB: + devise: + confirmations: + confirmed: "Your account was successfully confirmed. Please sign in." + send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." + failure: + already_authenticated: "You are already signed in." + inactive: "Your account is no longer active. Please contact us to reactivate your account." + invalid: "Invalid email or password." + invalid_token: "Invalid authentication token." + invited: "You have a pending invitation, accept it to finish creating your account." + locked: "Your account is locked." + not_found_in_database: "Invalid email or password." + timeout: "Your session expired, please sign in again to continue." + unauthenticated: "You need to sign in or sign up before continuing." + unconfirmed: "You have to confirm your account before continuing." + mailer: + confirmation_instructions: + subject: "Confirm your DMPonline account" + reset_password_instructions: + subject: "Reset password instructions" + unlock_instructions: + subject: "Unlock Instructions" + omniauth_callbacks: + failure: "Could not authenticate you from %{kind} because \"%{reason}\"." + success: "Successfully authenticated from %{kind} account." + passwords: + no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." + send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." + updated: "Your password was changed successfully. You are now signed in." + updated_not_active: "Your password was changed successfully." + registrations: + destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." + signed_up: "Welcome! You have signed up successfully." + signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." + signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." + signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account. If you do not receive the confirmation email, please check your spam filter." + update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." + updated: "You updated your account successfully." + sessions: + signed_in: "Signed in successfully." + signed_out: "Signed out successfully." + unlocks: + send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." + send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." + unlocked: "Your account has been unlocked successfully. Please sign in to continue." + errors: + messages: + already_confirmed: "was already confirmed, please try signing in" + confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" + expired: "has expired, please request a new one" + not_found: "not found" + not_locked: "was not locked" + not_saved: + one: "1 error prohibited this %{resource} from being saved:" + other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/config/locales/devise/devise.en-US.yml b/config/locales/devise/devise.en-US.yml new file mode 100644 index 0000000..f9464a3 --- /dev/null +++ b/config/locales/devise/devise.en-US.yml @@ -0,0 +1,60 @@ +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n + +en-US: + devise: + confirmations: + confirmed: "Your account was successfully confirmed. Please sign in." + send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." + failure: + already_authenticated: "You are already signed in." + inactive: "Your account is no longer active. Please contact us to reactivate your account." + invalid: "Invalid email or password." + invalid_token: "Invalid authentication token." + invited: "You have a pending invitation, accept it to finish creating your account." + locked: "Your account is locked." + not_found_in_database: "Invalid email or password." + timeout: "Your session expired, please sign in again to continue." + unauthenticated: "You need to sign in or sign up before continuing." + unconfirmed: "You have to confirm your account before continuing." + mailer: + confirmation_instructions: + subject: "Confirm your DMPonline account" + reset_password_instructions: + subject: "Reset password instructions" + unlock_instructions: + subject: "Unlock Instructions" + omniauth_callbacks: + failure: "Could not authenticate you from %{kind} because \"%{reason}\"." + success: "Successfully authenticated from %{kind} account." + passwords: + no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." + send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." + updated: "Your password was changed successfully. You are now signed in." + updated_not_active: "Your password was changed successfully." + registrations: + destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." + signed_up: "Welcome! You have signed up successfully." + signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." + signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." + signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account. If you do not receive the confirmation email, please check your spam filter." + update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." + updated: "You updated your account successfully." + sessions: + signed_in: "Signed in successfully." + signed_out: "Signed out successfully." + unlocks: + send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." + send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." + unlocked: "Your account has been unlocked successfully. Please sign in to continue." + errors: + messages: + already_confirmed: "was already confirmed, please try signing in" + confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" + expired: "has expired, please request a new one" + not_found: "not found" + not_locked: "was not locked" + not_saved: + one: "1 error prohibited this %{resource} from being saved:" + other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/config/locales/devise/devise.en_GB.yml b/config/locales/devise/devise.en_GB.yml deleted file mode 100644 index f6e8719..0000000 --- a/config/locales/devise/devise.en_GB.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n - -en_GB: - devise: - confirmations: - confirmed: "Your account was successfully confirmed. Please sign in." - send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." - failure: - already_authenticated: "You are already signed in." - inactive: "Your account is no longer active. Please contact us to reactivate your account." - invalid: "Invalid email or password." - invalid_token: "Invalid authentication token." - invited: "You have a pending invitation, accept it to finish creating your account." - locked: "Your account is locked." - not_found_in_database: "Invalid email or password." - timeout: "Your session expired, please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your account before continuing." - mailer: - confirmation_instructions: - subject: "Confirm your DMPonline account" - reset_password_instructions: - subject: "Reset password instructions" - unlock_instructions: - subject: "Unlock Instructions" - omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." - passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password was changed successfully. You are now signed in." - updated_not_active: "Your password was changed successfully." - registrations: - destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account. If you do not receive the confirmation email, please check your spam filter." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." - updated: "You updated your account successfully." - sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - unlocks: - send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." - errors: - messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" - not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/config/locales/devise/devise.en_US.yml b/config/locales/devise/devise.en_US.yml deleted file mode 100644 index db03c5d..0000000 --- a/config/locales/devise/devise.en_US.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n - -en_US: - devise: - confirmations: - confirmed: "Your account was successfully confirmed. Please sign in." - send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." - failure: - already_authenticated: "You are already signed in." - inactive: "Your account is no longer active. Please contact us to reactivate your account." - invalid: "Invalid email or password." - invalid_token: "Invalid authentication token." - invited: "You have a pending invitation, accept it to finish creating your account." - locked: "Your account is locked." - not_found_in_database: "Invalid email or password." - timeout: "Your session expired, please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your account before continuing." - mailer: - confirmation_instructions: - subject: "Confirm your DMPonline account" - reset_password_instructions: - subject: "Reset password instructions" - unlock_instructions: - subject: "Unlock Instructions" - omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." - passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password was changed successfully. You are now signed in." - updated_not_active: "Your password was changed successfully." - registrations: - destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account. If you do not receive the confirmation email, please check your spam filter." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." - updated: "You updated your account successfully." - sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - unlocks: - send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." - errors: - messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" - not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/config/locales/devise/devise.fr-FR.yml b/config/locales/devise/devise.fr-FR.yml new file mode 100644 index 0000000..52d55e7 --- /dev/null +++ b/config/locales/devise/devise.fr-FR.yml @@ -0,0 +1,82 @@ +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n + +fr-FR: + devise: + confirmations: + confirmed: "Votre compte a bien été validé. Veuillez vous connecter." + send_instructions: "Vous recevrez dans quelques minutes un courriel contenant les directives pour activer votre compte." + resend_instructions: "Envoyer de nouveau les directives" + send_paranoid_instructions: "Si votre adresse électronique existe dans notre base de données, vous recevrez dans quelques minutes un courriel contenant les directives pour valider votre compte." + failure: + already_authenticated: "Vous êtes déjà connecté(e)." + inactive: "Votre compte n'est plus actif. Merci de nous contacter pour réactiver votre compte." + invalid: "Courriel ou mot de passe incorrect." + invalid_token: "Jeton d'authentification incorrect." + locked: "Votre compte est verrouillé." + not_found_in_database: "Courriel ou mot de passe incorrect." + timeout: "Votre session est expirée. Veuillez vous reconnecter pour continuer." + unauthenticated: "Vous devez vous connecter ou vous inscrire pour continuer." + unconfirmed: "Vous devez confirmer votre compte pour continuer." + mailer: + app_name: "Assistant PGD" + confirmation_instructions: + subject: "Valider votre compte Assistant PGD" + link: "Cliquer ici pour activer votre compte" + email: "

Bienvenue dans l'Assistant PGD, %{email}

+

Merci de vous être inscrit(e) à %{app_link}. Veuillez confirmer votre adresse électronique :

+

%{confirmation_link} (ou copier %{confirmation_direct_url} dans votre navigateur).

" + reset_password_instructions: + subject: "Directives pour réinitialiser le mot de passe" + link: "Réinitialiser mon mot de passe" + email: "

Bonjour %{resource_email}!

+

Un changement de mot de passe a été demandé pour %{app_link}. Vous pouvez le faire en cliquant sur le lien ci-dessous.

+

%{reset_password_link}

+

Si vous n'avez pas demandé ce changement, veuillez ignorer ce message.

+

Votre mot de passe ne sera pas changé tant que vous n'aurez pas accédé au lien ci-dessus pour en créer un nouveau.

" + unlock_instructions: + subject: "Directives de déverrouillage" + link: "Déverrouiller mon compte" + email: "

Bonjour %{resource_email}!

+

Votre compte %{app_link} a été verrouillé à la suite d'un trop grand nombre de tentatives d'authentification.

+

Cliquez sur le lien ci-dessous pour déverrouiller votre compte :

+

%{unlock_link}

" + omniauth_callbacks: + failure: "Nous n'avons pas pu vous authentifier à partir de %{kind} parce que '%{reason}'." + success: "Authentification réussie à partir du compte %{kind}." + passwords: + no_token: "Vous ne pouvez pas accéder à cette page sans y avoir été dirigé par un courriel de réinitialisation du mot de passe. Si vous avez été dirigé vers cette page à partir d’un courriel de réinitialisation, assurez-vous d'utiliser l'adresse URL complète fournie." + send_instructions: "Vous recevrez dans quelques minutes un courriel contenant les directives pour réinitialiser le mot de passe." + send_paranoid_instructions: "Si votre adresse électronique existe dans notre base de données, vous recevrez dans quelques minutes un lien de récupération du mot de passe par courriel." + updated: "Votre mot de passe a bien été modifié. Vous êtes maintenant connecté." + updated_not_active: "Votre mot de passe a bien été modifié." + registrations: + destroyed: "Votre compte a bien été supprimé. Nous espérons vous revoir bientôt." + signed_up: "Bienvenu(e)! Vous êtes bien inscrit(e)." + signed_up_but_inactive: "Vous êtes bien inscrit(e). Cependant, vous ne pouvez pas vous connecter, car votre compte n'est pas encore activé." + signed_up_but_locked: "Vous êtes bien inscrit(e). Cependant, vous ne pouvez pas vous connecter, car votre compte est verrouillé." + signed_up_but_unconfirmed: "Un message contenant un lien de confirmation a été envoyé à votre adresse électronique. Ouvrez ce lien pour activer votre compte. Si vous n’avez pas reçu le courriel de confirmation, vérifiez votre filtre antipourriel." + update_needs_confirmation: "Votre compte a bien été mis à jour, mais nous devons vérifier votre nouvelle adresse électronique. Vérifiez vos courriels et cliquez sur le lien de confirmation pour finaliser la validation de votre nouvelle adresse électronique." + updated: "Votre compte a bien été modifié." + sessions: + signed_in: "Connecté" + signed_out: "Déconnecté" + unlocks: + send_instructions: "Vous recevrez dans quelques minutes un courriel contenant les directives pour déverrouiller votre compte." + send_paranoid_instructions: "Si votre compte existe, vous recevrez dans quelques minutes un courriel contenant les directives pour le déverrouiller." + resend_unlock_instructions: "Envoyer de nouveau les directives de déverouillage." + unlocked: "Votre compte a bien été déverrouillé. Veuillez vous connecter pour continuer." + errors: + messages: + already_confirmed: "a déjà été validé, essayez de vous connecter." + confirmation_period_expired: "à confirmer dans les %{period}. Veuillez faire une nouvelle demande." + expired: "a expiré, veuillez faire une nouvelle demande." + not_found: "n'a pas été trouvé" + not_locked: "n'était pas verrouillé" + not_saved: + one: "Une erreur a empêché d’enregistrer ce(tte) %{resource} :" + other: "%{count} erreurs ont empêché d’enregistrer ce(tte) %{resource} :" + blank: "Ce champ ne peut être vide" + activerecord: + attributes: + user: + email: "Courriel: " diff --git a/config/locales/devise/devise.fr_FR.yml b/config/locales/devise/devise.fr_FR.yml deleted file mode 100644 index 9a6d02c..0000000 --- a/config/locales/devise/devise.fr_FR.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n - -fr_FR: - devise: - confirmations: - confirmed: "Votre compte a bien été validé. Veuillez vous connecter." - send_instructions: "Vous recevrez dans quelques minutes un courriel contenant les directives pour activer votre compte." - resend_instructions: "Envoyer de nouveau les directives" - send_paranoid_instructions: "Si votre adresse électronique existe dans notre base de données, vous recevrez dans quelques minutes un courriel contenant les directives pour valider votre compte." - failure: - already_authenticated: "Vous êtes déjà connecté(e)." - inactive: "Votre compte n'est plus actif. Merci de nous contacter pour réactiver votre compte." - invalid: "Courriel ou mot de passe incorrect." - invalid_token: "Jeton d'authentification incorrect." - locked: "Votre compte est verrouillé." - not_found_in_database: "Courriel ou mot de passe incorrect." - timeout: "Votre session est expirée. Veuillez vous reconnecter pour continuer." - unauthenticated: "Vous devez vous connecter ou vous inscrire pour continuer." - unconfirmed: "Vous devez confirmer votre compte pour continuer." - mailer: - app_name: "Assistant PGD" - confirmation_instructions: - subject: "Valider votre compte Assistant PGD" - link: "Cliquer ici pour activer votre compte" - email: "

Bienvenue dans l'Assistant PGD, %{email}

-

Merci de vous être inscrit(e) à %{app_link}. Veuillez confirmer votre adresse électronique :

-

%{confirmation_link} (ou copier %{confirmation_direct_url} dans votre navigateur).

" - reset_password_instructions: - subject: "Directives pour réinitialiser le mot de passe" - link: "Réinitialiser mon mot de passe" - email: "

Bonjour %{resource_email}!

-

Un changement de mot de passe a été demandé pour %{app_link}. Vous pouvez le faire en cliquant sur le lien ci-dessous.

-

%{reset_password_link}

-

Si vous n'avez pas demandé ce changement, veuillez ignorer ce message.

-

Votre mot de passe ne sera pas changé tant que vous n'aurez pas accédé au lien ci-dessus pour en créer un nouveau.

" - unlock_instructions: - subject: "Directives de déverrouillage" - link: "Déverrouiller mon compte" - email: "

Bonjour %{resource_email}!

-

Votre compte %{app_link} a été verrouillé à la suite d'un trop grand nombre de tentatives d'authentification.

-

Cliquez sur le lien ci-dessous pour déverrouiller votre compte :

-

%{unlock_link}

" - omniauth_callbacks: - failure: "Nous n'avons pas pu vous authentifier à partir de %{kind} parce que '%{reason}'." - success: "Authentification réussie à partir du compte %{kind}." - passwords: - no_token: "Vous ne pouvez pas accéder à cette page sans y avoir été dirigé par un courriel de réinitialisation du mot de passe. Si vous avez été dirigé vers cette page à partir d’un courriel de réinitialisation, assurez-vous d'utiliser l'adresse URL complète fournie." - send_instructions: "Vous recevrez dans quelques minutes un courriel contenant les directives pour réinitialiser le mot de passe." - send_paranoid_instructions: "Si votre adresse électronique existe dans notre base de données, vous recevrez dans quelques minutes un lien de récupération du mot de passe par courriel." - updated: "Votre mot de passe a bien été modifié. Vous êtes maintenant connecté." - updated_not_active: "Votre mot de passe a bien été modifié." - registrations: - destroyed: "Votre compte a bien été supprimé. Nous espérons vous revoir bientôt." - signed_up: "Bienvenu(e)! Vous êtes bien inscrit(e)." - signed_up_but_inactive: "Vous êtes bien inscrit(e). Cependant, vous ne pouvez pas vous connecter, car votre compte n'est pas encore activé." - signed_up_but_locked: "Vous êtes bien inscrit(e). Cependant, vous ne pouvez pas vous connecter, car votre compte est verrouillé." - signed_up_but_unconfirmed: "Un message contenant un lien de confirmation a été envoyé à votre adresse électronique. Ouvrez ce lien pour activer votre compte. Si vous n’avez pas reçu le courriel de confirmation, vérifiez votre filtre antipourriel." - update_needs_confirmation: "Votre compte a bien été mis à jour, mais nous devons vérifier votre nouvelle adresse électronique. Vérifiez vos courriels et cliquez sur le lien de confirmation pour finaliser la validation de votre nouvelle adresse électronique." - updated: "Votre compte a bien été modifié." - sessions: - signed_in: "Connecté" - signed_out: "Déconnecté" - unlocks: - send_instructions: "Vous recevrez dans quelques minutes un courriel contenant les directives pour déverrouiller votre compte." - send_paranoid_instructions: "Si votre compte existe, vous recevrez dans quelques minutes un courriel contenant les directives pour le déverrouiller." - resend_unlock_instructions: "Envoyer de nouveau les directives de déverouillage." - unlocked: "Votre compte a bien été déverrouillé. Veuillez vous connecter pour continuer." - errors: - messages: - already_confirmed: "a déjà été validé, essayez de vous connecter." - confirmation_period_expired: "à confirmer dans les %{period}. Veuillez faire une nouvelle demande." - expired: "a expiré, veuillez faire une nouvelle demande." - not_found: "n'a pas été trouvé" - not_locked: "n'était pas verrouillé" - not_saved: - one: "Une erreur a empêché d’enregistrer ce(tte) %{resource} :" - other: "%{count} erreurs ont empêché d’enregistrer ce(tte) %{resource} :" - blank: "Ce champ ne peut être vide" - activerecord: - attributes: - user: - email: "Courriel: " diff --git a/config/locales/devise/devise.pt-BR.yml b/config/locales/devise/devise.pt-BR.yml new file mode 100644 index 0000000..6c1890a --- /dev/null +++ b/config/locales/devise/devise.pt-BR.yml @@ -0,0 +1,60 @@ +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n + +pt-BR: + devise: + confirmations: + confirmed: "Sua conta foi confirmada com sucesso. Por favor, inscreva-se." + send_instructions: "Você receberá um e-mail com instruções sobre como confirmar sua conta em alguns minutos." + send_paranoid_instructions: "Se o seu endereço de e-mail existir em nosso banco de dados, você receberá um e-mail com instruções sobre como confirmar sua conta em alguns minutos." + failure: + already_authenticated: "Você já está inscrito." + inactive: "Sua conta não está mais ativa. Entre em contato para reativar sua conta." + invalid: "Email ou senha inválidos." + invalid_token: "Token de autenticação inválido." + invited: "Você tem um convite pendente, aceite-o para concluir a criação da sua conta." + locked: "Sua conta está bloqueada." + not_found_in_database: "Email ou senha inválidos." + timeout: "Sua sessão expirou, faça login novamente para continuar." + unauthenticated: "Você precisa fazer login ou se inscrever antes de continuar." + unconfirmed: "Você precisa confirmar sua conta antes de continuar." + mailer: + confirmation_instructions: + subject: "Confirme sua conta DMPRoadmap" + reset_password_instructions: + subject: "Redefinir instruções de senha" + unlock_instructions: + subject: "Desbloquear instruções" + omniauth_callbacks: + failure: "Não foi possível autenticá-lo de %{kind} porque \"%{reason}\"." + success: "Autenticado com sucesso da conta %{kind}." + passwords: + no_token: "Você não pode acessar esta página sem receber um email de redefinição de senha. Se você receber um email de redefinição de senha, verifique se usou o URL completo fornecido." + send_instructions: "Você receberá um email com instruções sobre como redefinir sua senha em alguns minutos." + send_paranoid_instructions: "Se o seu endereço de email existir em nosso banco de dados, você receberá um link de recuperação de senha em seu endereço de email em alguns minutos." + updated: "Sua senha foi alterada com sucesso. Agora você está conectado." + updated_not_active: "Sua senha foi alterada com sucesso." + registrations: + destroyed: "Tchau! Sua conta foi cancelada com sucesso. Esperamos te ver novamente em breve." + signed_up: "Bem vinda! Você se inscreveu com sucesso." + signed_up_but_inactive: "Você se inscreveu com sucesso. No entanto, não poderíamos fazer o seu login porque sua conta ainda não está ativada." + signed_up_but_locked: "Você se inscreveu com sucesso. No entanto, não poderíamos fazer login porque sua conta está bloqueada." + signed_up_but_unconfirmed: "Uma mensagem com um link de confirmação foi enviada para o seu endereço de email. Por favor, abra o link para ativar sua conta. Se você não receber o email de confirmação, verifique seu filtro de spam." + update_needs_confirmation: "Você atualizou sua conta com sucesso, mas precisamos confirmar seu novo endereço de e-mail. Por favor, verifique seu e-mail e clique no link de confirmação para finalizar a confirmação do seu novo endereço de email." + updated: "Você atualizou sua conta com sucesso." + sessions: + signed_in: "Conectado com sucesso." + signed_out: "Saiu com sucesso." + unlocks: + send_instructions: "Você receberá um email com instruções sobre como desbloquear sua conta em alguns minutos." + send_paranoid_instructions: "Se a sua conta existir, você receberá um email com instruções sobre como desbloqueá-lo em alguns minutos." + unlocked: "Sua conta foi desbloqueada com sucesso. Por favor, entre para continuar." + errors: + messages: + already_confirmed: "já foi confirmado, por favor, tente entrar" + confirmation_period_expired: "precisa ser confirmado dentro de %{período}, solicite um novo" + expired: "expirou, solicite um novo" + not_found: "não encontrado" + not_locked: "não estava trancado" + not_saved: + one: "1 erro proibiu que %{resource} fosse salvo:" + other: "%{count} erros proibiram que esse %{resource} fosse salvo:" diff --git a/config/locales/devise/devise.pt_BR.yml b/config/locales/devise/devise.pt_BR.yml deleted file mode 100644 index 653a411..0000000 --- a/config/locales/devise/devise.pt_BR.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n - -pt_BR: - devise: - confirmations: - confirmed: "Sua conta foi confirmada com sucesso. Por favor, inscreva-se." - send_instructions: "Você receberá um e-mail com instruções sobre como confirmar sua conta em alguns minutos." - send_paranoid_instructions: "Se o seu endereço de e-mail existir em nosso banco de dados, você receberá um e-mail com instruções sobre como confirmar sua conta em alguns minutos." - failure: - already_authenticated: "Você já está inscrito." - inactive: "Sua conta não está mais ativa. Entre em contato para reativar sua conta." - invalid: "Email ou senha inválidos." - invalid_token: "Token de autenticação inválido." - invited: "Você tem um convite pendente, aceite-o para concluir a criação da sua conta." - locked: "Sua conta está bloqueada." - not_found_in_database: "Email ou senha inválidos." - timeout: "Sua sessão expirou, faça login novamente para continuar." - unauthenticated: "Você precisa fazer login ou se inscrever antes de continuar." - unconfirmed: "Você precisa confirmar sua conta antes de continuar." - mailer: - confirmation_instructions: - subject: "Confirme sua conta DMPRoadmap" - reset_password_instructions: - subject: "Redefinir instruções de senha" - unlock_instructions: - subject: "Desbloquear instruções" - omniauth_callbacks: - failure: "Não foi possível autenticá-lo de %{kind} porque \"%{reason}\"." - success: "Autenticado com sucesso da conta %{kind}." - passwords: - no_token: "Você não pode acessar esta página sem receber um email de redefinição de senha. Se você receber um email de redefinição de senha, verifique se usou o URL completo fornecido." - send_instructions: "Você receberá um email com instruções sobre como redefinir sua senha em alguns minutos." - send_paranoid_instructions: "Se o seu endereço de email existir em nosso banco de dados, você receberá um link de recuperação de senha em seu endereço de email em alguns minutos." - updated: "Sua senha foi alterada com sucesso. Agora você está conectado." - updated_not_active: "Sua senha foi alterada com sucesso." - registrations: - destroyed: "Tchau! Sua conta foi cancelada com sucesso. Esperamos te ver novamente em breve." - signed_up: "Bem vinda! Você se inscreveu com sucesso." - signed_up_but_inactive: "Você se inscreveu com sucesso. No entanto, não poderíamos fazer o seu login porque sua conta ainda não está ativada." - signed_up_but_locked: "Você se inscreveu com sucesso. No entanto, não poderíamos fazer login porque sua conta está bloqueada." - signed_up_but_unconfirmed: "Uma mensagem com um link de confirmação foi enviada para o seu endereço de email. Por favor, abra o link para ativar sua conta. Se você não receber o email de confirmação, verifique seu filtro de spam." - update_needs_confirmation: "Você atualizou sua conta com sucesso, mas precisamos confirmar seu novo endereço de e-mail. Por favor, verifique seu e-mail e clique no link de confirmação para finalizar a confirmação do seu novo endereço de email." - updated: "Você atualizou sua conta com sucesso." - sessions: - signed_in: "Conectado com sucesso." - signed_out: "Saiu com sucesso." - unlocks: - send_instructions: "Você receberá um email com instruções sobre como desbloquear sua conta em alguns minutos." - send_paranoid_instructions: "Se a sua conta existir, você receberá um email com instruções sobre como desbloqueá-lo em alguns minutos." - unlocked: "Sua conta foi desbloqueada com sucesso. Por favor, entre para continuar." - errors: - messages: - already_confirmed: "já foi confirmado, por favor, tente entrar" - confirmation_period_expired: "precisa ser confirmado dentro de %{período}, solicite um novo" - expired: "expirou, solicite um novo" - not_found: "não encontrado" - not_locked: "não estava trancado" - not_saved: - one: "1 erro proibiu que %{resource} fosse salvo:" - other: "%{count} erros proibiram que esse %{resource} fosse salvo:" diff --git a/config/locales/devise/devise_invitable.en-GB.yml b/config/locales/devise/devise_invitable.en-GB.yml new file mode 100644 index 0000000..abf0919 --- /dev/null +++ b/config/locales/devise/devise_invitable.en-GB.yml @@ -0,0 +1,17 @@ +en-GB: + devise: + invitations: + send_instructions: 'An invitation email has been sent to %{email}.' + invitation_token_invalid: 'The invitation token provided is not valid!' + updated: 'Your password was set successfully. You are now signed in.' + no_invitations_remaining: "No invitations remaining" + invitation_removed: 'Your invitation was removed.' + new: + header: "Send invitation" + submit_button: "Send an invitation" + edit: + header: "Set your password" + submit_button: "Set my password" + mailer: + invitation_instructions: + subject: 'Invitation instructions' \ No newline at end of file diff --git a/config/locales/devise/devise_invitable.en-US.yml b/config/locales/devise/devise_invitable.en-US.yml new file mode 100644 index 0000000..117862f --- /dev/null +++ b/config/locales/devise/devise_invitable.en-US.yml @@ -0,0 +1,17 @@ +en-US: + devise: + invitations: + send_instructions: 'An invitation email has been sent to %{email}.' + invitation_token_invalid: 'The invitation token provided is not valid!' + updated: 'Your password was set successfully. You are now signed in.' + no_invitations_remaining: "No invitations remaining" + invitation_removed: 'Your invitation was removed.' + new: + header: "Send invitation" + submit_button: "Send an invitation" + edit: + header: "Set your password" + submit_button: "Set my password" + mailer: + invitation_instructions: + subject: 'Invitation instructions' diff --git a/config/locales/devise/devise_invitable.en_GB.yml b/config/locales/devise/devise_invitable.en_GB.yml deleted file mode 100644 index 00d9a39..0000000 --- a/config/locales/devise/devise_invitable.en_GB.yml +++ /dev/null @@ -1,17 +0,0 @@ -en_GB: - devise: - invitations: - send_instructions: 'An invitation email has been sent to %{email}.' - invitation_token_invalid: 'The invitation token provided is not valid!' - updated: 'Your password was set successfully. You are now signed in.' - no_invitations_remaining: "No invitations remaining" - invitation_removed: 'Your invitation was removed.' - new: - header: "Send invitation" - submit_button: "Send an invitation" - edit: - header: "Set your password" - submit_button: "Set my password" - mailer: - invitation_instructions: - subject: 'Invitation instructions' \ No newline at end of file diff --git a/config/locales/devise/devise_invitable.en_US.yml b/config/locales/devise/devise_invitable.en_US.yml deleted file mode 100644 index 1ee504b..0000000 --- a/config/locales/devise/devise_invitable.en_US.yml +++ /dev/null @@ -1,17 +0,0 @@ -en_US: - devise: - invitations: - send_instructions: 'An invitation email has been sent to %{email}.' - invitation_token_invalid: 'The invitation token provided is not valid!' - updated: 'Your password was set successfully. You are now signed in.' - no_invitations_remaining: "No invitations remaining" - invitation_removed: 'Your invitation was removed.' - new: - header: "Send invitation" - submit_button: "Send an invitation" - edit: - header: "Set your password" - submit_button: "Set my password" - mailer: - invitation_instructions: - subject: 'Invitation instructions' diff --git a/config/locales/devise/devise_invitable.fr-FR.yml b/config/locales/devise/devise_invitable.fr-FR.yml new file mode 100644 index 0000000..6ee860f --- /dev/null +++ b/config/locales/devise/devise_invitable.fr-FR.yml @@ -0,0 +1,23 @@ +fr-FR: + devise: + invitations: + send_instructions: "Un courriel d'invitation a été envoyé à %{email}." + invitation_token_invalid: "Le jeton d'invitation fourni n'est pas valide!" + updated: "Votre mot de passe a été défini avec succès. Vous êtes maintenant connecté(e)." + no_invitations_remaining: "Aucune invitation restante" + invitation_removed: "Votre invitation a été supprimée." + new: + header: "Envoyer une invitation" + submit_button: "Envoyer une invitation" + edit: + header: "Définir votre mot de passe" + submit_button: "Définir mon mot de passe" + mailer: + invitation_instructions: + subject: "Directives de confirmation" + link: "Cliquez ici pour accepter cette invitation" + email: "

Bonjour %{resource_email}!

+

Vous avez été invité(e) par un(e) de vos collègues à contribuer à son plan de gestion de données (PGD) dans %{app_link}

+

%{invitation_link} (ou copier %{invitation_direct_url} dans votre navigateur).

+

Si vous ne voulez pas accepter l'invitation, veuillez ignorer ce message.
+ Votre compte ne sera pas créé tant que vous n'aurez pas accédé au lien ci-dessus et choisi un mot de passe.

" diff --git a/config/locales/devise/devise_invitable.fr_FR.yml b/config/locales/devise/devise_invitable.fr_FR.yml deleted file mode 100644 index 051cba3..0000000 --- a/config/locales/devise/devise_invitable.fr_FR.yml +++ /dev/null @@ -1,23 +0,0 @@ -fr_FR: - devise: - invitations: - send_instructions: "Un courriel d'invitation a été envoyé à %{email}." - invitation_token_invalid: "Le jeton d'invitation fourni n'est pas valide!" - updated: "Votre mot de passe a été défini avec succès. Vous êtes maintenant connecté(e)." - no_invitations_remaining: "Aucune invitation restante" - invitation_removed: "Votre invitation a été supprimée." - new: - header: "Envoyer une invitation" - submit_button: "Envoyer une invitation" - edit: - header: "Définir votre mot de passe" - submit_button: "Définir mon mot de passe" - mailer: - invitation_instructions: - subject: "Directives de confirmation" - link: "Cliquez ici pour accepter cette invitation" - email: "

Bonjour %{resource_email}!

-

Vous avez été invité(e) par un(e) de vos collègues à contribuer à son plan de gestion de données (PGD) dans %{app_link}

-

%{invitation_link} (ou copier %{invitation_direct_url} dans votre navigateur).

-

Si vous ne voulez pas accepter l'invitation, veuillez ignorer ce message.
- Votre compte ne sera pas créé tant que vous n'aurez pas accédé au lien ci-dessus et choisi un mot de passe.

" diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml new file mode 100644 index 0000000..59c45ed --- /dev/null +++ b/config/locales/en-GB.yml @@ -0,0 +1,208 @@ +--- +en-GB: + activerecord: + errors: + messages: + record_invalid: 'Validation failed: %{errors}' + restrict_dependent_destroy: + has_one: "Cannot delete record because a dependent %{record} exists" + has_many: "Cannot delete record because dependent %{record} exist" + date: + abbr_day_names: + - Sun + - Mon + - Tue + - Wed + - Thu + - Fri + - Sat + abbr_month_names: + - + - Jan + - Feb + - Mar + - Apr + - May + - Jun + - Jul + - Aug + - Sep + - Oct + - Nov + - Dec + day_names: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + formats: + default: "%d-%m-%Y" + long: "%d %B, %Y" + short: "%d %b" + month_names: + - + - January + - February + - March + - April + - May + - June + - July + - August + - September + - October + - November + - December + order: + - :day + - :month + - :year + datetime: + distance_in_words: + about_x_hours: + one: about 1 hour + other: about %{count} hours + about_x_months: + one: about 1 month + other: about %{count} months + about_x_years: + one: about 1 year + other: about %{count} years + almost_x_years: + one: almost 1 year + other: almost %{count} years + half_a_minute: half a minute + less_than_x_minutes: + one: less than a minute + other: less than %{count} minutes + less_than_x_seconds: + one: less than 1 second + other: less than %{count} seconds + over_x_years: + one: over 1 year + other: over %{count} years + x_days: + one: 1 day + other: "%{count} days" + x_minutes: + one: 1 minute + other: "%{count} minutes" + x_months: + one: 1 month + other: "%{count} months" + x_years: + one: 1 year + other: "%{count} years" + x_seconds: + one: 1 second + other: "%{count} seconds" + prompts: + day: Day + hour: Hour + minute: Minute + month: Month + second: Seconds + year: Year + errors: + format: "%{attribute} %{message}" + messages: + accepted: must be accepted + blank: can't be blank + confirmation: doesn't match %{attribute} + empty: can't be empty + equal_to: must be equal to %{count} + even: must be even + exclusion: is reserved + greater_than: must be greater than %{count} + greater_than_or_equal_to: must be greater than or equal to %{count} + inclusion: is not included in the list + invalid: is invalid + less_than: must be less than %{count} + less_than_or_equal_to: must be less than or equal to %{count} + not_a_number: is not a number + not_an_integer: must be an integer + odd: must be odd + taken: has already been taken + too_long: + one: is too long (maximum is 1 character) + other: is too long (maximum is %{count} characters) + too_short: + one: is too short (minimum is 1 character) + other: is too short (minimum is %{count} characters) + wrong_length: + one: is the wrong length (should be 1 character) + other: is the wrong length (should be %{count} characters) + template: + body: 'There were problems with the following fields:' + header: + one: 1 error prohibited this %{model} from being saved + other: "%{count} errors prohibited this %{model} from being saved" + helpers: + select: + prompt: Please select + submit: + create: Create %{model} + submit: Save %{model} + update: Update %{model} + number: + currency: + format: + delimiter: "," + format: "%u%n" + precision: 2 + separator: "." + significant: false + strip_insignificant_zeros: false + unit: "£" + format: + delimiter: "," + precision: 3 + separator: "." + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: Billion + million: Million + quadrillion: Quadrillion + thousand: Thousand + trillion: Trillion + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + precision: + format: + delimiter: '' + support: + array: + last_word_connector: ", and " + two_words_connector: " and " + words_connector: ", " + time: + am: am + formats: + default: "%a, %d %b %Y %H:%M:%S %z" + long: "%d %B, %Y %H:%M" + short: "%d %b %H:%M" + pm: pm diff --git a/config/locales/en-US.yml b/config/locales/en-US.yml new file mode 100644 index 0000000..0c6cb95 --- /dev/null +++ b/config/locales/en-US.yml @@ -0,0 +1,213 @@ +--- +en-US: + activerecord: + errors: + messages: + record_invalid: "Validation failed: %{errors}" + restrict_dependent_destroy: + has_one: "Cannot delete record because a dependent %{record} exists" + has_many: "Cannot delete record because dependent %{record} exist" + date: + abbr_day_names: + - Sun + - Mon + - Tue + - Wed + - Thu + - Fri + - Sat + abbr_month_names: + - + - Jan + - Feb + - Mar + - Apr + - May + - Jun + - Jul + - Aug + - Sep + - Oct + - Nov + - Dec + day_names: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + formats: + default: "%m-%d-%Y" + long: "%B %d, %Y" + short: "%b %d" + month_names: + - + - January + - February + - March + - April + - May + - June + - July + - August + - September + - October + - November + - December + order: + - :month + - :day + - :year + datetime: + distance_in_words: + about_x_hours: + one: about 1 hour + other: about %{count} hours + about_x_months: + one: about 1 month + other: about %{count} months + about_x_years: + one: about 1 year + other: about %{count} years + almost_x_years: + one: almost 1 year + other: almost %{count} years + half_a_minute: half a minute + less_than_x_minutes: + one: less than a minute + other: less than %{count} minutes + less_than_x_seconds: + one: less than 1 second + other: less than %{count} seconds + over_x_years: + one: over 1 year + other: over %{count} years + x_days: + one: 1 day + other: "%{count} days" + x_minutes: + one: 1 minute + other: "%{count} minutes" + x_months: + one: 1 month + other: "%{count} months" + x_years: + one: 1 year + other: "%{count} years" + x_seconds: + one: 1 second + other: "%{count} seconds" + prompts: + day: Day + hour: Hour + minute: Minute + month: Month + second: Seconds + year: Year + errors: + format: "%{attribute} %{message}" + messages: + accepted: must be accepted + blank: can't be blank + present: must be blank + confirmation: doesn't match %{attribute} + empty: can't be empty + equal_to: must be equal to %{count} + even: must be even + exclusion: is reserved + greater_than: must be greater than %{count} + greater_than_or_equal_to: must be greater than or equal to %{count} + inclusion: is not included in the list + invalid: is invalid + less_than: must be less than %{count} + less_than_or_equal_to: must be less than or equal to %{count} + model_invalid: "Validation failed: %{errors}" + not_a_number: is not a number + not_an_integer: must be an integer + odd: must be odd + required: must exist + taken: has already been taken + too_long: + one: is too long (maximum is 1 character) + other: is too long (maximum is %{count} characters) + too_short: + one: is too short (minimum is 1 character) + other: is too short (minimum is %{count} characters) + wrong_length: + one: is the wrong length (should be 1 character) + other: is the wrong length (should be %{count} characters) + other_than: must be other than %{count} + template: + body: 'There were problems with the following fields:' + header: + one: 1 error prohibited this %{model} from being saved + other: "%{count} errors prohibited this %{model} from being saved" + helpers: + select: + prompt: Please select + submit: + create: Create %{model} + submit: Save %{model} + update: Update %{model} + number: + currency: + format: + delimiter: "," + format: "%u%n" + precision: 2 + separator: "." + significant: false + strip_insignificant_zeros: false + unit: "$" + format: + delimiter: "," + precision: 3 + separator: "." + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: Billion + million: Million + quadrillion: Quadrillion + thousand: Thousand + trillion: Trillion + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + format: "%n%" + precision: + format: + delimiter: '' + support: + array: + last_word_connector: ", and " + two_words_connector: " and " + words_connector: ", " + time: + am: am + formats: + default: "%a, %d %b %Y %I:%M:%S %p %Z" + long: "%B %d, %Y %I:%M %p" + short: "%d %b %I:%M %p" + pm: pm diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml deleted file mode 100644 index 3444d68..0000000 --- a/config/locales/en_GB.yml +++ /dev/null @@ -1,208 +0,0 @@ ---- -en_GB: - activerecord: - errors: - messages: - record_invalid: 'Validation failed: %{errors}' - restrict_dependent_destroy: - has_one: "Cannot delete record because a dependent %{record} exists" - has_many: "Cannot delete record because dependent %{record} exist" - date: - abbr_day_names: - - Sun - - Mon - - Tue - - Wed - - Thu - - Fri - - Sat - abbr_month_names: - - - - Jan - - Feb - - Mar - - Apr - - May - - Jun - - Jul - - Aug - - Sep - - Oct - - Nov - - Dec - day_names: - - Sunday - - Monday - - Tuesday - - Wednesday - - Thursday - - Friday - - Saturday - formats: - default: "%d-%m-%Y" - long: "%d %B, %Y" - short: "%d %b" - month_names: - - - - January - - February - - March - - April - - May - - June - - July - - August - - September - - October - - November - - December - order: - - :day - - :month - - :year - datetime: - distance_in_words: - about_x_hours: - one: about 1 hour - other: about %{count} hours - about_x_months: - one: about 1 month - other: about %{count} months - about_x_years: - one: about 1 year - other: about %{count} years - almost_x_years: - one: almost 1 year - other: almost %{count} years - half_a_minute: half a minute - less_than_x_minutes: - one: less than a minute - other: less than %{count} minutes - less_than_x_seconds: - one: less than 1 second - other: less than %{count} seconds - over_x_years: - one: over 1 year - other: over %{count} years - x_days: - one: 1 day - other: "%{count} days" - x_minutes: - one: 1 minute - other: "%{count} minutes" - x_months: - one: 1 month - other: "%{count} months" - x_years: - one: 1 year - other: "%{count} years" - x_seconds: - one: 1 second - other: "%{count} seconds" - prompts: - day: Day - hour: Hour - minute: Minute - month: Month - second: Seconds - year: Year - errors: - format: "%{attribute} %{message}" - messages: - accepted: must be accepted - blank: can't be blank - confirmation: doesn't match %{attribute} - empty: can't be empty - equal_to: must be equal to %{count} - even: must be even - exclusion: is reserved - greater_than: must be greater than %{count} - greater_than_or_equal_to: must be greater than or equal to %{count} - inclusion: is not included in the list - invalid: is invalid - less_than: must be less than %{count} - less_than_or_equal_to: must be less than or equal to %{count} - not_a_number: is not a number - not_an_integer: must be an integer - odd: must be odd - taken: has already been taken - too_long: - one: is too long (maximum is 1 character) - other: is too long (maximum is %{count} characters) - too_short: - one: is too short (minimum is 1 character) - other: is too short (minimum is %{count} characters) - wrong_length: - one: is the wrong length (should be 1 character) - other: is the wrong length (should be %{count} characters) - template: - body: 'There were problems with the following fields:' - header: - one: 1 error prohibited this %{model} from being saved - other: "%{count} errors prohibited this %{model} from being saved" - helpers: - select: - prompt: Please select - submit: - create: Create %{model} - submit: Save %{model} - update: Update %{model} - number: - currency: - format: - delimiter: "," - format: "%u%n" - precision: 2 - separator: "." - significant: false - strip_insignificant_zeros: false - unit: "£" - format: - delimiter: "," - precision: 3 - separator: "." - significant: false - strip_insignificant_zeros: false - human: - decimal_units: - format: "%n %u" - units: - billion: Billion - million: Million - quadrillion: Quadrillion - thousand: Thousand - trillion: Trillion - unit: '' - format: - delimiter: '' - precision: 3 - significant: true - strip_insignificant_zeros: true - storage_units: - format: "%n %u" - units: - byte: - one: Byte - other: Bytes - gb: GB - kb: KB - mb: MB - tb: TB - percentage: - format: - delimiter: '' - precision: - format: - delimiter: '' - support: - array: - last_word_connector: ", and " - two_words_connector: " and " - words_connector: ", " - time: - am: am - formats: - default: "%a, %d %b %Y %H:%M:%S %z" - long: "%d %B, %Y %H:%M" - short: "%d %b %H:%M" - pm: pm diff --git a/config/locales/en_US.yml b/config/locales/en_US.yml deleted file mode 100644 index 2444545..0000000 --- a/config/locales/en_US.yml +++ /dev/null @@ -1,213 +0,0 @@ ---- -en_US: - activerecord: - errors: - messages: - record_invalid: "Validation failed: %{errors}" - restrict_dependent_destroy: - has_one: "Cannot delete record because a dependent %{record} exists" - has_many: "Cannot delete record because dependent %{record} exist" - date: - abbr_day_names: - - Sun - - Mon - - Tue - - Wed - - Thu - - Fri - - Sat - abbr_month_names: - - - - Jan - - Feb - - Mar - - Apr - - May - - Jun - - Jul - - Aug - - Sep - - Oct - - Nov - - Dec - day_names: - - Sunday - - Monday - - Tuesday - - Wednesday - - Thursday - - Friday - - Saturday - formats: - default: "%m-%d-%Y" - long: "%B %d, %Y" - short: "%b %d" - month_names: - - - - January - - February - - March - - April - - May - - June - - July - - August - - September - - October - - November - - December - order: - - :month - - :day - - :year - datetime: - distance_in_words: - about_x_hours: - one: about 1 hour - other: about %{count} hours - about_x_months: - one: about 1 month - other: about %{count} months - about_x_years: - one: about 1 year - other: about %{count} years - almost_x_years: - one: almost 1 year - other: almost %{count} years - half_a_minute: half a minute - less_than_x_minutes: - one: less than a minute - other: less than %{count} minutes - less_than_x_seconds: - one: less than 1 second - other: less than %{count} seconds - over_x_years: - one: over 1 year - other: over %{count} years - x_days: - one: 1 day - other: "%{count} days" - x_minutes: - one: 1 minute - other: "%{count} minutes" - x_months: - one: 1 month - other: "%{count} months" - x_years: - one: 1 year - other: "%{count} years" - x_seconds: - one: 1 second - other: "%{count} seconds" - prompts: - day: Day - hour: Hour - minute: Minute - month: Month - second: Seconds - year: Year - errors: - format: "%{attribute} %{message}" - messages: - accepted: must be accepted - blank: can't be blank - present: must be blank - confirmation: doesn't match %{attribute} - empty: can't be empty - equal_to: must be equal to %{count} - even: must be even - exclusion: is reserved - greater_than: must be greater than %{count} - greater_than_or_equal_to: must be greater than or equal to %{count} - inclusion: is not included in the list - invalid: is invalid - less_than: must be less than %{count} - less_than_or_equal_to: must be less than or equal to %{count} - model_invalid: "Validation failed: %{errors}" - not_a_number: is not a number - not_an_integer: must be an integer - odd: must be odd - required: must exist - taken: has already been taken - too_long: - one: is too long (maximum is 1 character) - other: is too long (maximum is %{count} characters) - too_short: - one: is too short (minimum is 1 character) - other: is too short (minimum is %{count} characters) - wrong_length: - one: is the wrong length (should be 1 character) - other: is the wrong length (should be %{count} characters) - other_than: must be other than %{count} - template: - body: 'There were problems with the following fields:' - header: - one: 1 error prohibited this %{model} from being saved - other: "%{count} errors prohibited this %{model} from being saved" - helpers: - select: - prompt: Please select - submit: - create: Create %{model} - submit: Save %{model} - update: Update %{model} - number: - currency: - format: - delimiter: "," - format: "%u%n" - precision: 2 - separator: "." - significant: false - strip_insignificant_zeros: false - unit: "$" - format: - delimiter: "," - precision: 3 - separator: "." - significant: false - strip_insignificant_zeros: false - human: - decimal_units: - format: "%n %u" - units: - billion: Billion - million: Million - quadrillion: Quadrillion - thousand: Thousand - trillion: Trillion - unit: '' - format: - delimiter: '' - precision: 3 - significant: true - strip_insignificant_zeros: true - storage_units: - format: "%n %u" - units: - byte: - one: Byte - other: Bytes - gb: GB - kb: KB - mb: MB - tb: TB - percentage: - format: - delimiter: '' - format: "%n%" - precision: - format: - delimiter: '' - support: - array: - last_word_connector: ", and " - two_words_connector: " and " - words_connector: ", " - time: - am: am - formats: - default: "%a, %d %b %Y %I:%M:%S %p %Z" - long: "%B %d, %Y %I:%M %p" - short: "%d %b %I:%M %p" - pm: pm diff --git a/config/locales/faker/faker.en-GB.yml b/config/locales/faker/faker.en-GB.yml new file mode 100644 index 0000000..70a2f7f --- /dev/null +++ b/config/locales/faker/faker.en-GB.yml @@ -0,0 +1,413 @@ +--- +en-GB: + faker: + language: + names: + - Afar + - Abkhazian + - Afrikaans + - Akan + - Albanian + - Amharic + - Arabic + - Aragonese + - Armenian + - Assamese + - Avaric + - Avestan + - Aymara + - Azerbaijani + - Bashkir + - Bambara + - Basque + - Belarusian + - Bengali + - Bihari languages + - Bislama + - Tibetan + - Bosnian + - Breton + - Bulgarian + - Burmese + - Catalan; Valencian + - Czech + - Chamorro + - Chechen + - Chinese + - Church Slavic + - Chuvash + - Cornish + - Corsican + - Cree + - Welsh + - Czech + - Danish + - German + - Divehi + - Dutch + - Dzongkha + - Greek + - English + - Esperanto + - Estonian + - Basque + - Ewe + - Faroese + - Persian + - Fijian + - Finnish + - French + - French + - Western Frisian + - Fulah + - Georgian + - German + - Gaelic + - Irish + - Galician + - Manx + - Guarani + - Gujarati + - Haitian + - Hausa + - Hebrew + - Herero + - Hindi + - Hiri Motu + - Croatian + - Hungarian + - Armenian + - Igbo + - Icelandic + - Ido + - Sichuan Yi + - Inuktitut + - Interlingue + - Interlingua + - Indonesian + - Inupiaq + - Icelandic + - Italian + - Javanese + - Japanese + - Kalaallisut + - Kannada + - Kashmiri + - Georgian + - Kanuri + - Kazakh + - Central Khmer + - Kikuyu + - Kinyarwanda + - Kirghiz + - Komi + - Kongo + - Korean + - Kuanyama + - Kurdish + - Lao + - Latin + - Latvian + - Limburgan + - Lingala + - Lithuanian + - Luxembourgish + - Luba-Katanga + - Ganda + - Macedonian + - Marshallese + - Malayalam + - Maori + - Marathi + - Malay + - Macedonian + - Malagasy + - Maltese + - Mongolian + - Maori + - Malay + - Burmese + - Nauru + - Navajo + - Ndebele + - Ndebele + - Ndonga + - Nepali + - Dutch + - Norwegian Nynorsk + - Bokmål + - Norwegian + - Chichewa + - Occitan + - Ojibwa + - Oriya + - Oromo + - Ossetian + - Panjabi + - Persian + - Pali + - Polish + - Portuguese + - Pushto + - Quechua + - Romansh + - Romanian + - Romanian + - Rundi + - Russian + - Sango + - Sanskrit + - Sinhala + - Slovak + - Slovak + - Slovenian + - Northern Sami + - Samoan + - Shona + - Sindhi + - Somali + - Sotho + - Spanish + - Albanian + - Sardinian + - Serbian + - Swati + - Sundanese + - Swahili + - Swedish + - Tahitian + - Tamil + - Tatar + - Telugu + - Tajik + - Tagalog + - Thai + - Tibetan + - Tigrinya + - Tonga + - Tswana + - Tsonga + - Turkmen + - Turkish + - Twi + - Uighur + - Ukrainian + - Urdu + - Uzbek + - Venda + - Vietnamese + - Volapük + - Welsh + - Walloon + - Wolof + - Xhosa + - Yiddish + - Yoruba + - Zhuang + - Chinese + - Zulu + abbreviations: + - aa + - ab + - af + - ak + - sq + - am + - ar + - an + - hy + - as + - av + - ae + - ay + - az + - ba + - bm + - eu + - be + - bn + - bh + - bi + - bo + - bs + - br + - bg + - my + - ca + - cs + - ch + - ce + - zh + - cu + - cv + - kw + - co + - cr + - cy + - cs + - da + - de + - dv + - nl + - dz + - el + - en + - eo + - et + - eu + - ee + - fo + - fa + - fj + - fi + - fr + - fr + - fy + - ff + - ka + - de + - gd + - ga + - gl + - gv + - el + - gn + - gu + - ht + - ha + - he + - hz + - hi + - ho + - hr + - hu + - hy + - ig + - is + - io + - ii + - iu + - ie + - ia + - id + - ik + - is + - it + - jv + - ja + - kl + - kn + - ks + - ka + - kr + - kk + - km + - ki + - rw + - ky + - kv + - kg + - ko + - kj + - ku + - lo + - la + - lv + - li + - ln + - lt + - lb + - lu + - lg + - mk + - mh + - ml + - mi + - mr + - ms + - mk + - mg + - mt + - mn + - mi + - ms + - my + - na + - nv + - nr + - nd + - ng + - ne + - nl + - nn + - nb + - 'no' + - ny + - oc + - oj + - or + - om + - os + - pa + - fa + - pi + - pl + - pt + - ps + - qu + - rm + - ro + - ro + - rn + - ru + - sg + - sa + - si + - sk + - sk + - sl + - se + - sm + - sn + - sd + - so + - st + - es + - sq + - sc + - sr + - ss + - su + - sw + - sv + - ty + - ta + - tt + - te + - tg + - tl + - th + - bo + - ti + - to + - tn + - ts + - tk + - tr + - tw + - ug + - uk + - ur + - uz + - ve + - vi + - vo + - cy + - wa + - wo + - xh + - yi + - yo + - za + - zh + - zu diff --git a/config/locales/faker/faker.en_GB.yml b/config/locales/faker/faker.en_GB.yml deleted file mode 100644 index df87247..0000000 --- a/config/locales/faker/faker.en_GB.yml +++ /dev/null @@ -1,413 +0,0 @@ ---- -en_GB: - faker: - language: - names: - - Afar - - Abkhazian - - Afrikaans - - Akan - - Albanian - - Amharic - - Arabic - - Aragonese - - Armenian - - Assamese - - Avaric - - Avestan - - Aymara - - Azerbaijani - - Bashkir - - Bambara - - Basque - - Belarusian - - Bengali - - Bihari languages - - Bislama - - Tibetan - - Bosnian - - Breton - - Bulgarian - - Burmese - - Catalan; Valencian - - Czech - - Chamorro - - Chechen - - Chinese - - Church Slavic - - Chuvash - - Cornish - - Corsican - - Cree - - Welsh - - Czech - - Danish - - German - - Divehi - - Dutch - - Dzongkha - - Greek - - English - - Esperanto - - Estonian - - Basque - - Ewe - - Faroese - - Persian - - Fijian - - Finnish - - French - - French - - Western Frisian - - Fulah - - Georgian - - German - - Gaelic - - Irish - - Galician - - Manx - - Guarani - - Gujarati - - Haitian - - Hausa - - Hebrew - - Herero - - Hindi - - Hiri Motu - - Croatian - - Hungarian - - Armenian - - Igbo - - Icelandic - - Ido - - Sichuan Yi - - Inuktitut - - Interlingue - - Interlingua - - Indonesian - - Inupiaq - - Icelandic - - Italian - - Javanese - - Japanese - - Kalaallisut - - Kannada - - Kashmiri - - Georgian - - Kanuri - - Kazakh - - Central Khmer - - Kikuyu - - Kinyarwanda - - Kirghiz - - Komi - - Kongo - - Korean - - Kuanyama - - Kurdish - - Lao - - Latin - - Latvian - - Limburgan - - Lingala - - Lithuanian - - Luxembourgish - - Luba-Katanga - - Ganda - - Macedonian - - Marshallese - - Malayalam - - Maori - - Marathi - - Malay - - Macedonian - - Malagasy - - Maltese - - Mongolian - - Maori - - Malay - - Burmese - - Nauru - - Navajo - - Ndebele - - Ndebele - - Ndonga - - Nepali - - Dutch - - Norwegian Nynorsk - - Bokmål - - Norwegian - - Chichewa - - Occitan - - Ojibwa - - Oriya - - Oromo - - Ossetian - - Panjabi - - Persian - - Pali - - Polish - - Portuguese - - Pushto - - Quechua - - Romansh - - Romanian - - Romanian - - Rundi - - Russian - - Sango - - Sanskrit - - Sinhala - - Slovak - - Slovak - - Slovenian - - Northern Sami - - Samoan - - Shona - - Sindhi - - Somali - - Sotho - - Spanish - - Albanian - - Sardinian - - Serbian - - Swati - - Sundanese - - Swahili - - Swedish - - Tahitian - - Tamil - - Tatar - - Telugu - - Tajik - - Tagalog - - Thai - - Tibetan - - Tigrinya - - Tonga - - Tswana - - Tsonga - - Turkmen - - Turkish - - Twi - - Uighur - - Ukrainian - - Urdu - - Uzbek - - Venda - - Vietnamese - - Volapük - - Welsh - - Walloon - - Wolof - - Xhosa - - Yiddish - - Yoruba - - Zhuang - - Chinese - - Zulu - abbreviations: - - aa - - ab - - af - - ak - - sq - - am - - ar - - an - - hy - - as - - av - - ae - - ay - - az - - ba - - bm - - eu - - be - - bn - - bh - - bi - - bo - - bs - - br - - bg - - my - - ca - - cs - - ch - - ce - - zh - - cu - - cv - - kw - - co - - cr - - cy - - cs - - da - - de - - dv - - nl - - dz - - el - - en - - eo - - et - - eu - - ee - - fo - - fa - - fj - - fi - - fr - - fr - - fy - - ff - - ka - - de - - gd - - ga - - gl - - gv - - el - - gn - - gu - - ht - - ha - - he - - hz - - hi - - ho - - hr - - hu - - hy - - ig - - is - - io - - ii - - iu - - ie - - ia - - id - - ik - - is - - it - - jv - - ja - - kl - - kn - - ks - - ka - - kr - - kk - - km - - ki - - rw - - ky - - kv - - kg - - ko - - kj - - ku - - lo - - la - - lv - - li - - ln - - lt - - lb - - lu - - lg - - mk - - mh - - ml - - mi - - mr - - ms - - mk - - mg - - mt - - mn - - mi - - ms - - my - - na - - nv - - nr - - nd - - ng - - ne - - nl - - nn - - nb - - 'no' - - ny - - oc - - oj - - or - - om - - os - - pa - - fa - - pi - - pl - - pt - - ps - - qu - - rm - - ro - - ro - - rn - - ru - - sg - - sa - - si - - sk - - sk - - sl - - se - - sm - - sn - - sd - - so - - st - - es - - sq - - sc - - sr - - ss - - su - - sw - - sv - - ty - - ta - - tt - - te - - tg - - tl - - th - - bo - - ti - - to - - tn - - ts - - tk - - tr - - tw - - ug - - uk - - ur - - uz - - ve - - vi - - vo - - cy - - wa - - wo - - xh - - yi - - yo - - za - - zh - - zu diff --git a/config/locales/fr-CA.yml b/config/locales/fr-CA.yml new file mode 100644 index 0000000..2803290 --- /dev/null +++ b/config/locales/fr-CA.yml @@ -0,0 +1,212 @@ +--- +fr-CA: + activerecord: + errors: + messages: + record_invalid: 'La validation a échoué : %{errors}' + restrict_dependent_destroy: + has_one: "Vous ne pouvez pas supprimer l'enregistrement car une personne à charge %{record} existe" + has_many: "Vous ne pouvez pas supprimer l'enregistrement parce que les %{record} dépendants existent" + date: + abbr_day_names: + - dim + - lun + - mar + - mer + - jeu + - ven + - sam + abbr_month_names: + - + - jan. + - fév. + - mar. + - avr. + - mai + - juin + - juil. + - août + - sept. + - oct. + - nov. + - déc. + day_names: + - dimanche + - lundi + - mardi + - mercredi + - jeudi + - vendredi + - samedi + formats: + default: "%Y-%m-%d" + long: "%d %B %Y" + short: "%y-%m-%d" + month_names: + - + - janvier + - février + - mars + - avril + - mai + - juin + - juillet + - août + - septembre + - octobre + - novembre + - décembre + order: + - :year + - :month + - :day + datetime: + distance_in_words: + about_x_hours: + one: environ une heure + other: environ %{count} heures + about_x_months: + one: environ un mois + other: environ %{count} mois + about_x_years: + one: environ un an + other: environ %{count} ans + almost_x_years: + one: presqu'un an + other: presque %{count} ans + half_a_minute: une demi-minute + less_than_x_minutes: + one: moins d'une minute + other: moins de %{count} minutes + zero: moins d'une minute + less_than_x_seconds: + one: moins d'une seconde + other: moins de %{count} secondes + zero: moins d'une seconde + over_x_years: + one: plus d'un an + other: plus de %{count} ans + x_days: + one: 1 jour + other: "%{count} jours" + x_minutes: + one: 1 minute + other: "%{count} minutes" + x_months: + one: 1 mois + other: "%{count} mois" + x_seconds: + one: 1 seconde + other: "%{count} secondes" + prompts: + day: Jour + hour: Heure + minute: Minute + month: Mois + second: Seconde + year: Année + errors: + format: "%{attribute} %{message}" + messages: + accepted: doit être accepté(e) + blank: doit être rempli(e) + present: doit être vide + confirmation: ne concorde pas avec %{attribute} + empty: doit être rempli(e) + equal_to: doit être égal à %{count} + even: doit être pair + exclusion: n'est pas disponible + greater_than: doit être supérieur à %{count} + greater_than_or_equal_to: doit être supérieur ou égal à %{count} + inclusion: n'est pas inclus(e) dans la liste + invalid: n'est pas valide + less_than: doit être inférieur à %{count} + less_than_or_equal_to: doit être inférieur ou égal à %{count} + model_invalid: "Validation échouée: %{errors}" + not_a_number: n'est pas un nombre + not_an_integer: doit être un nombre entier + odd: doit être impair + required: doit exister + taken: n'est pas disponible + too_long: + one: est trop long (pas plus d'un caractère) + other: est trop long (pas plus de %{count} caractères) + too_short: + one: est trop court (au moins un caractère) + other: est trop court (au moins %{count} caractères) + wrong_length: + one: ne fait pas la bonne longueur (doit comporter un seul caractère) + other: ne fait pas la bonne longueur (doit comporter %{count} caractères) + other_than: doit être différent de %{count} + template: + body: 'Veuillez vérifier les champs suivants : ' + header: + one: 'Impossible d''enregistrer ce %{model} : 1 erreur' + other: 'Impossible d''enregistrer ce %{model} : %{count} erreurs' + helpers: + select: + prompt: Veuillez sélectionner + submit: + create: Créer un %{model} + submit: Enregistrer ce %{model} + update: Modifier ce %{model} + number: + currency: + format: + delimiter: " " + format: "%n %u" + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + unit: "$" + format: + delimiter: " " + precision: 3 + separator: "," + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: Milliard + million: Million + quadrillion: Million de milliards + thousand: Millier + trillion: Mille milliard + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: Octet + other: Octets + gb: Go + kb: ko + mb: Mo + tb: To + percentage: + format: + delimiter: '' + format: "%n%" + precision: + format: + delimiter: '' + support: + array: + last_word_connector: " et " + two_words_connector: " et " + words_connector: ", " + time: + am: am + formats: + default: "%H h %M min %S s" + long: "%A %d %B %Y %H h %M" + short: "%H h %M" + pm: pm diff --git a/config/locales/fr-FR.yml b/config/locales/fr-FR.yml new file mode 100644 index 0000000..fded992 --- /dev/null +++ b/config/locales/fr-FR.yml @@ -0,0 +1,214 @@ +--- +fr-FR: + activerecord: + errors: + messages: + record_invalid: 'La validation a échoué : %{errors}' + restrict_dependent_destroy: + has_one: "Vous ne pouvez pas supprimer l'enregistrement car un(e) %{record} dépendant(e) existe" + has_many: "Vous ne pouvez pas supprimer l'enregistrement parce que les %{record} dépendants existent" + date: + abbr_day_names: + - dim + - lun + - mar + - mer + - jeu + - ven + - sam + abbr_month_names: + - + - jan. + - fév. + - mar. + - avr. + - mai + - juin + - juil. + - août + - sept. + - oct. + - nov. + - déc. + day_names: + - dimanche + - lundi + - mardi + - mercredi + - jeudi + - vendredi + - samedi + formats: + default: "%d/%m/%Y" + short: "%e %b" + long: "%e %B %Y" + month_names: + - + - janvier + - février + - mars + - avril + - mai + - juin + - juillet + - août + - septembre + - octobre + - novembre + - décembre + order: + - :day + - :month + - :year + datetime: + distance_in_words: + about_x_hours: + one: environ une heure + other: environ %{count} heures + about_x_months: + one: environ un mois + other: environ %{count} mois + about_x_years: + one: environ un an + other: environ %{count} ans + almost_x_years: + one: presqu'un an + other: presque %{count} ans + half_a_minute: une demi-minute + less_than_x_minutes: + zero: moins d'une minute + one: moins d'une minute + other: moins de %{count} minutes + less_than_x_seconds: + zero: moins d'une seconde + one: moins d'une seconde + other: moins de %{count} secondes + over_x_years: + one: plus d'un an + other: plus de %{count} ans + x_days: + one: 1 jour + other: "%{count} jours" + x_minutes: + one: 1 minute + other: "%{count} minutes" + x_months: + one: 1 mois + other: "%{count} mois" + x_seconds: + one: 1 seconde + other: "%{count} secondes" + prompts: + day: Jour + hour: Heure + minute: Minute + month: Mois + second: Seconde + year: Année + errors: + format: "%{attribute} %{message}" + messages: + accepted: doit être accepté(e) + blank: doit être rempli(e) + present: doit être vide + confirmation: ne concorde pas avec %{attribute} + empty: doit être rempli(e) + equal_to: doit être égal à %{count} + even: doit être pair + exclusion: n'est pas disponible + greater_than: doit être supérieur à %{count} + greater_than_or_equal_to: doit être supérieur ou égal à %{count} + inclusion: n'est pas inclus(e) dans la liste + invalid: n'est pas valide + less_than: doit être inférieur à %{count} + less_than_or_equal_to: doit être inférieur ou égal à %{count} + model_invalid: "Validation échouée : %{errors}" + not_a_number: n'est pas un nombre + not_an_integer: doit être un nombre entier + odd: doit être impair + required: doit exister + taken: n'est pas disponible + too_long: + one: est trop long (pas plus d'un caractère) + other: est trop long (pas plus de %{count} caractères) + too_short: + one: est trop court (au moins un caractère) + other: est trop court (au moins %{count} caractères) + wrong_length: + one: ne fait pas la bonne longueur (doit comporter un seul caractère) + other: ne fait pas la bonne longueur (doit comporter %{count} caractères) + other_than: doit être différent de %{count} + template: + body: 'Veuillez vérifier les champs suivants : ' + header: + one: 'Impossible d''enregistrer ce(tte) %{model} : 1 erreur' + other: 'Impossible d''enregistrer ce(tte) %{model} : %{count} erreurs' + helpers: + select: + prompt: Veuillez sélectionner + submit: + create: Créer un(e) %{model} + submit: Enregistrer ce(tte) %{model} + update: Modifier ce(tte) %{model} + number: + currency: + format: + delimiter: " " + format: "%n %u" + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + unit: "€" + format: + delimiter: " " + precision: 3 + separator: "," + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: milliard + million: + one: million + other: millions + quadrillion: million de milliards + thousand: millier + trillion: billion + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: octet + other: octets + gb: Go + kb: ko + mb: Mo + tb: To + percentage: + format: + delimiter: '' + format: "%n%" + precision: + format: + delimiter: '' + support: + array: + last_word_connector: " et " + two_words_connector: " et " + words_connector: ", " + time: + am: am + formats: + default: "%d %B %Y %Hh %Mmin %Ss" + long: "%A %d %B %Y %Hh%M" + short: "%d %b %Hh%M" + pm: pm diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 8b52fb5..4bf52e1 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1,5 +1,5 @@ --- -fr_FR: +fr: activerecord: errors: messages: diff --git a/config/locales/fr_CA.yml b/config/locales/fr_CA.yml deleted file mode 100644 index af94db7..0000000 --- a/config/locales/fr_CA.yml +++ /dev/null @@ -1,212 +0,0 @@ ---- -fr_CA: - activerecord: - errors: - messages: - record_invalid: 'La validation a échoué : %{errors}' - restrict_dependent_destroy: - has_one: "Vous ne pouvez pas supprimer l'enregistrement car une personne à charge %{record} existe" - has_many: "Vous ne pouvez pas supprimer l'enregistrement parce que les %{record} dépendants existent" - date: - abbr_day_names: - - dim - - lun - - mar - - mer - - jeu - - ven - - sam - abbr_month_names: - - - - jan. - - fév. - - mar. - - avr. - - mai - - juin - - juil. - - août - - sept. - - oct. - - nov. - - déc. - day_names: - - dimanche - - lundi - - mardi - - mercredi - - jeudi - - vendredi - - samedi - formats: - default: "%Y-%m-%d" - long: "%d %B %Y" - short: "%y-%m-%d" - month_names: - - - - janvier - - février - - mars - - avril - - mai - - juin - - juillet - - août - - septembre - - octobre - - novembre - - décembre - order: - - :year - - :month - - :day - datetime: - distance_in_words: - about_x_hours: - one: environ une heure - other: environ %{count} heures - about_x_months: - one: environ un mois - other: environ %{count} mois - about_x_years: - one: environ un an - other: environ %{count} ans - almost_x_years: - one: presqu'un an - other: presque %{count} ans - half_a_minute: une demi-minute - less_than_x_minutes: - one: moins d'une minute - other: moins de %{count} minutes - zero: moins d'une minute - less_than_x_seconds: - one: moins d'une seconde - other: moins de %{count} secondes - zero: moins d'une seconde - over_x_years: - one: plus d'un an - other: plus de %{count} ans - x_days: - one: 1 jour - other: "%{count} jours" - x_minutes: - one: 1 minute - other: "%{count} minutes" - x_months: - one: 1 mois - other: "%{count} mois" - x_seconds: - one: 1 seconde - other: "%{count} secondes" - prompts: - day: Jour - hour: Heure - minute: Minute - month: Mois - second: Seconde - year: Année - errors: - format: "%{attribute} %{message}" - messages: - accepted: doit être accepté(e) - blank: doit être rempli(e) - present: doit être vide - confirmation: ne concorde pas avec %{attribute} - empty: doit être rempli(e) - equal_to: doit être égal à %{count} - even: doit être pair - exclusion: n'est pas disponible - greater_than: doit être supérieur à %{count} - greater_than_or_equal_to: doit être supérieur ou égal à %{count} - inclusion: n'est pas inclus(e) dans la liste - invalid: n'est pas valide - less_than: doit être inférieur à %{count} - less_than_or_equal_to: doit être inférieur ou égal à %{count} - model_invalid: "Validation échouée: %{errors}" - not_a_number: n'est pas un nombre - not_an_integer: doit être un nombre entier - odd: doit être impair - required: doit exister - taken: n'est pas disponible - too_long: - one: est trop long (pas plus d'un caractère) - other: est trop long (pas plus de %{count} caractères) - too_short: - one: est trop court (au moins un caractère) - other: est trop court (au moins %{count} caractères) - wrong_length: - one: ne fait pas la bonne longueur (doit comporter un seul caractère) - other: ne fait pas la bonne longueur (doit comporter %{count} caractères) - other_than: doit être différent de %{count} - template: - body: 'Veuillez vérifier les champs suivants : ' - header: - one: 'Impossible d''enregistrer ce %{model} : 1 erreur' - other: 'Impossible d''enregistrer ce %{model} : %{count} erreurs' - helpers: - select: - prompt: Veuillez sélectionner - submit: - create: Créer un %{model} - submit: Enregistrer ce %{model} - update: Modifier ce %{model} - number: - currency: - format: - delimiter: " " - format: "%n %u" - precision: 2 - separator: "," - significant: false - strip_insignificant_zeros: false - unit: "$" - format: - delimiter: " " - precision: 3 - separator: "," - significant: false - strip_insignificant_zeros: false - human: - decimal_units: - format: "%n %u" - units: - billion: Milliard - million: Million - quadrillion: Million de milliards - thousand: Millier - trillion: Mille milliard - unit: '' - format: - delimiter: '' - precision: 3 - significant: true - strip_insignificant_zeros: true - storage_units: - format: "%n %u" - units: - byte: - one: Octet - other: Octets - gb: Go - kb: ko - mb: Mo - tb: To - percentage: - format: - delimiter: '' - format: "%n%" - precision: - format: - delimiter: '' - support: - array: - last_word_connector: " et " - two_words_connector: " et " - words_connector: ", " - time: - am: am - formats: - default: "%H h %M min %S s" - long: "%A %d %B %Y %H h %M" - short: "%H h %M" - pm: pm diff --git a/config/locales/fr_FR.yml b/config/locales/fr_FR.yml deleted file mode 100644 index 8b52fb5..0000000 --- a/config/locales/fr_FR.yml +++ /dev/null @@ -1,214 +0,0 @@ ---- -fr_FR: - activerecord: - errors: - messages: - record_invalid: 'La validation a échoué : %{errors}' - restrict_dependent_destroy: - has_one: "Vous ne pouvez pas supprimer l'enregistrement car un(e) %{record} dépendant(e) existe" - has_many: "Vous ne pouvez pas supprimer l'enregistrement parce que les %{record} dépendants existent" - date: - abbr_day_names: - - dim - - lun - - mar - - mer - - jeu - - ven - - sam - abbr_month_names: - - - - jan. - - fév. - - mar. - - avr. - - mai - - juin - - juil. - - août - - sept. - - oct. - - nov. - - déc. - day_names: - - dimanche - - lundi - - mardi - - mercredi - - jeudi - - vendredi - - samedi - formats: - default: "%d/%m/%Y" - short: "%e %b" - long: "%e %B %Y" - month_names: - - - - janvier - - février - - mars - - avril - - mai - - juin - - juillet - - août - - septembre - - octobre - - novembre - - décembre - order: - - :day - - :month - - :year - datetime: - distance_in_words: - about_x_hours: - one: environ une heure - other: environ %{count} heures - about_x_months: - one: environ un mois - other: environ %{count} mois - about_x_years: - one: environ un an - other: environ %{count} ans - almost_x_years: - one: presqu'un an - other: presque %{count} ans - half_a_minute: une demi-minute - less_than_x_minutes: - zero: moins d'une minute - one: moins d'une minute - other: moins de %{count} minutes - less_than_x_seconds: - zero: moins d'une seconde - one: moins d'une seconde - other: moins de %{count} secondes - over_x_years: - one: plus d'un an - other: plus de %{count} ans - x_days: - one: 1 jour - other: "%{count} jours" - x_minutes: - one: 1 minute - other: "%{count} minutes" - x_months: - one: 1 mois - other: "%{count} mois" - x_seconds: - one: 1 seconde - other: "%{count} secondes" - prompts: - day: Jour - hour: Heure - minute: Minute - month: Mois - second: Seconde - year: Année - errors: - format: "%{attribute} %{message}" - messages: - accepted: doit être accepté(e) - blank: doit être rempli(e) - present: doit être vide - confirmation: ne concorde pas avec %{attribute} - empty: doit être rempli(e) - equal_to: doit être égal à %{count} - even: doit être pair - exclusion: n'est pas disponible - greater_than: doit être supérieur à %{count} - greater_than_or_equal_to: doit être supérieur ou égal à %{count} - inclusion: n'est pas inclus(e) dans la liste - invalid: n'est pas valide - less_than: doit être inférieur à %{count} - less_than_or_equal_to: doit être inférieur ou égal à %{count} - model_invalid: "Validation échouée : %{errors}" - not_a_number: n'est pas un nombre - not_an_integer: doit être un nombre entier - odd: doit être impair - required: doit exister - taken: n'est pas disponible - too_long: - one: est trop long (pas plus d'un caractère) - other: est trop long (pas plus de %{count} caractères) - too_short: - one: est trop court (au moins un caractère) - other: est trop court (au moins %{count} caractères) - wrong_length: - one: ne fait pas la bonne longueur (doit comporter un seul caractère) - other: ne fait pas la bonne longueur (doit comporter %{count} caractères) - other_than: doit être différent de %{count} - template: - body: 'Veuillez vérifier les champs suivants : ' - header: - one: 'Impossible d''enregistrer ce(tte) %{model} : 1 erreur' - other: 'Impossible d''enregistrer ce(tte) %{model} : %{count} erreurs' - helpers: - select: - prompt: Veuillez sélectionner - submit: - create: Créer un(e) %{model} - submit: Enregistrer ce(tte) %{model} - update: Modifier ce(tte) %{model} - number: - currency: - format: - delimiter: " " - format: "%n %u" - precision: 2 - separator: "," - significant: false - strip_insignificant_zeros: false - unit: "€" - format: - delimiter: " " - precision: 3 - separator: "," - significant: false - strip_insignificant_zeros: false - human: - decimal_units: - format: "%n %u" - units: - billion: milliard - million: - one: million - other: millions - quadrillion: million de milliards - thousand: millier - trillion: billion - unit: '' - format: - delimiter: '' - precision: 3 - significant: true - strip_insignificant_zeros: true - storage_units: - format: "%n %u" - units: - byte: - one: octet - other: octets - gb: Go - kb: ko - mb: Mo - tb: To - percentage: - format: - delimiter: '' - format: "%n%" - precision: - format: - delimiter: '' - support: - array: - last_word_connector: " et " - two_words_connector: " et " - words_connector: ", " - time: - am: am - formats: - default: "%d %B %Y %Hh %Mmin %Ss" - long: "%A %d %B %Y %Hh%M" - short: "%d %b %Hh%M" - pm: pm diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml new file mode 100644 index 0000000..d339ece --- /dev/null +++ b/config/locales/pt-BR.yml @@ -0,0 +1,34 @@ +# [+Project:+] DMPRoadmap +# [+Description:+] This file contains all the text present on DMPRoadmap that is not being retrieve from the database. +# [+Copyright:+] Digital Curation Centre and University of California Curation Center + +pt-BR: + date: + formats: + # Use the strftime parameters for formats. + # When no format has been given, it uses default. + # You can provide other formats here if you like! + default: "%m-%d-%Y" + short: "%m/%d/%Y" + long: "%B %d, %Y" + + day_names: ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'] + abbr_day_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sab] + + # Don't forget the nil at the beginning; there's no such thing as a 0th month + month_names: [~, Janeiro, Fevereiro, Março, Abril, Maio, Junho, Julho, Agosto, Setembro, Outubro, Novembro, Dezembro] + abbr_month_names: [~, Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez] + # Used in date_select and datetime_select. + order: + - dia + - meses + - ano + + time: + formats: + default: "%a, %b %d %Y %H:%M:%S %z" + short: "%d %b %H:%M" + custom: "%m/%d/%Y %H:%M" + long: "%B %d, %Y %H:%M" + am: "am" + pm: "pm" \ No newline at end of file diff --git a/config/locales/pt_BR.yml b/config/locales/pt_BR.yml deleted file mode 100644 index 1608efa..0000000 --- a/config/locales/pt_BR.yml +++ /dev/null @@ -1,34 +0,0 @@ -# [+Project:+] DMPRoadmap -# [+Description:+] This file contains all the text present on DMPRoadmap that is not being retrieve from the database. -# [+Copyright:+] Digital Curation Centre and University of California Curation Center - -pt_BR: - date: - formats: - # Use the strftime parameters for formats. - # When no format has been given, it uses default. - # You can provide other formats here if you like! - default: "%m-%d-%Y" - short: "%m/%d/%Y" - long: "%B %d, %Y" - - day_names: ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'] - abbr_day_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sab] - - # Don't forget the nil at the beginning; there's no such thing as a 0th month - month_names: [~, Janeiro, Fevereiro, Março, Abril, Maio, Junho, Julho, Agosto, Setembro, Outubro, Novembro, Dezembro] - abbr_month_names: [~, Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez] - # Used in date_select and datetime_select. - order: - - dia - - meses - - ano - - time: - formats: - default: "%a, %b %d %Y %H:%M:%S %z" - short: "%d %b %H:%M" - custom: "%m/%d/%Y %H:%M" - long: "%B %d, %Y %H:%M" - am: "am" - pm: "pm" \ No newline at end of file diff --git a/config/locales/sv-FI.yml b/config/locales/sv-FI.yml new file mode 100644 index 0000000..cb23155 --- /dev/null +++ b/config/locales/sv-FI.yml @@ -0,0 +1,207 @@ +--- +sv-FI: + activerecord: + errors: + messages: + record_invalid: 'Ett fel uppstod: %{errors}' + restrict_dependent_destroy: + has_one: Kan inte ta bort post då beroende %{record} finns + has_many: Kan inte ta bort poster då beroende %{record} finns + date: + abbr_day_names: + - sön + - mån + - tis + - ons + - tor + - fre + - lör + abbr_month_names: + - + - jan + - feb + - mar + - apr + - maj + - jun + - jul + - aug + - sep + - okt + - nov + - dec + day_names: + - söndag + - måndag + - tisdag + - onsdag + - torsdag + - fredag + - lördag + formats: + default: "%Y-%m-%d" + long: "%e %B %Y" + short: "%e %b" + month_names: + - + - januari + - februari + - mars + - april + - maj + - juni + - juli + - augusti + - september + - oktober + - november + - december + order: + - :day + - :month + - :year + datetime: + distance_in_words: + about_x_hours: + one: ungefär en timme + other: ungefär %{count} timmar + about_x_months: + one: ungefär en månad + other: ungefär %{count} månader + about_x_years: + one: ungefär ett år + other: ungefär %{count} år + almost_x_years: + one: nästan ett år + other: nästan %{count} år + half_a_minute: en halv minut + less_than_x_minutes: + one: mindre än en minut + other: mindre än %{count} minuter + less_than_x_seconds: + one: mindre än en sekund + other: mindre än %{count} sekunder + over_x_years: + one: mer än ett år + other: mer än %{count} år + x_days: + one: en dag + other: "%{count} dagar" + x_minutes: + one: en minut + other: "%{count} minuter" + x_months: + one: en månad + other: "%{count} månader" + x_years: + one: ett år + other: "%{count} år" + x_seconds: + one: en sekund + other: "%{count} sekunder" + prompts: + day: Dag + hour: Timme + minute: Minut + month: Månad + second: Sekund + year: År + errors: + format: "%{attribute} %{message}" + messages: + accepted: måste vara accepterad + blank: måste anges + present: får inte anges + confirmation: stämmer inte överens + empty: får ej vara tom + equal_to: måste vara lika med %{count} + even: måste vara jämnt + exclusion: är reserverat + greater_than: måste vara större än %{count} + greater_than_or_equal_to: måste vara större än eller lika med %{count} + inclusion: finns inte i listan + invalid: har fel format + less_than: måste vara mindre än %{count} + less_than_or_equal_to: måste vara mindre än eller lika med %{count} + model_invalid: "Validering misslyckades: %{errors}" + not_a_number: är inte ett nummer + not_an_integer: måste vara ett heltal + odd: måste vara udda + required: måste finnas + taken: används redan + too_long: är för lång (maximum är %{count} tecken) + too_short: är för kort (minimum är %{count} tecken) + wrong_length: har fel längd (ska vara %{count} tecken) + other_than: måste vara annat än %{count} + template: + body: 'Det var problem med följande fält:' + header: + one: Ett fel förhindrade denna %{model} från att sparas + other: "%{count} fel förhindrade denna %{model} från att sparas" + helpers: + select: + prompt: Välj + submit: + create: Skapa %{model} + submit: Spara %{model} + update: Ändra %{model} + number: + currency: + format: + delimiter: ' ' + format: "%n %u" + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + unit: kr + format: + delimiter: ' ' + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: Miljard + million: Miljon + quadrillion: Biljard + thousand: Tusen + trillion: Biljon + unit: '' + format: + delimiter: '' + precision: 1 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + format: "%n%" + precision: + format: + delimiter: '' + support: + array: + last_word_connector: " och " + two_words_connector: " och " + words_connector: ", " + time: + am: '' + formats: + default: "%a, %e %b %Y %H:%M:%S %z" + long: "%e %B %Y %H:%M" + short: "%e %b %H:%M" + pm: '' diff --git a/config/locales/sv_FI.yml b/config/locales/sv_FI.yml deleted file mode 100644 index 2860838..0000000 --- a/config/locales/sv_FI.yml +++ /dev/null @@ -1,207 +0,0 @@ ---- -sv_FI: - activerecord: - errors: - messages: - record_invalid: 'Ett fel uppstod: %{errors}' - restrict_dependent_destroy: - has_one: Kan inte ta bort post då beroende %{record} finns - has_many: Kan inte ta bort poster då beroende %{record} finns - date: - abbr_day_names: - - sön - - mån - - tis - - ons - - tor - - fre - - lör - abbr_month_names: - - - - jan - - feb - - mar - - apr - - maj - - jun - - jul - - aug - - sep - - okt - - nov - - dec - day_names: - - söndag - - måndag - - tisdag - - onsdag - - torsdag - - fredag - - lördag - formats: - default: "%Y-%m-%d" - long: "%e %B %Y" - short: "%e %b" - month_names: - - - - januari - - februari - - mars - - april - - maj - - juni - - juli - - augusti - - september - - oktober - - november - - december - order: - - :day - - :month - - :year - datetime: - distance_in_words: - about_x_hours: - one: ungefär en timme - other: ungefär %{count} timmar - about_x_months: - one: ungefär en månad - other: ungefär %{count} månader - about_x_years: - one: ungefär ett år - other: ungefär %{count} år - almost_x_years: - one: nästan ett år - other: nästan %{count} år - half_a_minute: en halv minut - less_than_x_minutes: - one: mindre än en minut - other: mindre än %{count} minuter - less_than_x_seconds: - one: mindre än en sekund - other: mindre än %{count} sekunder - over_x_years: - one: mer än ett år - other: mer än %{count} år - x_days: - one: en dag - other: "%{count} dagar" - x_minutes: - one: en minut - other: "%{count} minuter" - x_months: - one: en månad - other: "%{count} månader" - x_years: - one: ett år - other: "%{count} år" - x_seconds: - one: en sekund - other: "%{count} sekunder" - prompts: - day: Dag - hour: Timme - minute: Minut - month: Månad - second: Sekund - year: År - errors: - format: "%{attribute} %{message}" - messages: - accepted: måste vara accepterad - blank: måste anges - present: får inte anges - confirmation: stämmer inte överens - empty: får ej vara tom - equal_to: måste vara lika med %{count} - even: måste vara jämnt - exclusion: är reserverat - greater_than: måste vara större än %{count} - greater_than_or_equal_to: måste vara större än eller lika med %{count} - inclusion: finns inte i listan - invalid: har fel format - less_than: måste vara mindre än %{count} - less_than_or_equal_to: måste vara mindre än eller lika med %{count} - model_invalid: "Validering misslyckades: %{errors}" - not_a_number: är inte ett nummer - not_an_integer: måste vara ett heltal - odd: måste vara udda - required: måste finnas - taken: används redan - too_long: är för lång (maximum är %{count} tecken) - too_short: är för kort (minimum är %{count} tecken) - wrong_length: har fel längd (ska vara %{count} tecken) - other_than: måste vara annat än %{count} - template: - body: 'Det var problem med följande fält:' - header: - one: Ett fel förhindrade denna %{model} från att sparas - other: "%{count} fel förhindrade denna %{model} från att sparas" - helpers: - select: - prompt: Välj - submit: - create: Skapa %{model} - submit: Spara %{model} - update: Ändra %{model} - number: - currency: - format: - delimiter: ' ' - format: "%n %u" - precision: 2 - separator: "," - significant: false - strip_insignificant_zeros: false - unit: kr - format: - delimiter: ' ' - precision: 2 - separator: "," - significant: false - strip_insignificant_zeros: false - human: - decimal_units: - format: "%n %u" - units: - billion: Miljard - million: Miljon - quadrillion: Biljard - thousand: Tusen - trillion: Biljon - unit: '' - format: - delimiter: '' - precision: 1 - significant: true - strip_insignificant_zeros: true - storage_units: - format: "%n %u" - units: - byte: - one: Byte - other: Bytes - gb: GB - kb: KB - mb: MB - tb: TB - percentage: - format: - delimiter: '' - format: "%n%" - precision: - format: - delimiter: '' - support: - array: - last_word_connector: " och " - two_words_connector: " och " - words_connector: ", " - time: - am: '' - formats: - default: "%a, %e %b %Y %H:%M:%S %z" - long: "%e %B %Y %H:%M" - short: "%e %b %H:%M" - pm: '' diff --git a/db/seeds.rb b/db/seeds.rb index 4e64d6f..3987a81 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,12 +12,11 @@ include FactoryBot::Syntax::Methods - -LOCALE = :en - -I18n.locale = LOCALE -Faker::Config.locale = LOCALE -FastGettext.default_locale = LOCALE +I18n.available_locales = ['en', 'en-GB', 'de', 'fr'] +I18n.locale = LocaleFormatter.new(:en, format: :i18n).to_s +# Keep this as :en. Faker doesn't have :en-GB +Faker::Config.locale = LocaleFormatter.new(:en, format: :i18n).to_s +FastGettext.default_locale = LocaleFormatter.new(:en, format: :fast_gettext).to_s require 'factory_bot' @@ -87,11 +86,11 @@ # Languages (check config/locales for any ones not defined here) # ------------------------------------------------------- languages = [ - {abbreviation: 'en_GB', + {abbreviation: 'en-GB', description: '', name: 'English (GB)', default_language: true}, - {abbreviation: 'en_US', + {abbreviation: 'en-US', description: '', name: 'English (US)', default_language: false}, @@ -224,16 +223,16 @@ {name: Branding.fetch(:organisation, :name), abbreviation: Branding.fetch(:organisation, :abbreviation), org_type: 4, links: {"org":[]}, - language: Language.find_by(abbreviation: 'en_GB'), + language: Language.find_by(abbreviation: 'en-GB'), token_permission_types: TokenPermissionType.all}, {name: 'Government Agency', abbreviation: 'GA', org_type: 2, links: {"org":[]}, - language: Language.find_by(abbreviation: 'en_GB')}, + language: Language.find_by(abbreviation: 'en-GB')}, {name: 'University of Exampleland', abbreviation: 'UOS', org_type: 1, links: {"org":[]}, - language: Language.find_by(abbreviation: 'en_GB')} + language: Language.find_by(abbreviation: 'en-GB')} ] orgs.map{ |o| create(:org, o) } diff --git a/lib/locale_formatter.rb b/lib/locale_formatter.rb new file mode 100644 index 0000000..e2590c4 --- /dev/null +++ b/lib/locale_formatter.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Takes a given locale string and formats it properly for the desired framework +# +# Examples: +# +# @formatter = LocaleFormatter.new('en-GB').to_s # => 'en-GB' +# @formatter = LocaleFormatter.new('en-GB', format: :fast_gettext).to_s # => 'en_GB' +# @formatter = LocaleFormatter.new('en_GB', format: :i18n).to_s # => 'en-GB' +# +class LocaleFormatter + + # I18n formats use a hyphen to join the language and region + I18N_JOIN = "-" + + # FastGettext formats use an underscore to join the language and region + FAST_GETTEXT_JOIN = "_" + + # Regex to extract the components (language and region) from a locale String + COMPONENT_FORMAT = /[a-z]{2}/i + + # The format to modify the String in + # + # Returns Symbol + attr_reader :format + + # The formatted locale as a string + # + # Returns String + attr_reader :string + + alias to_s string + + # Takes a given locale string and formats it properly for the desired framework + # + # string - A locale String (e.g. "en_GB", "en-GB", "en", :en) + # format - A Symbol representing the desired translation framework (defaults: :i18n) + # + def initialize(string, format: :i18n) + @format = format + + language, region = string.to_s.scan(COMPONENT_FORMAT) + join_char = format.to_sym == :fast_gettext ? FAST_GETTEXT_JOIN : I18N_JOIN + + language.downcase! if language + region.upcase! if region + + if region.present? + @string = "#{language}#{join_char}#{region}" + else + @string = language + end + end + +end diff --git a/lib/locale_set.rb b/lib/locale_set.rb new file mode 100644 index 0000000..3c14d8f --- /dev/null +++ b/lib/locale_set.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +# A subclass of Set which holds locale values. Mediates between I18n and FastGettext which +# have different expectations of locale formats. +# +# Examples: +# +# @locale_set = LocaleSet.new(["en_GB", "en", "fr", "de", :ch_TW]) +# @locale_set.for(:i18n) # => ['en-GB', 'en', 'fr', 'de', 'ch-TW'] +# @locale_set.for(:fast_gettext) # => ['en_GB', 'en', 'fr', 'de', 'ch_TW'] +# +class LocaleSet < Set + + # The values from the Set in the desired format for the given localization framework + # + # framework - A symbol representing either :i18n or :fast_gettext (defaults: :i18n) + # + # Returns Array + def for(framework) + if framework.to_sym == :i18n + map { |l| LocaleFormatter.new(l, format: :i18n).to_s } + else + map { |l| LocaleFormatter.new(l, format: :fast_gettext).to_s } + end + end + +end diff --git a/lib/tasks/upgrade.rake b/lib/tasks/upgrade.rake index 66043bd..03f7c89 100644 --- a/lib/tasks/upgrade.rake +++ b/lib/tasks/upgrade.rake @@ -1,6 +1,21 @@ require 'set' namespace :upgrade do + desc "Update Language abbreviations to use ISO format" + task :normalize_language_formats => :environment do + Language.all.each do |language| + language.update(abbreviation: LocaleFormatter.new(language.abbreviation)) + end + Template.all.each do |template| + next if template.locale.blank? + template.update(locale: LocaleFormatter.new(template.locale)) + end + Theme.all.each do |theme| + next if theme.locale.blank? + theme.update(locale: LocaleFormatter.new(theme.locale)) + end + end + desc "Upgrade to v1.2.0" task v1_2_0: :environment do Rake::Task['upgrade:add_versioning_id_to_templates'].execute diff --git a/spec/features/locales_spec.rb b/spec/features/locales_spec.rb index 73f0fc9..2ef4c5b 100644 --- a/spec/features/locales_spec.rb +++ b/spec/features/locales_spec.rb @@ -7,7 +7,7 @@ Language.where( default_language: true, name: "English", - abbreviation: "en_GB" + abbreviation: "en-GB" ).first_or_create, Language.where( @@ -21,11 +21,21 @@ let!(:user) { create(:user, language: languages.first) } before do - Rails.application.config.i18n.available_locales << languages.last.abbreviation - FastGettext.default_available_locales << languages.last.abbreviation + locale_set = LocaleSet.new(languages.map(&:abbreviation)) + I18n.available_locales = locale_set.for(:i18n) + FastGettext.default_available_locales = locale_set.for(:fast_gettext) + I18n.locale = locale_set.for(:i18n).first + FastGettext.locale = locale_set.for(:fast_gettext).first sign_in(user) end + after do + I18n.available_locales = AVAILABLE_TEST_LOCALES.for(:i18n) + FastGettext.default_available_locales = AVAILABLE_TEST_LOCALES.for(:fast_gettext) + I18n.default_locale = AVAILABLE_TEST_LOCALES.for(:i18n).first + FastGettext.default_locale = AVAILABLE_TEST_LOCALES.for(:fast_gettext).first + end + scenario "user changes their locale" do click_link "Language" expect(current_path).to eql(plans_path) diff --git a/spec/lib/locale_formatter_spec.rb b/spec/lib/locale_formatter_spec.rb new file mode 100644 index 0000000..c8da5b5 --- /dev/null +++ b/spec/lib/locale_formatter_spec.rb @@ -0,0 +1,63 @@ +require 'spec_helper' + +RSpec.describe LocaleFormatter do + + context "#format" do + + subject { LocaleFormatter.new('en_GB').format } + + it "defaults to :i18n" do + expect(subject).to eql(:i18n) + end + + end + + describe "#string" do + + context "when format is :i18n" do + + subject { LocaleFormatter.new(locale_string, format: format).string } + + let(:locale_string) { 'HH_xx' } + + let!(:format) { :i18n } + + it "forces the hyphenated format" do + expect(subject).to eql("hh-XX") + end + + it "downcases the language component" do + expect(subject).to start_with('hh') + end + + it "upcases the region" do + expect(subject).to end_with('XX') + end + + end + + context "when format is :fast_gettext" do + + subject { LocaleFormatter.new(locale_string, format: format).string } + + let(:locale_string) { 'HH-xx' } + + let!(:format) { :fast_gettext } + + it "forces the underescore format" do + expect(subject).to eql("hh_XX") + end + + it "downcases the language component" do + expect(subject).to start_with('hh') + end + + it "upcases the region" do + expect(subject).to end_with('XX') + end + + end + + end + +end diff --git a/spec/lib/locale_set_spec.rb b/spec/lib/locale_set_spec.rb new file mode 100644 index 0000000..946c936 --- /dev/null +++ b/spec/lib/locale_set_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +RSpec.describe LocaleSet do + + describe "#for" do + + subject { LocaleSet.new(['en_gb', 'EN-US', :es, :fr]).for(format) } + + let!(:format) { :i18n } + + it "converts each item to a string" do + subject.each do |item| + expect(item).to be_a(String) + end + end + + it "removes duplicate items" do + @locale_set = LocaleSet.new([:es, :es]) + expect(@locale_set).to have(1).item + end + + context "when format is :i18n" do + + let!(:format) { :i18n } + + it "returns each item in i18n format" do + expect(subject).to eql(['en-GB', 'en-US', 'es', 'fr']) + end + + end + + context "when format is :fast_gettext" do + + let!(:format) { :fast_gettext } + + it "returns each item in fast_gettext format" do + expect(subject).to eql(['en_GB', 'en_US', 'es', 'fr']) + end + + end + + end + +end diff --git a/spec/models/language_spec.rb b/spec/models/language_spec.rb index 49da5ce..55acd46 100644 --- a/spec/models/language_spec.rb +++ b/spec/models/language_spec.rb @@ -12,15 +12,13 @@ it { is_expected.to validate_presence_of(:abbreviation) } - it { is_expected.to validate_uniqueness_of(:abbreviation) - .with_message("must be unique") } + it "is expected to validate uniquenss of abbreviation" do + @language = build(:language, abbreviation: create(:language).abbreviation) + expect(@language).not_to be_valid + expect(@language).to have(1).errors_on(:abbreviation) + end - it { is_expected.to allow_values('en', 'en_GB').for(:abbreviation) } - - it { is_expected.not_to allow_value('NOOP', 'en_', 'EN') - .for(:abbreviation) } - - it { is_expected.to validate_length_of(:abbreviation).is_at_most(5) } + it { is_expected.to allow_values('en', 'en-GB').for(:abbreviation) } end @@ -99,4 +97,48 @@ end + describe "#abbreviation" do + + context "when region is present" do + + it "forces the hyphenated format" do + @language = Language.new(name: "Esperanto", abbreviation: "hh_XX") + @language.valid? + expect(@language.abbreviation).to eql("hh-XX") + end + + it "downcases the language component" do + @language = Language.new(name: "Esperanto", abbreviation: "HH_XX") + @language.valid? + expect(@language.abbreviation).to start_with('hh') + end + + it "upcases the region" do + @language = Language.new(name: "Esperanto", abbreviation: "hh_xx") + @language.valid? + expect(@language.abbreviation).to end_with('XX') + end + + + end + + context "when region is absent" do + + it "downases the given value" do + @language = Language.new(name: "Esperanto", abbreviation: "HH") + @language.valid? + expect(@language.abbreviation).to eql("hh") + end + + it "doesn't change well-formatted values" do + @language = Language.new(name: "Esperanto", abbreviation: "hh") + @language.valid? + expect(@language.abbreviation).to eql("hh") + end + + + end + + end + end diff --git a/spec/support/faker.rb b/spec/support/faker.rb index 65ff4f9..3f35c1f 100644 --- a/spec/support/faker.rb +++ b/spec/support/faker.rb @@ -1,11 +1,12 @@ require 'faker' -LOCALE = 'en_GB' +# Keep this as :en. Faker doesn't have :en-GB +LOCALE = 'en' RSpec.configure do |config| config.before(:each) do - I18n.locale = LOCALE - Faker::Config.locale = LOCALE - FastGettext.default_locale = LOCALE + I18n.locale = LocaleFormatter.new(LOCALE, format: :i18n).to_s + Faker::Config.locale = LocaleFormatter.new(LOCALE, format: :i18n).to_s + FastGettext.default_locale = LocaleFormatter.new(LOCALE, format: :fast_gettext).to_s end end diff --git a/spec/support/locales.rb b/spec/support/locales.rb index 83b4092..d275e36 100644 --- a/spec/support/locales.rb +++ b/spec/support/locales.rb @@ -2,11 +2,23 @@ require 'shoulda/matchers' -AVAILABLE_TEST_LOCALES = %w[ en en_GB fr de ] +AVAILABLE_TEST_LOCALES = LocaleSet.new(%w[ en-GB en fr de ]) RSpec.configure do |config| - config.before(:each, type: :feature) do - I18n.config.enforce_available_locales = false - I18n.config.available_locales = AVAILABLE_TEST_LOCALES + + config.before(:suite) do + # This is required for the Faker gem. See this issue here: + # https://github.com/stympy/faker/issues/266 + I18n.available_locales = AVAILABLE_TEST_LOCALES.for(:i18n) + FastGettext.default_available_locales = AVAILABLE_TEST_LOCALES.for(:fast_gettext) + I18n.default_locale = AVAILABLE_TEST_LOCALES.for(:i18n).first + FastGettext.default_locale = AVAILABLE_TEST_LOCALES.for(:fast_gettext).first end + + config.before(:each, type: :feature) do + I18n.config.enforce_available_locales = true + I18n.config.locale = LocaleFormatter.new('en-GB', format: :i18n).to_s + FastGettext.locale = LocaleFormatter.new('en_GB', format: :fast_gettext).to_s + end + end