0

I have a problem to load files with I18n. Befor I had all my translations in only one file called fr.yml. But I decied to split them in some files like clubs.fr.yml, searcher.fr.yml ...

The problem it that I18n apparently only load fr.yml.

Here my code to load files :

  I18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  I18n.default_locale = :fr

and here an exemple of one of my files :

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."

I checked and it's space and no tab. Any idea ?

3 Answers3

0

Comment first line. By default all yml files will be loaded.

Also restart the server.

Danil Speransky
  • 29,891
  • 5
  • 68
  • 79
0
# config/application.rb
    . . .
    config.i18n.default_locale = :fr
    . . .

# in view
<%= t 'searcher.search' %>
itsnikolay
  • 17,415
  • 4
  • 65
  • 64
0

The problem was that I didn't restart my server ... Shame on me !!!