【发布时间】:2014-02-18 10:44:08
【问题描述】:
我在使用 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."
我检查了一下,它是空格,没有制表符。有什么想法吗?
【问题讨论】:
标签: ruby-on-rails rails-i18n i18n-gem