Project

General

Profile

Loading a locale file

Added by Tobias Scherf about 6 years ago

I've followed the instructions on the wiki for redmine to create and load a separate locale file to add a language:
http://www.redmine.org/projects/redmine/wiki/HowTo_translate_Redmine_in_your_own_language

Ultimately, I am trying to use the locale file to tweak some UI terminology without destroying the English language settings / en.yml locale file.
I chose wa.yml for Walloon which I expect is not a likely candidate to be added to redmine by others.

I ran all rake commands on above site and there don't seem to be any issues parsing the newly added language file.

After loading the page, I don't see my language file added. I did notice in the article that it implies that the language set had to be submitted to the redmine developer community as a bug and would then be added. Since it is not a real language file, this makes no sense, but I am wondering if there is a special setting that needs to be added in one of the configuration files to enable the language in redmine?

Any help would be appreciated.


Replies (4)

RE: Loading a locale file - Added by Mischa The Evil about 6 years ago

Just some thoughts here:
  • did you change line 1 in your wa.yml file to read wa:?
  • did you change line 142 in your wa.yml file to read general_lang_name: 'Walloon'?
  • did you clear the application cache (rake tmp:cache:clear)?
  • did you restart Redmine?

I did notice in the article that it implies that the language set had to be submitted to the redmine developer community as a bug and would then be added. Since it is not a real language file, this makes no sense [...]

You are right. That implication is only true if it is a real language that should be added to the Redmine source; which is not the case in your example.

[...] but I am wondering if there is a special setting that needs to be added in one of the configuration files to enable the language in redmine?

Nope, it should just work.

Btw: another way of accomplishing what you want would be to create a new plugin, add a new en.yml file to it (assuming you want to change the English strings) and overwrite the keys from the core's en.yml that you want to modify with your own values.

RE: Loading a locale file - Added by Mischa The Evil about 6 years ago

I just tested this on source:/branches/3.4-stable@17205 with the below steps and wasn't able to reproduce your issue. Make sure you clear the application cache after adding the new file.


Reproduction steps:

  1. copied en.yml to a new wa.yml;
  2. modified line 1 to
    wa:
  3. modified line 142 to
      general_lang_name: 'Walloon'
  4. modified line 604 to
      label_home: Homer
  5. cleared the application cache using rake tmp:cache:clear;
  6. restarted Redmine using rails s;
  7. navigated to Redmine location in browser, went to the 'My account page' and selected the new 'Walloon' language, and saved the settings;
  8. now I was greeted, by ... ;) Well, you'll get the picture...

Ref.: new local .yml file not picked up by the user interface.

RE: Loading a locale file - Added by Tobias Scherf about 6 years ago

These last instructions worked Micha. I wonder if it had to do with the rails s; command.
I don't think that instruction is in the wiki instructions in redmine. Now it is showing Walloon just fine.

Thank you so much.

Toby

RE: Loading a locale file - Added by Mischa The Evil about 6 years ago

Tobias Scherf wrote:

I wonder if it had to do with the rails s; command.

Well, it's just a way of restarting the Redmine application. In case you're using other application- and/or web servers, the steps to restart the Redmine application may/will differ. So it all depends on the way you've deployed your Redmine instance.
This btw might hold true for the process of clearing the application cache too.

Tobias Scherf wrote:

I don't think that instruction is in the wiki instructions in redmine

Indeed, probably because of the reason mentioned above. Though, it would be good if 'restart Redmine' would be mentioned as a separate step. But only in case it is actually required, of which I'm not 100% sure right now. It could be that these language additions are (supposed to be) picked-up, and re-cached, automatically all on-the-fly. So, before I'd add such a new step to the document, I'd have to have a better look at the code first...

    (1-4/4)