Language isn't set.
-
Glenn Nilsson
Forgot to tag it.
-
Glenn Nilsson
Also.
The log says:
features: localized_modelsBut I specified several others, and that didn't include localized_models.
It's clearly something I'm doing wrong, right? =)
-
Chris Wanstrath
- State changed from new to open
This is my fault and also Ruby's fault.
First, an example:
$ ./script/console Loading development environment. >> Gibberish.current_language => :en >> Gibberish.current_language = :de => :de >> Gibberish.current_language => :en >> Gibberish.languages => [:es] >> Gibberish.current_language = :es => :es >> Gibberish.current_language => :esAs you can see, it only 'sticks' when the current_language is recognized.
Here is the explanation: http://pastie.caboo.se/74481
Now, are you trying to set a language which does not have a LANG.yml file? If so, we can fix that. It just depends on what you're trying to do.
-
Chris Wanstrath
For posterity's sake, here is the implementation of @@@current_language=@@@ which shows the intended behavior:
def current_language=(language) load_languages! if defined?(RAILS_ENV) && RAILS_ENV == 'development' language = language.to_sym if language.respond_to? :to_sym @@current_language = @@languages[language] ? language : nil end -
Glenn Nilsson
Ok, I get an empty array back when trying:
Gibberish.languagesAnd in RAILS_ROOT/languages there's 2 language-files. de.yml and en.yml, and en.yml is copied from the langs-dir within the plugin.
So the empty array surely explains why I can't set the language.
:lang_file_dir => File.expand_path("#{RAILS_ROOT}/languages")and the fact that there are two files in there should be enough right?
-
Chris Wanstrath
- State changed from open to invalid
I don't think there is any :lang_file_dir directive. Instead, Gibberish always looks in RAILS_ROOT/lang/*.yml for your language files. Feel free to submit a patch if you want this behavior changed, though.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.