ROR: best practices for large translation dictionaries

  • When internationalizing a rails application, what is the best way to organize / view translations in dictionary files?
  • Under what circumstances should you use variable interpolation?
  • Should every phrase be in it?
  • Is there anyone who participated in dhh tolk who can shed light on how the 37signals split their dictionary files?

After a month and half using i18n gem, our en.yml file becomes gigantic. Is there any benefit from using the scope? We want the dictionary to be easier to translate and our dictionary to be dry, but we need to take into account different times and still use situations where we have “Are you sure you want to delete this object?”, “Are you sure you want to mark how is it completed? " Like "Are you sure you want {{verb}} {{noun}}?"

+3
source share
2 answers

Well, in our organization, we completely translated it with the default directory structures proposed by Rails

, , .

, HomeController # :

t('.title')

/home/ {locale}.yml

{locale}:
  show:
    title:

. , , ""

{locale}:
  latest:
    title:

, , , ,

+3

, t_t gem. . cheatsheet - # Actions : " , {{verb}} this { { }}?"

:

-1

Source: https://habr.com/ru/post/1764180/


All Articles