1

我想将distance_of_time_in_words_to_now函数的结果翻译成葡萄牙语,但我的存档 .yml 没有翻译这个函数。

我该如何解决这个问题?我尝试过这种方式,但任何更改都不会影响视图:

en:
by: 'por'

cause:
 comments: 'Comentários'
 about: 'Sobre a causa:'

helpers:
 page-header:
  new: 'Novo %{resource}'
  edit: 'Editando %{resource}'
  list: 'Listando %{collection}'
  cause:
    list: 'Causas'

actions:
  new: 'Novo %{resource}'
  edit: 'Editar'
  show: 'Mostrar'
  destroy: 'Apagar'
  confirm_destroy: 'Você tem certeza?'

  cause:
    login: 'Entrar'
    new: 'Faça algo acontecer'
    show: 'Ver Causa'
    like: 'Apoiar esta causa'
    dislike: 'Não apoiar esta causa'
    undo: 'Retirar meu voto'
    commenting: 'Enviando comentário...'

submit:
  comment:
    create: 'Comentar'

    submit:
      cause:
        create: 'Criar Causa'

activerecord:
  models:
    cause: 'Causa'

attributes:
  cause:
    title: 'Título'

datetime:
  distance_in_words:
    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 minuto"
        other: "{{count}} minutos"

    about_x_hours:
        one:  "cerca de 1 hora"
        other: "cerca {{count}} horas"

    x_days:
        one:  "1 dia"
        other: "%{count} dias"

    about_x_months:
        one:  "about 1 month"
        other: "about {{count}} months"

    x_months:
        one:  "1 month"
        other: "{{count}} meses"

    about_x_years:
        one:  "about 1 year"
        other: "about {{count}} years"

    over_x_years:
        one:  "over 1 year"
        other: "over {{count}} years"
4

1 回答 1

0

我相信您正在缩进那些应该缩进的内容?此外,它应该是one:and other:,而不是many:

x_days:
  one:  "1 dias"
  other: "%{count} dias"

更新:

以下对我有用:

en:
  hello: "Hello world"              # irrelevant
  datetime:
    distance_in_words:
      x_days:
        one: "1 dias"
        other: "%{count} dias"

请注意,缩进是这里的关键。

于 2013-10-03T14:10:46.163 回答