Commit a0f633fc32531f5509cb17ced18dae2ea926de20
1 parent
a97f8e19
Exists in
master
and in
29 other branches
i18n: add countries default and change format (- instead of _)
Showing
15 changed files
with
43 additions
and
245 deletions
Show diff stats
app/controllers/application_controller.rb
| ... | ... | @@ -72,8 +72,8 @@ class ApplicationController < ActionController::Base |
| 72 | 72 | FastGettext.available_locales = environment.available_locales |
| 73 | 73 | FastGettext.default_locale = environment.default_locale |
| 74 | 74 | FastGettext.locale = (params[:lang] || session[:lang] || environment.default_locale || request.env['HTTP_ACCEPT_LANGUAGE'] || 'en') |
| 75 | - I18n.locale = FastGettext.locale | |
| 76 | - I18n.default_locale = FastGettext.default_locale | |
| 75 | + I18n.locale = FastGettext.locale.to_s.gsub '_', '-' | |
| 76 | + I18n.default_locale = FastGettext.default_locale.to_s.gsub '_', '-' | |
| 77 | 77 | if params[:lang] |
| 78 | 78 | session[:lang] = params[:lang] |
| 79 | 79 | end | ... | ... |
config/locales/de.yml
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | # contributors: |
| 4 | 4 | # - Alexander Dreher - http://github.com/alexdreher - Rails 3 update |
| 5 | 5 | |
| 6 | -de: | |
| 6 | +de: &de | |
| 7 | 7 | date: |
| 8 | 8 | formats: |
| 9 | 9 | default: "%d.%m.%Y" |
| ... | ... | @@ -221,3 +221,6 @@ de: |
| 221 | 221 | |
| 222 | 222 | full_messages: |
| 223 | 223 | format: "%{attribute} %{message}" |
| 224 | + | |
| 225 | +de-DE: | |
| 226 | + <<: *de | ... | ... |
config/locales/en-US.yml
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | # |
| 3 | 3 | # Use this as the base for the locale file of your language. |
| 4 | 4 | |
| 5 | -"en-US": | |
| 5 | +"en-US": &en-US | |
| 6 | 6 | date: |
| 7 | 7 | formats: |
| 8 | 8 | default: "%Y-%m-%d" |
| ... | ... | @@ -220,4 +220,7 @@ |
| 220 | 220 | template: |
| 221 | 221 | <<: *errors_template |
| 222 | 222 | full_messages: |
| 223 | - format: "%{attribute} %{message}" | |
| 224 | 223 | \ No newline at end of file |
| 224 | + format: "%{attribute} %{message}" | |
| 225 | + | |
| 226 | +en: | |
| 227 | + <<: *en-US | ... | ... |
config/locales/es.yml
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | # - Tsutomu Kuroda - http://github.com/kuroda (t-kuroda@oiax.jp) |
| 5 | 5 | # Corrected by Eloy Serra Labán: http://goo.gl/i9Kts, /nQ928, /XfKaX |
| 6 | 6 | |
| 7 | -"es": | |
| 7 | +es: &es | |
| 8 | 8 | date: |
| 9 | 9 | formats: |
| 10 | 10 | default: "%d/%m/%Y" |
| ... | ... | @@ -223,3 +223,6 @@ |
| 223 | 223 | |
| 224 | 224 | full_messages: |
| 225 | 225 | format: "%{attribute} %{message}" |
| 226 | + | |
| 227 | +es_ES: | |
| 228 | + <<: *es | ... | ... |
config/locales/fr.yml
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | # - Bruno Michel - http://github.com/nono |
| 6 | 6 | # - Tsutomu Kuroda - http://github.com/kuroda (t-kuroda@oiax.jp) |
| 7 | 7 | |
| 8 | -fr: | |
| 8 | +fr: &fr | |
| 9 | 9 | date: |
| 10 | 10 | formats: |
| 11 | 11 | default: "%d/%m/%Y" |
| ... | ... | @@ -222,3 +222,7 @@ fr: |
| 222 | 222 | <<: *errors_template |
| 223 | 223 | full_messages: |
| 224 | 224 | format: "%{attribute} %{message}" |
| 225 | + | |
| 226 | +fr-FR: | |
| 227 | + <<: *fr | |
| 228 | + | ... | ... |
config/locales/hr.yml
config/locales/hy.yml
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | # FIXME: This is a copy of en-US.yml. Armenian translators, please translate |
| 4 | 4 | # this into Armenian. |
| 5 | 5 | |
| 6 | -"hy": | |
| 6 | +hy: &hy | |
| 7 | 7 | date: |
| 8 | 8 | formats: |
| 9 | 9 | default: "%Y-%m-%d" |
| ... | ... | @@ -222,3 +222,6 @@ |
| 222 | 222 | <<: *errors_template |
| 223 | 223 | full_messages: |
| 224 | 224 | format: "%{attribute} %{message}" |
| 225 | + | |
| 226 | +hy-AM: | |
| 227 | + <<: *hy | ... | ... |
config/locales/it.yml
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | # - Simone Carletti (weppos@weppos.net) |
| 6 | 6 | # - Davide Guerri (d.guerri@caspur.it) |
| 7 | 7 | |
| 8 | -it: | |
| 8 | +it: &it | |
| 9 | 9 | number: |
| 10 | 10 | format: |
| 11 | 11 | delimiter: "," |
| ... | ... | @@ -234,3 +234,6 @@ it: |
| 234 | 234 | |
| 235 | 235 | full_messages: |
| 236 | 236 | format: "%{attribute} %{message}" |
| 237 | + | |
| 238 | +it_IT: | |
| 239 | + <<: *it | ... | ... |
config/locales/pt-BR.yml
config/locales/pt.yml
| ... | ... | @@ -1,233 +0,0 @@ |
| 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}" |
config/locales/ru.yml
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | # (http://github.com/yaroslav/russian). Следующие данные -- выдержка их него, чтобы |
| 11 | 11 | # была возможность минимальной локализации приложения на русский язык. |
| 12 | 12 | |
| 13 | -ru: | |
| 13 | +ru: &ru | |
| 14 | 14 | date: |
| 15 | 15 | formats: |
| 16 | 16 | default: "%d.%m.%Y" |
| ... | ... | @@ -300,3 +300,7 @@ ru: |
| 300 | 300 | words_connector: ", " |
| 301 | 301 | two_words_connector: " и " |
| 302 | 302 | last_word_connector: " и " |
| 303 | + | |
| 304 | +ru_RU: | |
| 305 | + <<: *ru | |
| 306 | + | ... | ... |