carmen-rails icon indicating copy to clipboard operation
carmen-rails copied to clipboard

Locale files from carmen are loaded after rails app initializes

Open Masa331 opened this issue 10 years ago • 2 comments

Hi,

we have a problem with adding custom translation to some Carmen state. We added translation to our locale file but it didn't change anything. I think the problem lies at how carmen-rails adds locale files from Carmen to rails I18n.load_path. It adds the files to config.i18n.load_path withing its Railtie and that causes the files are added to app I18n.load_path after the app locales so it rewrites any locale keys app defines.

I just wanted to check, isn't this for some intention i just can't think of right now? If not i propose to change it. I actually tried it at my fork masa331/carmen-rails. I changed the Railtie a bit and it's all good.

If it's all right should i make a pull request?

Masa331 avatar Apr 07 '14 03:04 Masa331

Hi, i tried your branch and added this to my app's config/locales/en.yml:

en:
  world:
    kr:
      official_name: "South Korea"

But I still see, 'translation missing: en.world.kr.official_name'. Do I need to configure something for my locale to be used with your fork?

kevgrig avatar Aug 22 '15 14:08 kevgrig

Try to add also common_name and name to your yaml:

en:
  world:
    kr:
      official_name: 'South Korea'
      common_name: 'South Korea'
      name: 'South Korea'

I don't know which one is the one really needed tho.. Don't have time for more investigation now :)

Masa331 avatar Aug 22 '15 19:08 Masa331