Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: :en is not a valid locale #2155

Closed
nazarok opened this issue Jan 8, 2015 · 6 comments
Closed

Error: :en is not a valid locale #2155

nazarok opened this issue Jan 8, 2015 · 6 comments

Comments

@nazarok
Copy link

nazarok commented Jan 8, 2015

if I do not have in available_locales :en, I get an error:

Showing /home/user/.rvm/gems/ruby-2.2.0@project/gems/rails_admin-0.6.6/app/views/rails_admin/main/index.html.haml where line #78 raised:

:en is not a valid locale

This error occurs because the project multiple times specifying an explicit locale: :en.

@x-ji
Copy link

x-ji commented Mar 9, 2015

Although there is already a fix in RailsAdmin Troubleshooting https://github.com/sferik/rails_admin/wiki/Troubleshoot #746, it seems to be not working. After adding a line I18n.default_locale = :'zh-CN' in rails_admin.rb file, I'm still getting the same error.

@emaciek
Copy link

emaciek commented Apr 6, 2015

@x-ji I was tired of looking for some good solution so I fixed it with workaround. So go to source code of the gem file like: /home/user/.rvm/gems/ruby-2.1.5/gems/rails_admin-0.6.7/app/views/rails_admin/main/index.html.haml and change :en into suitable translation. In your case it is 'zh-CN'. And it works.

@sasselin
Copy link

Same thing for me, the fix in https://github.com/sferik/rails_admin/wiki/Troubleshoot do not work.

My site is only in french.

@sasselin
Copy link

Finally I had to overwrite the file views/main/index.html.haml and change line 78 to put :fr instead of :en.

@dalpo
Copy link
Contributor

dalpo commented Jun 22, 2015

coorasse added a commit to coorasse/rails_admin that referenced this issue Sep 2, 2015
:en locale is not always available
@nazarok
Copy link
Author

nazarok commented Feb 5, 2016

Thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants