Question

I want to translate the results of the distance_of_time_in_words_to_now function to portuguese, but my archive .yml is not translating this function.

How do I resolve this problem? I tried this way, but any change doesn't affect the view:

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"
Was it helpful?

Solution

I believe you are indenting those as they should be indented? Also, it should be one: and other:, not many:

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

UPDATE:

The following works for me:

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

Note that indentation is a key here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top