This is a shameless announcement of my new project Multilingual Rails. I just made the first release, v0.2. This is work in progress but it''s very useful already. It aims to be THE framework for creating multilingual applications in Ruby on Rails. Features: * Translation files are simple ruby-scripts with helper methods making them clean. * Pluggable easy-to-implement translators if you want to use some other scheme. * Localized messages from ActiveRecord validations. * New country_select that use ISO 3166 numeric codes instead of hardcoded strings and has more features. * Easy to translate any string anywhere. * Have multiple translations of your templates and partials. Multilingual Rails will automatically load the correct one. * Flexible logging of translation-misses. Can have different logfiles for different locales. * Localized internal Rails-helpers, including date-selectors and distance_of_time_in_words. * Conversion between all ISO 3166 formats (numeric, alpha-2, alpha-3) and between ISO 639-1 and 639-2 codes. * Localized Time-class thanks to ruby-locale. * More... TODO: * Languages helper functions using ISO 639-1 tables. * Currency-display helper functions. * More languages in the default distribution. Help needed, I only know Swedish and English. :) * Package as gem. * More... Known bugs: * country_select doesn''t work in v0.2. It will be fixed in v0.3, due soon. Help wanted: * Translators, translators, translators, translators... :) Documentation and download at the (preliminary) homepage: http://www.tuxsoft.se/oss/rails/multilingual I hope you all will find this project useful! // Per
I think one of the most attractive parts of the gettext-like implementations is the string harvester. Are there any plans to implement that? Joshua On 8/8/05, Per Wigren <per.wigren-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > This is a shameless announcement of my new project Multilingual > Rails. I just made the first release, v0.2. > This is work in progress but it''s very useful already. > > It aims to be THE framework for creating multilingual applications in > Ruby on Rails. > > Features: > * Translation files are simple ruby-scripts with helper methods > making them clean. > * Pluggable easy-to-implement translators if you want to use some > other scheme. > * Localized messages from ActiveRecord validations. > * New country_select that use ISO 3166 numeric codes instead of > hardcoded strings and has more features. > * Easy to translate any string anywhere. > * Have multiple translations of your templates and partials. > Multilingual Rails will automatically load the correct one. > * Flexible logging of translation-misses. Can have different > logfiles for different locales. > * Localized internal Rails-helpers, including date-selectors and > distance_of_time_in_words. > * Conversion between all ISO 3166 formats (numeric, alpha-2, > alpha-3) and between ISO 639-1 and 639-2 codes. > * Localized Time-class thanks to ruby-locale. > * More... > > TODO: > * Languages helper functions using ISO 639-1 tables. > * Currency-display helper functions. > * More languages in the default distribution. Help needed, I only > know Swedish and English. :) > * Package as gem. > * More... > > Known bugs: > * country_select doesn''t work in v0.2. It will be fixed in v0.3, > due soon. > > Help wanted: > * Translators, translators, translators, translators... :) > > Documentation and download at the (preliminary) homepage: > http://www.tuxsoft.se/oss/rails/multilingual > > I hope you all will find this project useful! > > // Per > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Yes, a string harvester will be implemented before v1.0. // Per 8 aug 2005 kl. 11.56 skrev Joshua Sierles:> I think one of the most attractive parts of the gettext-like > implementations is the string harvester. Are there any plans to > implement that? > > Joshua > > On 8/8/05, Per Wigren <per.wigren-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: This is a > shameless announcement of my new project Multilingual > Rails. I just made the first release, v0.2. > This is work in progress but it''s very useful already. > > It aims to be THE framework for creating multilingual applications in > Ruby on Rails. > > Features: > * Translation files are simple ruby-scripts with helper methods > making them clean. > * Pluggable easy-to-implement translators if you want to use some > other scheme. > * Localized messages from ActiveRecord validations. > * New country_select that use ISO 3166 numeric codes instead of > hardcoded strings and has more features. > * Easy to translate any string anywhere. > * Have multiple translations of your templates and partials. > Multilingual Rails will automatically load the correct one. > * Flexible logging of translation-misses. Can have different > logfiles for different locales. > * Localized internal Rails-helpers, including date-selectors and > distance_of_time_in_words. > * Conversion between all ISO 3166 formats (numeric, alpha-2, > alpha-3) and between ISO 639-1 and 639-2 codes. > * Localized Time-class thanks to ruby-locale. > * More... > > TODO: > * Languages helper functions using ISO 639-1 tables. > * Currency-display helper functions. > * More languages in the default distribution. Help needed, I only > know Swedish and English. :) > * Package as gem. > * More... > > Known bugs: > * country_select doesn''t work in v0.2. It will be fixed in v0.3, > due soon. > > Help wanted: > * Translators, translators, translators, translators... :) > > Documentation and download at the (preliminary) homepage: > http://www.tuxsoft.se/oss/rails/multilingual > > I hope you all will find this project useful! > > // Per > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Mvh Tuxie, Dekadance http://www.dekadance.se
Per Wigren wrote:> This is a shameless announcement of my new project Multilingual Rails. > I just made the first release, v0.2. > This is work in progress but it''s very useful already. > > It aims to be THE framework for creating multilingual applications in > Ruby on Rails.Nice. Finally some competition. I wonder. What were the reasons for you not to chose ri18n[1] and go from there? This is what I am doing at the moment. It already addresses some of the major hurdles for translation like pluralization and interpolation. You also have some attractive features in your package. I think I would ultimately like to have both sets of features ;) In any way, it would be great to have the ONE solution for localization of Rails apps. I think some coordination between the different projects would be cool. Sascha Ebach [1] http://ri18n.berlios.de/
First of all I didn''t know about ri18n when I started this, otherwise maybe I would had built on top of ri18n instead. Second, I don''t think that the GPL is a fitting license for a project like this. Basically that means that I have to release all my apps under the GPL if I want to make them multilingual which is not acceptable. I''ll go with LGPL or BSD/X11 for Multilingual Rails. I like (and use) the GPL for applications but it''s not good for libraries and frameworks IMHO. I like your pluralization stuff, it''s pretty clever... I hope you change the license to LGPL or BSD so I can use it :) Feel free to use any of my code in ri18n. :) For interpolation I prefer the %[]-way but if there is demand I can add methods for it. As for charset conversion I still prefer UTF-8 everywhere internally (database, templates, code) but I''ll probably add #to_utf8 and #to_kcode methods to the String class to make this easier. Multilingual Rails also doesn''t even try to be generic, it''s meant to be used for making Rails apps multilingual, nothing more. At least until v1.0. // Per Wigren 8 aug 2005 kl. 14.39 skrev Sascha Ebach:> Per Wigren wrote: > >> This is a shameless announcement of my new project Multilingual >> Rails. I just made the first release, v0.2. >> This is work in progress but it''s very useful already. >> It aims to be THE framework for creating multilingual applications >> in Ruby on Rails. >> > > Nice. Finally some competition. I wonder. What were the reasons for > you not to chose ri18n[1] and go from there? > > This is what I am doing at the moment. It already addresses some of > the major hurdles for translation like pluralization and > interpolation. You also have some attractive features in your > package. I think I would ultimately like to have both sets of > features ;) > > In any way, it would be great to have the ONE solution for > localization of Rails apps. I think some coordination between the > different projects would be cool. > > Sascha Ebach > > [1] http://ri18n.berlios.de/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Mvh Tuxie, Dekadance http://www.dekadance.se
Per Wigren wrote:> First of all I didn''t know about ri18n when I started this, otherwise > maybe I would had built on top of ri18n instead.Yeah, that''s what Google is for ;) There are already a couple of projects ou there.> Second, I don''t think that the GPL is a fitting license for a project > like this. Basically that means that I have to release all my apps > under the GPL if I want to make them multilingual which is not > acceptable. I''ll go with LGPL or BSD/X11 for Multilingual Rails. I like > (and use) the GPL for applications but it''s not good for libraries and > frameworks IMHO. > I like your pluralization stuff, it''s pretty clever... I hope you > change the license to LGPL or BSD so I can use it :) Feel free to use > any of my code in ri18n. :)You are right. But I am not the author. I will ask him to change it though whenever I hear something from him. He might be on vacation or so.> For interpolation I prefer the %[]-way but if there is demand I can add > methods for it.Can you explain what the benefits are?> As for charset conversion I still prefer UTF-8 everywhere internally > (database, templates, code) but I''ll probably add #to_utf8 and > #to_kcode methods to the String class to make this easier.I think that is a wise decision.> Multilingual Rails also doesn''t even try to be generic, it''s meant to > be used for making Rails apps multilingual, nothing more. At least > until v1.0.Good plan. Hopefully these projects can merge in the future or at least benefit greatly from each other. Sascha Ebach
8 aug 2005 kl. 17.32 skrev Sascha Ebach:> Yeah, that''s what Google is for ;) There are already a couple of > projects ou there.I looked at the Rails wiki and RAA some time ago but everything I found was either to incomplete or tried to do too much and/or wasn''t "Railish" enough for my taste (convention over configuration). I haven''t looked deeply enough at ri18n to have an opinion about it yet.>> For interpolation I prefer the %[]-way but if there is demand I >> can add methods for it. > > Can you explain what the benefits are?I just think that it looks cleaner to separate it, especially as I like to use symbols instead of strings inside the templates, like <% = :frontpage_greeting.t % [@user.name] %> instead of <%= "Welcome, # {@user.name}!".t %> Using that convention you don''t risk reusing strings in improper places. Thinking about it I can even add the %- method to the Symbol class directly because Symbols don''t have that method. That would make it possible to write <%= :frontpage_greeting % [@user.name] %> instead. :)>> Multilingual Rails also doesn''t even try to be generic, it''s meant >> to be used for making Rails apps multilingual, nothing more. At >> least until v1.0. > > Good plan. Hopefully these projects can merge in the future or at > least benefit greatly from each other.I''m sure they will! As long as they are license-compatible... Due to the design of Multilingual Rails it will be easy for someone to write a translator that reads gettext .po-files instead of the default ruby-files. Just subclass AbstractTranslator and add the single one method load_locale_data(locale) (which fills the @locales array with data) and everything else will be transparent. Hopefully someone will contribute that code in the near future. // Per