我在使用 I18n 加载文件时遇到问题。之前我将所有的翻译都放在一个名为 fr.yml 的文件中。但我决定将它们拆分成一些文件,例如 clubs.fr.yml、searcher.fr.yml ...
I18n 显然只加载 fr.yml 的问题。
这是我加载文件的代码:
I18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
I18n.default_locale = :fr
这里是我的一个文件的一个例子:
fr:
searcher:
search: "Rechercher..."
title: "Recherche sur :"
clubs:
title: "Liste des Clubs"
name: "Nom du club"
description: "Description"
show: "Voir"
no_result: "Aucun clubs n'a été trouvé pour cette recherche."
我检查了它的空间,没有标签。任何想法 ?