158 lines
7.5 KiB
Text
Executable file
158 lines
7.5 KiB
Text
Executable file
= Localization Simplified (aka LocalizationSimplified or L10n-simplified)
|
|
|
|
Localization Simplified plugin for Ruby on Rails. Really simple localization. Written by Jesper Rønn-Jensen ( http://justaddwater.dk/ )
|
|
|
|
The goal is to have a dead simple plugin for one-language (non-english) Rails
|
|
applications. Many of the existing localization / internationalization plugins are
|
|
too big for this and hard to get started with. Just dump this plugin in
|
|
/vendor/plugins/, set your language and off you go.
|
|
|
|
Unlike the more advanced plugins, you don't have to translate anything in your
|
|
view files. Just use the standard Rails commands you're used to.
|
|
|
|
The simple approach also makes limits. Make sure you understand them to decide if
|
|
this plugin is right for you.
|
|
|
|
I use this plugin when creating new projects. Then later in the development
|
|
process I can decide to change to a more advanced localization plugin (if necessary)
|
|
|
|
=== What it does
|
|
This plugin modifies the following most used helpers for Rails
|
|
* Sets UTF-8 connection to database (known to work with MySQL and PostgreSQL)
|
|
* Localized monthnames on date_select etc. (changing the order of Y-M-D, on date_select and datetime_select from 0.7)
|
|
* Localized ActiveRecord errors (and error headings)
|
|
* Localized distance_of_time_in_words
|
|
* Localized to_currency (from 0.7 also changing the order of unit/currency)
|
|
* Simple pluralization also available in the lang-file
|
|
* Uses standard Rails methods. In this way, there is no tedious rewrite required
|
|
to localize your view files
|
|
|
|
|
|
=== Limitations
|
|
* More advanced features are not likely to be available here.
|
|
* If you want support for multiple languages, use another L10N/I18n plugin, like
|
|
GLoc or Globalize
|
|
It could be a good idea to take a look at the [comparison chart](http://wiki.rubyonrails.org/rails/pages/InternationalizationComparison) on the Ruby on Rails wiki
|
|
|
|
=== Version notes
|
|
* For Rails 1.1.x or below, use version 0.7.1 of this plugin
|
|
* For Rails 1.2 or above, use version 0.8 (or higher) of this plugin
|
|
|
|
=== Supported languages
|
|
Curr ently supported languages:
|
|
* English (for running test cases and comparing to normal texts)
|
|
* German
|
|
* Spanish
|
|
* Spanish (argentinian)
|
|
* French
|
|
* Dutch
|
|
* Italian
|
|
* Danish
|
|
* Swedish
|
|
* Finnish
|
|
* Canadian French
|
|
* Korean
|
|
* Swedish Chef, and Pirate talk (just for the fun of it)
|
|
* any other language you want. Just dump your translation in the /lib folder
|
|
|
|
=== Download code
|
|
* Project homepage: http://rubyforge.org/projects/l10n-simplified/
|
|
* Subversion access: svn checkout svn://rubyforge.org/var/svn/l10n-simplified
|
|
* Browse: http://rubyforge.org/plugins/scmsvn/viewcvs.php/?root=l10n-simplified
|
|
|
|
|
|
|
|
=== Usage:
|
|
in init.rb, set your language. That's it. Now your db connection is running UTF-8 and standard Rails output is localized.
|
|
|
|
If your view files contains text containing non-English characters (such as ß,ö,ñ or å), you probably also want to save your files as UTF-8.
|
|
|
|
|
|
=== Installation:
|
|
|
|
1. Just copy this plugin into your /vendor/plugins/ folder
|
|
2. Choose your lang-file in init.rb (default is Danish because I am Danish)
|
|
3. no step three :)
|
|
|
|
|
|
A special note of WARNING: All files here are saved using UTF-8 encoding.
|
|
It's not required for working, I guess, but other encodings could bring you in trouble.
|
|
|
|
=== Your help
|
|
Feel free to use, translate, modify and improve this code.
|
|
Do send me translations, improvements, etc. I cannot promise to use it,
|
|
but chances are that I will unless it bloats the code here completely or makes
|
|
code harder to maintain.
|
|
|
|
I added FIXME notes in the code to indicate where I also could use help.
|
|
|
|
=== TODO / wishlist
|
|
* A Rails application for testing L10n-simplified. This is top of my wish-list.
|
|
I'd like it to contain a test suite testing ActiveRecord errors, datehelper, necessary
|
|
numberhelper etc.
|
|
* Rake task to create a release
|
|
* Better tests to verify both hooks in Rails and this plugin
|
|
* Better tests to verify each lang-file
|
|
* Create rdoc in UTF-8 format and not including every lang-file (only lang_en.rb)
|
|
* Rake task that modifies all view-files and converts them to UTF-8
|
|
* Also a task that modifies all generators to use UTF-8
|
|
|
|
=== DONE
|
|
* --- release 0.8 ---
|
|
* Works with Rails 1.2 (not working with earlier versions)
|
|
* Whitespace/formatting modifications. Removed commented code not needed
|
|
* Removed code from plugin because Rails 1.2 date_select and datetime_select
|
|
now support :order
|
|
* ActiveRecord hooks updated for Rails 1.2 (thanks Casper Fabricius)
|
|
* Dots after day number in time formats (Danish), to keep it consistent with Date formats
|
|
* --- release 0.7.1 ---
|
|
* Fixed RJS bug where javascript content-header was overwritten with text/html (thanks Jakob Skjerning)
|
|
* Small language corrections by Wijnand Wiersma
|
|
* PostGres friendly: Added quotes around ActiveRecord::Base.connection.execute "SET NAMES 'UTF8'" (thanks Wijnand Wiersma)
|
|
* German language errors corrected by Matthias Tarasiewicz
|
|
* Added "no step three" in installation section :)
|
|
* --- release 0.7 ---
|
|
* Fixed messed-up ø's and a few wording changes in README
|
|
* Override +number_to_currency+ and +datetime_select+ to support :order
|
|
even though I prefer these changes to go into Rails Core (2006-10-10)
|
|
* Added italian lang file (thanks Michele Franzin) (2006-10-08)
|
|
* Added argentinian flavoured Spanish lang File + corrected bug in lang_es (thanks Damian Janowski) (2006-10-03)
|
|
* German translation issues (thanks Christian W. Zuckschwerdt) (2006-10-03)
|
|
* Fixed typo in README File (thanks Diego Algorta Casamayou) (2006-10-02)
|
|
* Bugfix removed incorrect 'then' after 'else' (thanks Michele Franzin)(2006-09-16)
|
|
* Added augmented and corrected distance_of_time_in_words from Rails trunk (2006-09-07)
|
|
* Added date_select and datetime_select on the helper page (2006-09-07)
|
|
* Updated dutch date-time formats, thanks Jeroen Houben (2006-09-07)
|
|
* --- release 0.6.1 ---
|
|
* Added comments in all lang-files, thanks Jarkko Laine for the idea (2006-09-07)
|
|
* Bugfix: Replaced hardcoded string in distance_of_time_in_words when :include_seconds was false (2006-08-30)
|
|
* Added Canadian French translation (thanks Daniel) (2006-08-25)
|
|
* Added comments in lang-file for documentation of how to localize (2006-08-25)
|
|
* Added French translation (thanks Fred Cavazza) (2006-08-25)
|
|
* Added Finnish translation (thanks Jarkko Laine) (2006-08-25)
|
|
* Bugfix re-added HTTP header for UTF-8. Necessary for some lang-files (2004-08-24)
|
|
* --- release 0.6 ---
|
|
* Renamed test files to make rake test command work (2006-08-23)
|
|
* Localized time "Wed Aug 23 12:38:22 Romance Daylight Time 2006" =>
|
|
"onsdag d. 23 august 2006 12:38:22" (Danish)
|
|
* Reordering of date_select fields (2006-08-23)
|
|
* Test that plugin works with the Rails version it is installed next to (2006-08-20)
|
|
* Added Dutch translation lang_nl.rb, thanks to Jeroen Houben (2006-08-20)
|
|
* Added Pirate language lang_pirate.rb, thanks to Tobias Michaelsen (2006-08-18)
|
|
* Added Date and Time#to_formatted_s with locale specific strings (2006-08-18)
|
|
* Added MIT-license, copied from Ruby on Rails (2006-08-13)
|
|
* Added tests for plugin (2006-08-13)
|
|
* Localized version of Array.to_sentence (2006-08-09)
|
|
* Added test scaffold (2006-08-09)
|
|
* Added swedish language, thanks to Olle Jonsson (2006-08-09)
|
|
* Localized version of to_currency helper (2006-08-07)
|
|
|
|
|
|
=== Credits
|
|
This plugin uses a few bits and pieces from other Rails plugins GLoc (http://rubyforge.org/projects/gloc/) and swe_rails (http://opensource.ki.se/swe_rails.html)
|
|
|
|
|
|
Created 2006-07-28 by
|
|
Jesper Rønn-Jensen http://justaddwater.dk/
|
|
http://rubyforge.org/projects/l10n-simplified/
|
|
http://agilewebdevelopment.com/plugins/localization_simplified
|