私はこれまで英語以外を翻訳したことがなかったので、誰かがこれを調べてくれることを期待していたので、文法上の矛盾があるかどうかわからない.
私は持っている:
en:
articles:
name: "Articles"
comments:
name: "Comments"
# things
no_results: "There are no %{things}"
my: "My %{things}"
次に、ビューファイルで、たとえば次のようにします。
#title= t('articles.name')
%ul
%li= link_to t('my', things: t('articles.name')), articles_path(user)
.no_results= t('no_results', things: t('comments.name').downcase)
私がやろうとしているのは、翻訳を DRY することですが、メソッドを使用して混乱することもありません。
- 複数形にする
- 特異化する
- 小文字
- 大文字にする
テキストで使用されるモデルの最も一般的な形式は、大文字と複数形のようです。そのため、「Articles」と「Article」または「article」を選択しました。ビューファイルと次のような方法で上記の方法を優先しますか?
articles:
one: "Article"
other: "Articles"
..この混乱に発展する可能性があります:
articles:
one: "Article"
other: "Articles"
one_l: "article"
other_l: "articles"