Browse files

updated README with install and better usage instructions and convert…

…ed into textile format
  • Loading branch information...
1 parent 7bbc4f4 commit d7887300eae72c65ce518550603942f56e5afbc4 @kristianmandrup kristianmandrup committed Jan 14, 2011
Showing with 69 additions and 37 deletions.
  1. +0 −37 README.rdoc
  2. +69 −0 README.textile
View
37 README.rdoc
@@ -1,37 +0,0 @@
-= LocalizedLanguageSelect
-
-Rails plugin to provide support for localized <tt><select></tt> menu with language names and for
-storing language information as language _code_ (eg. 'sv'), not _name_ (eg. 'Swedish'), in the database.
-
-Uses the Rails internationalization framework (I18n, http://rails-i18n.org) for translating the names of languages.
-Requires Rails 2.2 (released November 21st, 2008) or later versions.
-Language names are loaded from hashes in plugin directory, according to <tt>I18n.locale</tt> value.
-
-You can easily translate language codes in your application like this:
-
- <%= I18n.t @user.language, :scope => 'languages' %>
-
-Comes with a Rake task <tt>rake import:language_select locale=de</tt> for importing language names
-from Unicode.org's CLDR repository (http://www.unicode.org/cldr/data/charts/summary/root.html)
-Don't forget to restart the application when you add new locale.
-
-The code borrows heavily from the LocalizedCountrySelect plugin.
-See http://github.com/karmi/localized_country_select
-
-== Example
-
- <%= localized_language_select(:user, :language, [], :include_blank => 'Please choose...') %>
-
-will become:
-
- <select name="user[language]" id="user_language">
- <option value="">Please choose...</option>
- <option disabled="disabled" value="">-------------</option>
- <option value="aa">Afar</option>
- ...
- <option value="zza">ZaZa</option>
- </select>
-
-for the <tt>en</tt> locale.
-
-Copyright (c) 2009 David Cato, released under the MIT license
View
69 README.textile
@@ -0,0 +1,69 @@
+h1. LocalizedLanguageSelect
+
+Rails plugin to provide support for localized <tt><select></tt> menu with language names and for
+storing language information as language _code_ (eg. 'sv'), not _name_ (eg. 'Swedish'), in the database.
+
+Uses the Rails internationalization framework ("I18n":http://rails-i18n.org) for translating the names of languages.
+Requires Rails 2.2 (released November 21st, 2008) or later versions.
+
+Language names are loaded from hashes in plugin directory, according to <tt>I18n.locale</tt> value.
+
+You can easily translate language codes in your application like this:
+
+<pre>
+ <%= I18n.t @user.language, :scope => 'languages' %>
+</pre>
+
+Comes with a Rake task <tt>rake import:language_select locale=de</tt> for importing language names
+from Unicode.org's CLDR repository (http://www.unicode.org/cldr/data/charts/summary/root.html)
+Don't forget to restart the application when you add new locale.
+
+The code borrows heavily from the LocalizedCountrySelect plugin.
+See "localized_country_select":http://github.com/karmi/localized_country_select
+
+h2. Install & Usage
+
+<pre>https://github.com/davec/localized_language_select.git</pre>
+
+h2. Example
+
+<pre>
+ <%= localized_language_select(:user, :language, [], :include_blank => 'Please choose...') %>
+</pre>
+
+
+will become:
+
+<pre>
+ <select name="user[language]" id="user_language">
+ <option value="">Please choose...</option>
+ <option disabled="disabled" value="">-------------</option>
+ <option value="aa">Afar</option>
+ ...
+ <option value="zza">ZaZa</option>
+ </select>
+</pre>
+
+for the <tt>en</tt> locale.
+
+== Options
+
+@:exclude@ option
+
+<pre>
+ <%= localized_language_select(:user, :language, ['English'], :include_blank => 'Please choose...', :exclude => ['Afrikaans']) %>
+</pre>
+
+@:only@ option
+
+<pre>
+ <%= localized_language_select(:user, :language, ['English'], :include_blank => 'Please choose...', :only => ['German', 'French']) %>
+</pre>
+
+== Framework usage
+
+This plugin should also integrate nicely with various formbuilders, including Formtastic
+
+== Copyright
+
+Copyright (c) 2009 David Cato, released under the MIT license

0 comments on commit d788730

Please sign in to comment.