davec / localized_language_select Goto Github PK
View Code? Open in Web Editor NEWRails plugin for providing a localized "language_select" helper
License: MIT License
Rails plugin for providing a localized "language_select" helper
License: MIT License
rails 3.1. Getting error message, 'undefined method `language' for #User:0x0000010292bd48'. Also rails cant find the localized_language_select:locales. Localized_language_select:import works fine however. Not sure why this does not work while localized_country_select works just fine
Since commit 7bbc4f4, the option values in the HTML generated by localized_language_select are upper-cased. Why is that? It results in values such as "EN-GB", which later doesn't correspond to the values in locales ("en-GB").
I was attempting to use <%= I18n.t user_language.languageCode, :scope => 'languages' %> in my application to convert 'en-US' to 'U.S. English'. Doing so resulted in an error that read 'translation missing: en, languages, en-us'.
Upon further investigation, I noticed that the value stored in my database was actually 'en-us', not 'en-US'.
This led me to look at the SELECT tag in my HTML page. For U.S. English, the HTML read 'U.S. English'.
Next I looked at the 'en.rb' file. In there, the U.S. English entry reads '"en-US" => "U.S. English"'.
Changing this line:
I18n.translate(:languages).map { |key, value| [value, key.to_s.downcase] }.sort
to:
I18n.translate(:languages).map { |key, value| [value, key.to_s] }.sort
in the localized_language_select.rb seems to have addressed the issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.