Commit b1c0c2a9ecd675f9bd9a9479f46cd6fcb7e64fef
1 parent
0661c78e
Exists in
master
and in
28 other branches
Fix Portuguese and Armenian
Showing
5 changed files
with
473 additions
and
2 deletions
Show diff stats
config/locales/hy.yml
| @@ -0,0 +1,224 @@ | @@ -0,0 +1,224 @@ | ||
| 1 | +# Armenian translations for Ruby on Rails | ||
| 2 | +# | ||
| 3 | +# FIXME: This is a copy of en-US.yml. Armenian translators, please translate | ||
| 4 | +# this into Armenian. | ||
| 5 | + | ||
| 6 | +"hy": | ||
| 7 | + date: | ||
| 8 | + formats: | ||
| 9 | + default: "%Y-%m-%d" | ||
| 10 | + short: "%b %d" | ||
| 11 | + long: "%B %d, %Y" | ||
| 12 | + | ||
| 13 | + day_names: | ||
| 14 | + - Sunday | ||
| 15 | + - Monday | ||
| 16 | + - Tuesday | ||
| 17 | + - Wednesday | ||
| 18 | + - Thursday | ||
| 19 | + - Friday | ||
| 20 | + - Saturday | ||
| 21 | + abbr_day_names: | ||
| 22 | + - Sun | ||
| 23 | + - Mon | ||
| 24 | + - Tue | ||
| 25 | + - Wed | ||
| 26 | + - Thu | ||
| 27 | + - Fri | ||
| 28 | + - Sat | ||
| 29 | + | ||
| 30 | + month_names: | ||
| 31 | + - ~ | ||
| 32 | + - January | ||
| 33 | + - February | ||
| 34 | + - March | ||
| 35 | + - April | ||
| 36 | + - May | ||
| 37 | + - June | ||
| 38 | + - July | ||
| 39 | + - August | ||
| 40 | + - September | ||
| 41 | + - October | ||
| 42 | + - November | ||
| 43 | + - December | ||
| 44 | + abbr_month_names: | ||
| 45 | + - ~ | ||
| 46 | + - Jan | ||
| 47 | + - Feb | ||
| 48 | + - Mar | ||
| 49 | + - Apr | ||
| 50 | + - May | ||
| 51 | + - Jun | ||
| 52 | + - Jul | ||
| 53 | + - Aug | ||
| 54 | + - Sep | ||
| 55 | + - Oct | ||
| 56 | + - Nov | ||
| 57 | + - Dec | ||
| 58 | + order: | ||
| 59 | + - :year | ||
| 60 | + - :month | ||
| 61 | + - :day | ||
| 62 | + | ||
| 63 | + time: | ||
| 64 | + formats: | ||
| 65 | + default: "%a, %d %b %Y %H:%M:%S %z" | ||
| 66 | + short: "%d %b %H:%M" | ||
| 67 | + long: "%B %d, %Y %H:%M" | ||
| 68 | + am: "am" | ||
| 69 | + pm: "pm" | ||
| 70 | + | ||
| 71 | + support: | ||
| 72 | + array: | ||
| 73 | + words_connector: ", " | ||
| 74 | + two_words_connector: " and " | ||
| 75 | + last_word_connector: ", and " | ||
| 76 | + | ||
| 77 | + select: | ||
| 78 | + prompt: "Please select" | ||
| 79 | + | ||
| 80 | + number: | ||
| 81 | + format: | ||
| 82 | + separator: "." | ||
| 83 | + delimiter: "," | ||
| 84 | + precision: 3 | ||
| 85 | + significant: false | ||
| 86 | + strip_insignificant_zeros: false | ||
| 87 | + currency: | ||
| 88 | + format: | ||
| 89 | + format: "%u%n" | ||
| 90 | + unit: "$" | ||
| 91 | + separator: "." | ||
| 92 | + delimiter: "," | ||
| 93 | + precision: 2 | ||
| 94 | + significant: false | ||
| 95 | + strip_insignificant_zeros: false | ||
| 96 | + percentage: | ||
| 97 | + format: | ||
| 98 | + delimiter: "" | ||
| 99 | + precision: | ||
| 100 | + format: | ||
| 101 | + delimiter: "" | ||
| 102 | + human: | ||
| 103 | + format: | ||
| 104 | + delimiter: "" | ||
| 105 | + precision: 3 | ||
| 106 | + significant: true | ||
| 107 | + strip_insignificant_zeros: true | ||
| 108 | + storage_units: | ||
| 109 | + format: "%n %u" | ||
| 110 | + units: | ||
| 111 | + byte: | ||
| 112 | + one: "Byte" | ||
| 113 | + other: "Bytes" | ||
| 114 | + kb: "KB" | ||
| 115 | + mb: "MB" | ||
| 116 | + gb: "GB" | ||
| 117 | + tb: "TB" | ||
| 118 | + decimal_units: | ||
| 119 | + format: "%n %u" | ||
| 120 | + units: | ||
| 121 | + unit: "" | ||
| 122 | + thousand: Thousand | ||
| 123 | + million: Million | ||
| 124 | + billion: Billion | ||
| 125 | + trillion: Trillion | ||
| 126 | + quadrillion: Quadrillion | ||
| 127 | + | ||
| 128 | + datetime: | ||
| 129 | + distance_in_words: | ||
| 130 | + half_a_minute: "half a minute" | ||
| 131 | + less_than_x_seconds: | ||
| 132 | + one: "less than 1 second" | ||
| 133 | + other: "less than %{count} seconds" | ||
| 134 | + x_seconds: | ||
| 135 | + one: "1 second" | ||
| 136 | + other: "%{count} seconds" | ||
| 137 | + less_than_x_minutes: | ||
| 138 | + one: "less than a minute" | ||
| 139 | + other: "less than %{count} minutes" | ||
| 140 | + x_minutes: | ||
| 141 | + one: "1 minute" | ||
| 142 | + other: "%{count} minutes" | ||
| 143 | + about_x_hours: | ||
| 144 | + one: "about 1 hour" | ||
| 145 | + other: "about %{count} hours" | ||
| 146 | + x_days: | ||
| 147 | + one: "1 day" | ||
| 148 | + other: "%{count} days" | ||
| 149 | + about_x_months: | ||
| 150 | + one: "about 1 month" | ||
| 151 | + other: "about %{count} months" | ||
| 152 | + x_months: | ||
| 153 | + one: "1 month" | ||
| 154 | + other: "%{count} months" | ||
| 155 | + about_x_years: | ||
| 156 | + one: "about 1 year" | ||
| 157 | + other: "about %{count} years" | ||
| 158 | + over_x_years: | ||
| 159 | + one: "over 1 year" | ||
| 160 | + other: "over %{count} years" | ||
| 161 | + almost_x_years: | ||
| 162 | + one: "almost 1 year" | ||
| 163 | + other: "almost %{count} years" | ||
| 164 | + prompts: | ||
| 165 | + year: "Year" | ||
| 166 | + month: "Month" | ||
| 167 | + day: "Day" | ||
| 168 | + hour: "Hour" | ||
| 169 | + minute: "Minute" | ||
| 170 | + second: "Seconds" | ||
| 171 | + | ||
| 172 | + helpers: | ||
| 173 | + select: | ||
| 174 | + prompt: "Please select" | ||
| 175 | + | ||
| 176 | + submit: | ||
| 177 | + create: 'Create %{model}' | ||
| 178 | + update: 'Update %{model}' | ||
| 179 | + submit: 'Save %{model}' | ||
| 180 | + | ||
| 181 | + errors: | ||
| 182 | + format: "%{attribute} %{message}" | ||
| 183 | + messages: &errors_messages | ||
| 184 | + inclusion: "is not included in the list" | ||
| 185 | + exclusion: "is reserved" | ||
| 186 | + invalid: "is invalid" | ||
| 187 | + confirmation: "doesn't match confirmation" | ||
| 188 | + accepted: "must be accepted" | ||
| 189 | + empty: "can't be empty" | ||
| 190 | + blank: "can't be blank" | ||
| 191 | + too_long: | ||
| 192 | + one: "is too long (maximum is 1 character)" | ||
| 193 | + other: "is too long (maximum is %{count} characters)" | ||
| 194 | + too_short: | ||
| 195 | + one: "is too short (minimum is 1 character)" | ||
| 196 | + other: "is too short (minimum is %{count} characters)" | ||
| 197 | + wrong_length: | ||
| 198 | + one: "is the wrong length (should be 1 character)" | ||
| 199 | + other: "is the wrong length (should be %{count} characters)" | ||
| 200 | + not_a_number: "is not a number" | ||
| 201 | + not_an_integer: "must be an integer" | ||
| 202 | + greater_than: "must be greater than %{count}" | ||
| 203 | + greater_than_or_equal_to: "must be greater than or equal to %{count}" | ||
| 204 | + equal_to: "must be equal to %{count}" | ||
| 205 | + less_than: "must be less than %{count}" | ||
| 206 | + less_than_or_equal_to: "must be less than or equal to %{count}" | ||
| 207 | + odd: "must be odd" | ||
| 208 | + even: "must be even" | ||
| 209 | + taken: "has already been taken" | ||
| 210 | + record_invalid: "Validation failed: %{errors}" | ||
| 211 | + template: &errors_template | ||
| 212 | + header: | ||
| 213 | + one: "1 error prohibited this %{model} from being saved" | ||
| 214 | + other: "%{count} errors prohibited this %{model} from being saved" | ||
| 215 | + body: "There were problems with the following fields:" | ||
| 216 | + | ||
| 217 | + activerecord: | ||
| 218 | + errors: | ||
| 219 | + messages: | ||
| 220 | + <<: *errors_messages | ||
| 221 | + template: | ||
| 222 | + <<: *errors_template | ||
| 223 | + full_messages: | ||
| 224 | + format: "%{attribute} %{message}" |
config/locales/pt.yml
| @@ -0,0 +1,233 @@ | @@ -0,0 +1,233 @@ | ||
| 1 | +# encoding: UTF-8 | ||
| 2 | +# pt-BR translations for Ruby on Rails | ||
| 3 | +"pt": | ||
| 4 | + # formatos de data e hora | ||
| 5 | + date: | ||
| 6 | + formats: | ||
| 7 | + default: "%d/%m/%Y" | ||
| 8 | + short: "%d de %B" | ||
| 9 | + long: "%d de %B de %Y" | ||
| 10 | + | ||
| 11 | + day_names: | ||
| 12 | + - Domingo | ||
| 13 | + - Segunda | ||
| 14 | + - Terça | ||
| 15 | + - Quarta | ||
| 16 | + - Quinta | ||
| 17 | + - Sexta | ||
| 18 | + - Sábado | ||
| 19 | + abbr_day_names: | ||
| 20 | + - Dom | ||
| 21 | + - Seg | ||
| 22 | + - Ter | ||
| 23 | + - Qua | ||
| 24 | + - Qui | ||
| 25 | + - Sex | ||
| 26 | + - Sáb | ||
| 27 | + | ||
| 28 | + month_names: | ||
| 29 | + - ~ | ||
| 30 | + - Janeiro | ||
| 31 | + - Fevereiro | ||
| 32 | + - Março | ||
| 33 | + - Abril | ||
| 34 | + - Maio | ||
| 35 | + - Junho | ||
| 36 | + - Julho | ||
| 37 | + - Agosto | ||
| 38 | + - Setembro | ||
| 39 | + - Outubro | ||
| 40 | + - Novembro | ||
| 41 | + - Dezembro | ||
| 42 | + abbr_month_names: | ||
| 43 | + - ~ | ||
| 44 | + - Jan | ||
| 45 | + - Fev | ||
| 46 | + - Mar | ||
| 47 | + - Abr | ||
| 48 | + - Mai | ||
| 49 | + - Jun | ||
| 50 | + - Jul | ||
| 51 | + - Ago | ||
| 52 | + - Set | ||
| 53 | + - Out | ||
| 54 | + - Nov | ||
| 55 | + - Dez | ||
| 56 | + order: | ||
| 57 | + - :day | ||
| 58 | + - :month | ||
| 59 | + - :year | ||
| 60 | + | ||
| 61 | + time: | ||
| 62 | + formats: | ||
| 63 | + default: "%A, %d de %B de %Y, %H:%M h" | ||
| 64 | + short: "%d/%m, %H:%M h" | ||
| 65 | + long: "%A, %d de %B de %Y, %H:%M h" | ||
| 66 | + am: '' | ||
| 67 | + pm: '' | ||
| 68 | + | ||
| 69 | + # Usado no Array.to_sentence | ||
| 70 | + support: | ||
| 71 | + array: | ||
| 72 | + words_connector: ", " | ||
| 73 | + two_words_connector: " e " | ||
| 74 | + last_word_connector: " e " | ||
| 75 | + | ||
| 76 | + select: | ||
| 77 | + prompt: "Por favor selecione" | ||
| 78 | + | ||
| 79 | + number: | ||
| 80 | + format: | ||
| 81 | + separator: ',' | ||
| 82 | + delimiter: '.' | ||
| 83 | + precision: 3 | ||
| 84 | + significant: false | ||
| 85 | + strip_insignificant_zeros: false | ||
| 86 | + | ||
| 87 | + currency: | ||
| 88 | + format: | ||
| 89 | + format: '%u %n' | ||
| 90 | + unit: 'R$' | ||
| 91 | + separator: ',' | ||
| 92 | + delimiter: '.' | ||
| 93 | + precision: 2 | ||
| 94 | + significant: false | ||
| 95 | + strip_insignificant_zeros: false | ||
| 96 | + | ||
| 97 | + percentage: | ||
| 98 | + format: | ||
| 99 | + delimiter: '.' | ||
| 100 | + | ||
| 101 | + precision: | ||
| 102 | + format: | ||
| 103 | + delimiter: '.' | ||
| 104 | + | ||
| 105 | + human: | ||
| 106 | + format: | ||
| 107 | + delimiter: '.' | ||
| 108 | + precision: 2 | ||
| 109 | + significant: true | ||
| 110 | + strip_insignificant_zeros: true | ||
| 111 | + storage_units: | ||
| 112 | + format: "%n %u" | ||
| 113 | + units: | ||
| 114 | + byte: | ||
| 115 | + one: "Byte" | ||
| 116 | + other: "Bytes" | ||
| 117 | + kb: "KB" | ||
| 118 | + mb: "MB" | ||
| 119 | + gb: "GB" | ||
| 120 | + tb: "TB" | ||
| 121 | + # number_to_human() | ||
| 122 | + # new in rails 3: please add to other locales | ||
| 123 | + decimal_units: | ||
| 124 | + format: "%n %u" | ||
| 125 | + units: | ||
| 126 | + unit: "" | ||
| 127 | + thousand: "mil" | ||
| 128 | + million: | ||
| 129 | + one: milhão | ||
| 130 | + other: milhões | ||
| 131 | + billion: | ||
| 132 | + one: bilhão | ||
| 133 | + other: bilhões | ||
| 134 | + trillion: | ||
| 135 | + one: trilhão | ||
| 136 | + other: trilhões | ||
| 137 | + quadrillion: | ||
| 138 | + one: quatrilhão | ||
| 139 | + other: quatrilhões | ||
| 140 | + | ||
| 141 | + # distancia do tempo em palavras | ||
| 142 | + datetime: | ||
| 143 | + distance_in_words: | ||
| 144 | + half_a_minute: 'meio minuto' | ||
| 145 | + less_than_x_seconds: | ||
| 146 | + one: 'menos de 1 segundo' | ||
| 147 | + other: 'menos de %{count} segundos' | ||
| 148 | + x_seconds: | ||
| 149 | + one: '1 segundo' | ||
| 150 | + other: '%{count} segundos' | ||
| 151 | + less_than_x_minutes: | ||
| 152 | + one: 'menos de um minuto' | ||
| 153 | + other: 'menos de %{count} minutos' | ||
| 154 | + x_minutes: | ||
| 155 | + one: '1 minuto' | ||
| 156 | + other: '%{count} minutos' | ||
| 157 | + about_x_hours: | ||
| 158 | + one: 'aproximadamente 1 hora' | ||
| 159 | + other: 'aproximadamente %{count} horas' | ||
| 160 | + x_days: | ||
| 161 | + one: '1 dia' | ||
| 162 | + other: '%{count} dias' | ||
| 163 | + about_x_months: | ||
| 164 | + one: 'aproximadamente 1 mês' | ||
| 165 | + other: 'aproximadamente %{count} meses' | ||
| 166 | + x_months: | ||
| 167 | + one: '1 mês' | ||
| 168 | + other: '%{count} meses' | ||
| 169 | + about_x_years: | ||
| 170 | + one: 'aproximadamente 1 ano' | ||
| 171 | + other: 'aproximadamente %{count} anos' | ||
| 172 | + over_x_years: | ||
| 173 | + one: 'mais de 1 ano' | ||
| 174 | + other: 'mais de %{count} anos' | ||
| 175 | + almost_x_years: | ||
| 176 | + one: 'quase 1 ano' | ||
| 177 | + other: 'quase %{count} anos' | ||
| 178 | + prompts: | ||
| 179 | + year: "Ano" | ||
| 180 | + month: "Mês" | ||
| 181 | + day: "Dia" | ||
| 182 | + hour: "Hora" | ||
| 183 | + minute: "Minuto" | ||
| 184 | + second: "Segundo" | ||
| 185 | + | ||
| 186 | + helpers: | ||
| 187 | + select: | ||
| 188 | + prompt: "Por favor selecione" | ||
| 189 | + | ||
| 190 | + submit: | ||
| 191 | + create: 'Criar %{model}' | ||
| 192 | + update: 'Atualizar %{model}' | ||
| 193 | + submit: 'Salvar %{model}' | ||
| 194 | + | ||
| 195 | + errors: | ||
| 196 | + format: "%{attribute} %{message}" | ||
| 197 | + messages: &errors_messages | ||
| 198 | + inclusion: "não está incluído na lista" | ||
| 199 | + exclusion: "não está disponível" | ||
| 200 | + invalid: "não é válido" | ||
| 201 | + confirmation: "não está de acordo com a confirmação" | ||
| 202 | + accepted: "deve ser aceito" | ||
| 203 | + empty: "não pode ficar vazio" | ||
| 204 | + blank: "não pode ficar em branco" | ||
| 205 | + too_long: "é muito longo (máximo: %{count} caracteres)" | ||
| 206 | + too_short: "é muito curto (mínimo: %{count} caracteres)" | ||
| 207 | + wrong_length: "não possui o tamanho esperado (%{count} caracteres)" | ||
| 208 | + not_a_number: "não é um número" | ||
| 209 | + not_an_integer: "não é um número inteiro" | ||
| 210 | + greater_than: "deve ser maior que %{count}" | ||
| 211 | + greater_than_or_equal_to: "deve ser maior ou igual a %{count}" | ||
| 212 | + equal_to: "deve ser igual a %{count}" | ||
| 213 | + less_than: "deve ser menor que %{count}" | ||
| 214 | + less_than_or_equal_to: "deve ser menor ou igual a %{count}" | ||
| 215 | + odd: "deve ser ímpar" | ||
| 216 | + even: "deve ser par" | ||
| 217 | + taken: "já está em uso" | ||
| 218 | + record_invalid: "A validação falhou: %{errors}" | ||
| 219 | + template: &errors_template | ||
| 220 | + header: | ||
| 221 | + one: "Não foi possível gravar %{model}: 1 erro" | ||
| 222 | + other: "Não foi possível gravar %{model}: %{count} erros." | ||
| 223 | + body: "Por favor, verifique o(s) seguinte(s) campo(s):" | ||
| 224 | + | ||
| 225 | + activerecord: | ||
| 226 | + errors: | ||
| 227 | + messages: | ||
| 228 | + <<: *errors_messages | ||
| 229 | + template: | ||
| 230 | + <<: *errors_template | ||
| 231 | + | ||
| 232 | + full_messages: | ||
| 233 | + format: "%{attribute} %{message}" |
test/unit/noosfero_i18n_test.rb
| @@ -2,13 +2,29 @@ require File.dirname(__FILE__) + '/../test_helper' | @@ -2,13 +2,29 @@ require File.dirname(__FILE__) + '/../test_helper' | ||
| 2 | 2 | ||
| 3 | class NoosferoI18nTest < ActiveSupport::TestCase | 3 | class NoosferoI18nTest < ActiveSupport::TestCase |
| 4 | 4 | ||
| 5 | + def setup | ||
| 6 | + @locale = I18n.locale | ||
| 7 | + end | ||
| 8 | + | ||
| 9 | + def teardown | ||
| 10 | + I18n.locale = @locale | ||
| 11 | + end | ||
| 12 | + | ||
| 5 | Noosfero.available_locales.each do |locale| | 13 | Noosfero.available_locales.each do |locale| |
| 14 | + | ||
| 6 | next if locale == 'en' | 15 | next if locale == 'en' |
| 16 | + | ||
| 7 | should('have locale file for %s' % locale) do | 17 | should('have locale file for %s' % locale) do |
| 8 | locale_file = 'config/locales/%s.yml' % locale | 18 | locale_file = 'config/locales/%s.yml' % locale |
| 9 | assert File.exists?(File.join(Rails.root, locale_file)), "#{locale_file} not found" | 19 | assert File.exists?(File.join(Rails.root, locale_file)), "#{locale_file} not found" |
| 10 | end | 20 | end |
| 11 | 21 | ||
| 22 | + should('be able to translate activerecord errors header to %s' % locale) do | ||
| 23 | + I18n.locale = locale | ||
| 24 | + translation = I18n.translate 'activerecord.errors.template.header.one' | ||
| 25 | + assert translation !~ /translation missing/, "Missing translation for activerecord.errors.template.header.one to #{Noosfero.locales[locale]}" | ||
| 26 | + end | ||
| 27 | + | ||
| 12 | end | 28 | end |
| 13 | 29 | ||
| 14 | end | 30 | end |