Git Product home page Git Product logo

localized_language_select's People

Contributors

davec avatar kristianmandrup avatar oneiros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

localized_language_select's Issues

Languages in option value in upper case

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").

undefined method `language'

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

downcasing issue

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.