From b1c0c2a9ecd675f9bd9a9479f46cd6fcb7e64fef Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 27 Jan 2012 17:17:16 +0000 Subject: [PATCH] Fix Portuguese and Armenian --- config/locales/hy.yml | 1 - config/locales/hy.yml | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ config/locales/pt.yml | 1 - config/locales/pt.yml | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ test/unit/noosfero_i18n_test.rb | 16 ++++++++++++++++ 5 files changed, 473 insertions(+), 2 deletions(-) delete mode 120000 config/locales/hy.yml create mode 100644 config/locales/hy.yml delete mode 120000 config/locales/pt.yml create mode 100644 config/locales/pt.yml diff --git a/config/locales/hy.yml b/config/locales/hy.yml deleted file mode 120000 index 53a6791..0000000 --- a/config/locales/hy.yml +++ /dev/null @@ -1 +0,0 @@ -en-US.yml \ No newline at end of file diff --git a/config/locales/hy.yml b/config/locales/hy.yml new file mode 100644 index 0000000..60fb076 --- /dev/null +++ b/config/locales/hy.yml @@ -0,0 +1,224 @@ +# Armenian translations for Ruby on Rails +# +# FIXME: This is a copy of en-US.yml. Armenian translators, please translate +# this into Armenian. + +"hy": + date: + formats: + default: "%Y-%m-%d" + short: "%b %d" + long: "%B %d, %Y" + + day_names: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + abbr_day_names: + - Sun + - Mon + - Tue + - Wed + - Thu + - Fri + - Sat + + month_names: + - ~ + - January + - February + - March + - April + - May + - June + - July + - August + - September + - October + - November + - December + abbr_month_names: + - ~ + - Jan + - Feb + - Mar + - Apr + - May + - Jun + - Jul + - Aug + - Sep + - Oct + - Nov + - Dec + order: + - :year + - :month + - :day + + time: + formats: + default: "%a, %d %b %Y %H:%M:%S %z" + short: "%d %b %H:%M" + long: "%B %d, %Y %H:%M" + am: "am" + pm: "pm" + + support: + array: + words_connector: ", " + two_words_connector: " and " + last_word_connector: ", and " + + select: + prompt: "Please select" + + number: + format: + separator: "." + delimiter: "," + precision: 3 + significant: false + strip_insignificant_zeros: false + currency: + format: + format: "%u%n" + unit: "$" + separator: "." + delimiter: "," + precision: 2 + significant: false + strip_insignificant_zeros: false + percentage: + format: + delimiter: "" + precision: + format: + delimiter: "" + human: + format: + delimiter: "" + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: "Byte" + other: "Bytes" + kb: "KB" + mb: "MB" + gb: "GB" + tb: "TB" + decimal_units: + format: "%n %u" + units: + unit: "" + thousand: Thousand + million: Million + billion: Billion + trillion: Trillion + quadrillion: Quadrillion + + datetime: + distance_in_words: + half_a_minute: "half a minute" + less_than_x_seconds: + one: "less than 1 second" + other: "less than %{count} seconds" + x_seconds: + one: "1 second" + other: "%{count} seconds" + less_than_x_minutes: + one: "less than a minute" + other: "less than %{count} minutes" + x_minutes: + one: "1 minute" + other: "%{count} minutes" + about_x_hours: + one: "about 1 hour" + other: "about %{count} hours" + x_days: + one: "1 day" + other: "%{count} days" + about_x_months: + one: "about 1 month" + other: "about %{count} months" + x_months: + one: "1 month" + other: "%{count} months" + about_x_years: + one: "about 1 year" + other: "about %{count} years" + over_x_years: + one: "over 1 year" + other: "over %{count} years" + almost_x_years: + one: "almost 1 year" + other: "almost %{count} years" + prompts: + year: "Year" + month: "Month" + day: "Day" + hour: "Hour" + minute: "Minute" + second: "Seconds" + + helpers: + select: + prompt: "Please select" + + submit: + create: 'Create %{model}' + update: 'Update %{model}' + submit: 'Save %{model}' + + errors: + format: "%{attribute} %{message}" + messages: &errors_messages + inclusion: "is not included in the list" + exclusion: "is reserved" + invalid: "is invalid" + confirmation: "doesn't match confirmation" + accepted: "must be accepted" + empty: "can't be empty" + blank: "can't be blank" + 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)" + not_a_number: "is not a number" + not_an_integer: "must be an integer" + greater_than: "must be greater than %{count}" + greater_than_or_equal_to: "must be greater than or equal to %{count}" + equal_to: "must be equal to %{count}" + less_than: "must be less than %{count}" + less_than_or_equal_to: "must be less than or equal to %{count}" + odd: "must be odd" + even: "must be even" + taken: "has already been taken" + record_invalid: "Validation failed: %{errors}" + template: &errors_template + header: + one: "1 error prohibited this %{model} from being saved" + other: "%{count} errors prohibited this %{model} from being saved" + body: "There were problems with the following fields:" + + activerecord: + errors: + messages: + <<: *errors_messages + template: + <<: *errors_template + full_messages: + format: "%{attribute} %{message}" diff --git a/config/locales/pt.yml b/config/locales/pt.yml deleted file mode 120000 index 58f79e0..0000000 --- a/config/locales/pt.yml +++ /dev/null @@ -1 +0,0 @@ -pt-BR.yml \ No newline at end of file diff --git a/config/locales/pt.yml b/config/locales/pt.yml new file mode 100644 index 0000000..18afa5f --- /dev/null +++ b/config/locales/pt.yml @@ -0,0 +1,233 @@ +# encoding: UTF-8 +# pt-BR translations for Ruby on Rails +"pt": + # formatos de data e hora + date: + formats: + default: "%d/%m/%Y" + short: "%d de %B" + long: "%d de %B de %Y" + + day_names: + - Domingo + - Segunda + - Terça + - Quarta + - Quinta + - Sexta + - Sábado + abbr_day_names: + - Dom + - Seg + - Ter + - Qua + - Qui + - Sex + - Sáb + + 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 + order: + - :day + - :month + - :year + + time: + formats: + default: "%A, %d de %B de %Y, %H:%M h" + short: "%d/%m, %H:%M h" + long: "%A, %d de %B de %Y, %H:%M h" + am: '' + pm: '' + + # Usado no Array.to_sentence + support: + array: + words_connector: ", " + two_words_connector: " e " + last_word_connector: " e " + + select: + prompt: "Por favor selecione" + + number: + format: + separator: ',' + delimiter: '.' + precision: 3 + significant: false + strip_insignificant_zeros: false + + currency: + format: + format: '%u %n' + unit: 'R$' + separator: ',' + delimiter: '.' + precision: 2 + significant: false + strip_insignificant_zeros: false + + percentage: + format: + delimiter: '.' + + precision: + format: + delimiter: '.' + + human: + format: + delimiter: '.' + precision: 2 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: "Byte" + other: "Bytes" + kb: "KB" + mb: "MB" + gb: "GB" + tb: "TB" + # number_to_human() + # new in rails 3: please add to other locales + decimal_units: + format: "%n %u" + units: + unit: "" + thousand: "mil" + million: + one: milhão + other: milhões + billion: + one: bilhão + other: bilhões + trillion: + one: trilhão + other: trilhões + quadrillion: + one: quatrilhão + other: quatrilhões + + # distancia do tempo em palavras + datetime: + distance_in_words: + half_a_minute: 'meio minuto' + less_than_x_seconds: + one: 'menos de 1 segundo' + other: 'menos de %{count} segundos' + x_seconds: + one: '1 segundo' + other: '%{count} segundos' + less_than_x_minutes: + one: 'menos de um minuto' + other: 'menos de %{count} minutos' + x_minutes: + one: '1 minuto' + other: '%{count} minutos' + about_x_hours: + one: 'aproximadamente 1 hora' + other: 'aproximadamente %{count} horas' + x_days: + one: '1 dia' + other: '%{count} dias' + about_x_months: + one: 'aproximadamente 1 mês' + other: 'aproximadamente %{count} meses' + x_months: + one: '1 mês' + other: '%{count} meses' + about_x_years: + one: 'aproximadamente 1 ano' + other: 'aproximadamente %{count} anos' + over_x_years: + one: 'mais de 1 ano' + other: 'mais de %{count} anos' + almost_x_years: + one: 'quase 1 ano' + other: 'quase %{count} anos' + prompts: + year: "Ano" + month: "Mês" + day: "Dia" + hour: "Hora" + minute: "Minuto" + second: "Segundo" + + helpers: + select: + prompt: "Por favor selecione" + + submit: + create: 'Criar %{model}' + update: 'Atualizar %{model}' + submit: 'Salvar %{model}' + + errors: + format: "%{attribute} %{message}" + messages: &errors_messages + inclusion: "não está incluído na lista" + exclusion: "não está disponível" + invalid: "não é válido" + confirmation: "não está de acordo com a confirmação" + accepted: "deve ser aceito" + empty: "não pode ficar vazio" + blank: "não pode ficar em branco" + too_long: "é muito longo (máximo: %{count} caracteres)" + too_short: "é muito curto (mínimo: %{count} caracteres)" + wrong_length: "não possui o tamanho esperado (%{count} caracteres)" + not_a_number: "não é um número" + not_an_integer: "não é um número inteiro" + greater_than: "deve ser maior que %{count}" + greater_than_or_equal_to: "deve ser maior ou igual a %{count}" + equal_to: "deve ser igual a %{count}" + less_than: "deve ser menor que %{count}" + less_than_or_equal_to: "deve ser menor ou igual a %{count}" + odd: "deve ser ímpar" + even: "deve ser par" + taken: "já está em uso" + record_invalid: "A validação falhou: %{errors}" + template: &errors_template + header: + one: "Não foi possível gravar %{model}: 1 erro" + other: "Não foi possível gravar %{model}: %{count} erros." + body: "Por favor, verifique o(s) seguinte(s) campo(s):" + + activerecord: + errors: + messages: + <<: *errors_messages + template: + <<: *errors_template + + full_messages: + format: "%{attribute} %{message}" diff --git a/test/unit/noosfero_i18n_test.rb b/test/unit/noosfero_i18n_test.rb index 9aea239..f8c7746 100644 --- a/test/unit/noosfero_i18n_test.rb +++ b/test/unit/noosfero_i18n_test.rb @@ -2,13 +2,29 @@ require File.dirname(__FILE__) + '/../test_helper' class NoosferoI18nTest < ActiveSupport::TestCase + def setup + @locale = I18n.locale + end + + def teardown + I18n.locale = @locale + end + Noosfero.available_locales.each do |locale| + next if locale == 'en' + should('have locale file for %s' % locale) do locale_file = 'config/locales/%s.yml' % locale assert File.exists?(File.join(Rails.root, locale_file)), "#{locale_file} not found" end + should('be able to translate activerecord errors header to %s' % locale) do + I18n.locale = locale + translation = I18n.translate 'activerecord.errors.template.header.one' + assert translation !~ /translation missing/, "Missing translation for activerecord.errors.template.header.one to #{Noosfero.locales[locale]}" + end + end end -- libgit2 0.21.2