From pic at superfluo.org Sun Oct 1 05:49:11 2006 From: pic at superfluo.org (Nicola Piccinini) Date: Sun, 01 Oct 2006 11:49:11 +0200 Subject: [Rails I18n] Are id-based keys possible with Globalize? In-Reply-To: <4825c370fa8bcc95d871927dbe02e633@ruby-forum.com> References: <4825c370fa8bcc95d871927dbe02e633@ruby-forum.com> Message-ID: <451F8F17.50102@superfluo.org> Daniel Sa wrote: > Is my understanding correct that Globalize use the base language string > as the key when looking up translations? No, model translations use table name, object_id and column name so you shouldn't have any of the problems you describe. View translations are actually key based. Best regards -- Nicola Piccinini -- http://superfluo.org From registrera at gmail.com Mon Oct 2 09:31:02 2006 From: registrera at gmail.com (Daniel Sa) Date: Mon, 2 Oct 2006 15:31:02 +0200 Subject: [Rails I18n] Are id-based keys possible with Globalize? In-Reply-To: <451F8F17.50102@superfluo.org> References: <4825c370fa8bcc95d871927dbe02e633@ruby-forum.com> <451F8F17.50102@superfluo.org> Message-ID: <12debee5ae8fa56e2b21b7298fab97e8@ruby-forum.com> Nicola Piccinini wrote: > No, model translations use table name, object_id and column name so you > shouldn't have any of the problems you describe. > > View translations are actually key based. Great! And thanks! Believing my assumption was right (from what I read on "how it works" in the wiki) I never really tried it out. Now I have wasted your time instead of mine. My apologises! /Daniel -- Posted via http://www.ruby-forum.com/. From pic at superfluo.org Mon Oct 2 17:04:07 2006 From: pic at superfluo.org (Nicola Piccinini) Date: Mon, 02 Oct 2006 23:04:07 +0200 Subject: [Rails I18n] Are id-based keys possible with Globalize? In-Reply-To: <12debee5ae8fa56e2b21b7298fab97e8@ruby-forum.com> References: <4825c370fa8bcc95d871927dbe02e633@ruby-forum.com> <451F8F17.50102@superfluo.org> <12debee5ae8fa56e2b21b7298fab97e8@ruby-forum.com> Message-ID: <45217EC7.1030606@superfluo.org> > Now I have wasted your time > instead of mine. Don't worry, no waste of time for me :-) Bye -- Nicola Piccinini -- http://superfluo.org From web at schmitz.be Tue Oct 3 04:12:25 2006 From: web at schmitz.be (=?utf-8?Q?Nicolas_No=c3=a9?=) Date: Tue, 3 Oct 2006 10:12:25 +0200 Subject: [Rails I18n] Globalize and model error messages Message-ID: <06a23756c1871edda85a70dba2eb4133@ruby-forum.com> Hi ! I have a probably stupid question about i18n. I started to work with ruby-gettext, as it allows me to translate field names in model validation messages, and thus use error_messages_for helpers. It first worked well, but I now have some problems with it (when trying to internationalize a hierarchy of models, with some attributes wich doesn't exists in the database). Gettext is nice, but seems to me more like a 'unix' solution than a rails solution, so I'm open to change... My question is here : a lot of people seems to use globalize or other i18n plugins that, if I believe what I read, don't support translating models field names, table names, and error messages. So, how do you use rails validation in yout multilingual websites. Is there another not_too_complicated way to use rails validation, which is a great system ? Thanx in advance, Nicolas -- Posted via http://www.ruby-forum.com/. From mutoh at highway.ne.jp Tue Oct 3 11:49:17 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Wed, 4 Oct 2006 00:49:17 +0900 Subject: [Rails I18n] Globalize and model error messages In-Reply-To: <06a23756c1871edda85a70dba2eb4133@ruby-forum.com> References: <06a23756c1871edda85a70dba2eb4133@ruby-forum.com> Message-ID: <20061004004917.2a8e4428.mutoh@highway.ne.jp> On Tue, 3 Oct 2006 10:12:25 +0200 "Nicolas No$(D+1(B" wrote: > Hi ! > I have a probably stupid question about i18n. I started to work with > ruby-gettext, as it allows me to translate field names in model > validation messages, and thus use error_messages_for helpers. It first > worked well, but I now have some problems with it (when trying to > internationalize a hierarchy of models, with some attributes wich > doesn't exists in the database). Gettext is nice, but seems to me more > like a 'unix' solution than a rails solution, so I'm open to change... > > My question is here : a lot of people seems to use globalize or other > i18n plugins that, if I believe what I read, don't support translating > models field names, table names, and error messages. So, how do you use > rails validation in yout multilingual websites. Is there another > not_too_complicated way to use rails validation, which is a great system > ? I don't think to detain you leave from gettext. But I have to say, ruby-gettext has a solution to translate the attributes which doesn't exists in the database. http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Translate+the+attributes+which+doesn%27t+exist+in+your+Database -- .:% Masao Mutoh From web at schmitz.be Wed Oct 4 08:23:11 2006 From: web at schmitz.be (=?utf-8?Q?Nicolas_No=c3=a9?=) Date: Wed, 4 Oct 2006 14:23:11 +0200 Subject: [Rails I18n] Globalize and model error messages In-Reply-To: <20061004004917.2a8e4428.mutoh@highway.ne.jp> References: <06a23756c1871edda85a70dba2eb4133@ruby-forum.com> <20061004004917.2a8e4428.mutoh@highway.ne.jp> Message-ID: Masao Mutoh wrote: > On Tue, 3 Oct 2006 10:12:25 +0200 > "Nicolas No$(D+1" wrote: > >> i18n plugins that, if I believe what I read, don't support translating >> models field names, table names, and error messages. So, how do you use >> rails validation in yout multilingual websites. Is there another >> not_too_complicated way to use rails validation, which is a great system >> ? > > I don't think to detain you leave from gettext. > But I have to say, ruby-gettext has a solution to translate the > attributes > which doesn't exists in the database. > > http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Translate+the+attributes+which+doesn%27t+exist+in+your+Database Thanks ! Yeah, I already use gettext for that, and that works pretty well. However, I had problems to use it with a hierarchy of Models (it seems to extract direct childs of ActiveRecord::Base, but not descendents of descendents of ActiveRecord::Base). As I'm new to rails and have an applic to develop and maintain, I was afraid that maybe gettext could cause other problems later and impeach me of using all rails features...For the moment it's ok, I found another way to solve my problem. -- Posted via http://www.ruby-forum.com/. From anon at anon.com Tue Oct 10 09:52:46 2006 From: anon at anon.com (Venkat) Date: Tue, 10 Oct 2006 15:52:46 +0200 Subject: [Rails I18n] Globalize Plugin - What is the purpose of scope column? Message-ID: <882ad70a963c8df52a4f6ea87002e005@ruby-forum.com> I am curious as to the potential use of "scope" column in the translations table. It doesn't appear to be used. Any ideas? Thanks, Venkat. -- Posted via http://www.ruby-forum.com/. From joshmh at gmail.com Tue Oct 10 17:03:54 2006 From: joshmh at gmail.com (Joshua Harvey) Date: Wed, 11 Oct 2006 00:03:54 +0300 Subject: [Rails I18n] Globalize Plugin - What is the purpose of scope column? In-Reply-To: <882ad70a963c8df52a4f6ea87002e005@ruby-forum.com> References: <882ad70a963c8df52a4f6ea87002e005@ruby-forum.com> Message-ID: <3527dd260610101403u18473ad0t507f9e2fb832e681@mail.gmail.com> Hi Venkat, It's not used anywhere in the Globalize code, it's just one of the field from the languages database I used as the base for Globalize. It probably shouldn't even be there. Best, Josh anon at anon.com> wrote: > I am curious as to the potential use of "scope" column in the > translations table. It doesn't appear to be used. Any ideas? > > Thanks, > Venkat. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > From anon at anon.com Wed Oct 11 06:13:41 2006 From: anon at anon.com (Venkat) Date: Wed, 11 Oct 2006 12:13:41 +0200 Subject: [Rails I18n] Globalize Plugin - Wiki spamming issue Message-ID: <9350a4cc9e5e68cc28a0c9304f82d086@ruby-forum.com> Dear Josh and all: The wiki is spammed like crazy. I have rolled back many pages a few times and others also watch and rollback but we would need a long term alternative. Wiki is a very good way to collaborate and it would be a big loss not having it. Instiki appears to be pretty much dead. The site itself is not accessible very often for the past six months or so (bad gateway error). We can consider moving to Trac based wiki or Mediawiki. It is a small wiki and I can help to do install and/or conversion to either of those versions. Regards, Venkat. -- Posted via http://www.ruby-forum.com/. From joshmh at gmail.com Wed Oct 11 14:59:40 2006 From: joshmh at gmail.com (Joshua Harvey) Date: Wed, 11 Oct 2006 21:59:40 +0300 Subject: [Rails I18n] Globalize Plugin - Wiki spamming issue In-Reply-To: <9350a4cc9e5e68cc28a0c9304f82d086@ruby-forum.com> References: <9350a4cc9e5e68cc28a0c9304f82d086@ruby-forum.com> Message-ID: <3527dd260610111159s6307ad14r3d89c39893485d54@mail.gmail.com> Hi Venkat, We're working on it. Stikipad has agreed to host our wiki, so we'll be moving that over during the next week. Liquid Concept (http://liquid-concept.ch) is going to be hosting the Trac. Best, Josh On 10/11/06, Venkat wrote: > Dear Josh and all: > > The wiki is spammed like crazy. I have rolled back many pages a few > times and others also watch and rollback but we would need a long term > alternative. > > Wiki is a very good way to collaborate and it would be a big loss not > having it. Instiki appears to be pretty much dead. The site itself is > not accessible very often for the past six months or so (bad gateway > error). We can consider moving to Trac based wiki or Mediawiki. It is a > small wiki and I can help to do install and/or conversion to either of > those versions. > > Regards, > Venkat. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > From patcito at gmail.com Fri Oct 13 22:22:39 2006 From: patcito at gmail.com (Patrick Aljord) Date: Sat, 14 Oct 2006 04:22:39 +0200 Subject: [Rails I18n] globalize newbie Message-ID: <6b6419750610131922s14dc6dd0hb9523b34dccd72e4@mail.gmail.com> hey all, I've just installed globalize, I did the svn checkout and the rake globalize:setup command. Now I want to translate some of the string in my views, as an example <%= "some strings".t %> but I don't know how to do this. I mean, I know I need to put the .t thing but then where do I put the translated string and the language I want to translate it to? I searched through the wiki but couldn't find it. I know that's some basic stuff but I have no idea how to do it. :( Any idea? thanx in advance Pat -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/railsi18n-discussion/attachments/20061014/393a4c33/attachment.html From balagan at czat.onet.pl Mon Oct 16 12:56:31 2006 From: balagan at czat.onet.pl (bal) Date: Mon, 16 Oct 2006 18:56:31 +0200 Subject: [Rails I18n] Globalize and model error messages In-Reply-To: References: <06a23756c1871edda85a70dba2eb4133@ruby-forum.com> <20061004004917.2a8e4428.mutoh@highway.ne.jp> Message-ID: Nicolas No? wrote: [...] > As I'm new to rails and have an applic to develop and maintain, I was > afraid that maybe gettext could cause other problems later and impeach > me of using all rails features...For the moment it's ok, I found another > way to solve my problem. How have You solved that problem? Have You found method to translate fields and class names in Globalize? -- Posted via http://www.ruby-forum.com/. From hipertracker at gmail.com Mon Oct 16 21:32:36 2006 From: hipertracker at gmail.com (Jaroslaw) Date: Tue, 17 Oct 2006 02:32:36 +0100 Subject: [Rails I18n] Globalize and Pluralization Rules References: <44EE1133.4090204@rt.sk> Message-ID: Dnia Thu, 24 Aug 2006 22:50:59 +0200, Ondrej Jaura napisa?(a): > Hello, > > Please, where to find some examples how to use pluralization rules in > Globalize? > > I would like to see how to use it also for languages such as Slovak or > Polish, where the rules are slightly more complicated. > e.g. > english: one, more > slovak: one, two...four, five and more > > > Thanks. > > Greetings, > > Ondrej Example for Polish: <%= "%d plik" / 1 %> <%= "%d pliki" / 2 %> <%= "%d plik?w" / 5 %> -- Jaros?aw Zabie??o http://blog.zabiello.com From nicolas at schmitz.be Thu Oct 19 03:26:20 2006 From: nicolas at schmitz.be (Nicolas Niconoe) Date: Thu, 19 Oct 2006 09:26:20 +0200 Subject: [Rails I18n] Globalize and model error messages In-Reply-To: References: <06a23756c1871edda85a70dba2eb4133@ruby-forum.com> <20061004004917.2a8e4428.mutoh@highway.ne.jp> Message-ID: <18abb6a54d512bab07dc98663e5dbd7b@ruby-forum.com> bal wrote: > Nicolas No? wrote: > > [...] > >> As I'm new to rails and have an applic to develop and maintain, I was >> afraid that maybe gettext could cause other problems later and impeach >> me of using all rails features...For the moment it's ok, I found another >> way to solve my problem. > > How have You solved that problem? Have You found method to translate > fields and class names in Globalize? No, I continued to used gettext... -- Posted via http://www.ruby-forum.com/. From joshmh at gmail.com Thu Oct 19 07:27:02 2006 From: joshmh at gmail.com (Joshua Harvey) Date: Thu, 19 Oct 2006 14:27:02 +0300 Subject: [Rails I18n] Globalize and model error messages In-Reply-To: <18abb6a54d512bab07dc98663e5dbd7b@ruby-forum.com> References: <06a23756c1871edda85a70dba2eb4133@ruby-forum.com> <20061004004917.2a8e4428.mutoh@highway.ne.jp> <18abb6a54d512bab07dc98663e5dbd7b@ruby-forum.com> Message-ID: <3527dd260610190427j312473cch68f1b62ab06a9c60@mail.gmail.com> I'm getting into this a bit late, but Globalize was designed to handle this. Globalize automatically tries to translate ActiveRecord validation messages, so if you trigger a validation error, that message should show up in the globalize_translations table and be available for translation. Because Globalize's string substitution isn't quite as sophisticated as we want it to be, it can't translate field names separately from the validation message. This means you have to translate all combination of field name/validation type. In many apps this isn't that big a problem, but if it is in your case, let us know. This would be a good thing to write up a ticket for. -- Josh On 10/19/06, Nicolas Niconoe wrote: > bal wrote: > > Nicolas No? wrote: > > > > [...] > > > >> As I'm new to rails and have an applic to develop and maintain, I was > >> afraid that maybe gettext could cause other problems later and impeach > >> me of using all rails features...For the moment it's ok, I found another > >> way to solve my problem. > > > > How have You solved that problem? Have You found method to translate > > fields and class names in Globalize? > > No, I continued to used gettext... > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion From tim at cs.msu.su Sun Oct 22 15:52:04 2006 From: tim at cs.msu.su (Tim Alexeevsky) Date: Sun, 22 Oct 2006 21:52:04 +0200 Subject: [Rails I18n] Translator workplace in Globalize Message-ID: Hello! I'm going to use Globalize in my app. While playing with Globalize I tried translation view example from globalize-rails.org. I like the way those things work -- text appears in translator's view (and also in globalize_translations table) after it is first time requested by app. Anyway there are some rough edges. Here are the ones that bother me more: 1. When a text is requested by application record dedicated to it's translation is put for current language only. My application should use only 5 languages and it seem reasonable for me to create empty translations for all languages simultaneously. 2. Model translations seem to be created only when such translation is saved. I think it will be useful to have empty model translations created automatically as view translations or to be created simultaneously for all languages after a record in translatable table is created. My questions are: What is supposed/prefered/recomended way to organize translators workplace with Globalize? Is it supposed to manage already created records in globalize_translations or it should create records by itself based on translatable tables? Can described behaviors be achieved using current version of Globalize? If not, probably someone could give me some hints of how to fix Globalize to work this way? Tim -- Posted via http://www.ruby-forum.com/. From joshmh at gmail.com Sun Oct 22 17:32:53 2006 From: joshmh at gmail.com (Joshua Harvey) Date: Mon, 23 Oct 2006 00:32:53 +0300 Subject: [Rails I18n] Translator workplace in Globalize In-Reply-To: References: Message-ID: <3527dd260610221432w74c4df12l8c5aefe44d0cec47@mail.gmail.com> Hi Tim, Your first proposal makes a lot of sense, and should be easier if we add a SUPPORTED_LANGUAGES = [ 'en', 'es' ] type constant. We're thinking of adding something like that anyway for other features. I didn't understand your second question. Why do you need to have actual records in globalize_translation for a model if there's no translation for that model in the given language? What's the connection to view translations? Best, Josh On 10/22/06, Tim Alexeevsky wrote: > Hello! > > I'm going to use Globalize in my app. While playing with Globalize I > tried translation view example from globalize-rails.org. I like the way > those things work -- text appears in translator's view (and also in > globalize_translations table) after it is first time requested by app. > Anyway there are some rough edges. Here are the ones that bother me > more: > 1. When a text is requested by application record dedicated to it's > translation is put for current language only. My application should use > only 5 languages and it seem reasonable for me to create empty > translations for all languages simultaneously. > 2. Model translations seem to be created only when such translation is > saved. I think it will be useful to have empty model translations > created automatically as view translations or to be created > simultaneously for all languages after a record in translatable table is > created. > My questions are: > What is supposed/prefered/recomended way to organize translators > workplace with Globalize? Is it supposed to manage already created > records in globalize_translations or it should create records by itself > based on translatable tables? > Can described behaviors be achieved using current version of > Globalize? If not, probably someone could give me some hints of how to > fix Globalize to work this way? > > Tim > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > From tim at cs.msu.su Sun Oct 22 19:43:33 2006 From: tim at cs.msu.su (Tim Alexeevsky) Date: Mon, 23 Oct 2006 01:43:33 +0200 Subject: [Rails I18n] Translator workplace in Globalize In-Reply-To: <3527dd260610221432w74c4df12l8c5aefe44d0cec47@mail.gmail.com> References: <3527dd260610221432w74c4df12l8c5aefe44d0cec47@mail.gmail.com> Message-ID: Joshua Harvey wrote: > Hi Tim, > > Your first proposal makes a lot of sense, and should be easier if we > add a SUPPORTED_LANGUAGES = [ 'en', 'es' ] type constant. We're > thinking of adding something like that anyway for other features. Good news :) > I didn't understand your second question. Why do you need to have > actual records in globalize_translation for a model if there's no > translation for that model in the given language? What's the > connection to view translations? My idea is to create web interface which would allow it's user to inspect and translate both already translated model data and model data which is supposed to be translated. Easy way is to reproduce example translator logic to work with all texts which appear in globalize_translations table. That's the reason I'd like to have empty records in translations table for model data that need to be translated but isn't translated yet. I see two way of reaching this effect: 1) to load empty translation records for all supported languages when new model record is created 2) to load empty records to translations table once corresponding model records have been used (it's the same way it is done with view translations). I'm not sure it's the best way to organize tranlator's interface but it's the easiest I think of. The other idea is to take records directly from model (instead of using globalize_translations as the only data source) and to save translations. Probably it's the better way. This way it would be good idea to be able to get the list of all models and all translatable attributes. Is there a way to get it all? Tim -- Posted via http://www.ruby-forum.com/. From joshmh at gmail.com Mon Oct 23 09:33:16 2006 From: joshmh at gmail.com (Joshua Harvey) Date: Mon, 23 Oct 2006 16:33:16 +0300 Subject: [Rails I18n] Translator workplace in Globalize In-Reply-To: References: <3527dd260610221432w74c4df12l8c5aefe44d0cec47@mail.gmail.com> Message-ID: <3527dd260610230633l49c654f8w81da1bfa3abe8390@mail.gmail.com> Hi Tim, Yes, I'd go with your second idea, pulling the data from the models themselves. To get the translatable fields use YourModel.globalize_facets, which will give you an Array of symbols representing the field names that are translatable. The method should be renamed, but that's what it is now. For finding all the models in the app, check out this blog entry: http://sporkmonger.com/articles/2006/10/22/a-question I'll bet there are better ways of doing it, and probably some of those ways are in the Rails code itself, but I don't know where to point you off-hand. Maybe somebody else here does. -- Josh On 10/23/06, Tim Alexeevsky wrote: > Joshua Harvey wrote: > > Hi Tim, > > > > Your first proposal makes a lot of sense, and should be easier if we > > add a SUPPORTED_LANGUAGES = [ 'en', 'es' ] type constant. We're > > thinking of adding something like that anyway for other features. > Good news :) > > > I didn't understand your second question. Why do you need to have > > actual records in globalize_translation for a model if there's no > > translation for that model in the given language? What's the > > connection to view translations? > My idea is to create web interface which would allow it's user to > inspect and translate both already translated model data and model data > which is supposed to be translated. Easy way is to reproduce example > translator logic to work with all texts which appear in > globalize_translations table. That's the reason I'd like to have empty > records in translations table for model data that need to be translated > but isn't translated yet. > I see two way of reaching this effect: > 1) to load empty translation records for all supported languages when > new model record is created > 2) to load empty records to translations table once corresponding > model records have been used (it's the same way it is done with view > translations). > > I'm not sure it's the best way to organize tranlator's interface but > it's the easiest I think of. > The other idea is to take records directly from model (instead of > using globalize_translations as the only data source) and to save > translations. Probably it's the better way. This way it would be good > idea to be able to get the list of all models and all translatable > attributes. Is there a way to get it all? > > Tim > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > From jmalmellones at gmail.com Mon Oct 23 11:04:52 2006 From: jmalmellones at gmail.com (Jose miguel Almellones) Date: Mon, 23 Oct 2006 17:04:52 +0200 Subject: [Rails I18n] Parse errors in accentuated strings after Globalizing Message-ID: <4a0743f942faa0dfcdcc87ce051abd99@ruby-forum.com> After installing Globalize and adding the following lines to the files: ---------------------------------------------------------------------- environment.rb at the end: include Globalize Locale.set_base_language 'es-ES' Locale.set('es-ES') LOCALES = {'es' => 'es-ES', 'en' => 'en-EN'}.freeze routes.rb at the begining: map.connect ':locale/:controller/:action/:id' application.rb: before_filter :set_locale def set_locale begin Locale.set params[:locale] rescue ArgumentError redirect_to params.merge( 'locale' => Locale.base_language.code ) end end ----------------------------------------------------------------------- some accentuated strings now give me a lot of problems that they were not giving before the Globalize installation.I have a controller in which: @options << option("Investigaci?n","investigacion","index") throws the following error: ./script/../config/../app/controllers/menu_controller.rb:14: parse error, unexpected tIDENTIFIER, expecting ')' @options << option("Investigaci?n","investigacion","index") ^ This can be solved changing "Investigaci?n" with "Investigacion". But I've read that the base language can be the one of your choice. Because all the basic content of the web is spanish I decided to set the base language to spanish. I'm worried because I thought that the web that I'm trying to internationalize (to english) should work perfectly in spanish as it was before. If someone had this problem and knows where the problem is, I would appreciate a little help with the question. Best regards -- Posted via http://www.ruby-forum.com/. From tim at cs.msu.su Mon Oct 23 11:55:21 2006 From: tim at cs.msu.su (Tim Alexeevsky) Date: Mon, 23 Oct 2006 17:55:21 +0200 Subject: [Rails I18n] Translator workplace in Globalize In-Reply-To: <3527dd260610230633l49c654f8w81da1bfa3abe8390@mail.gmail.com> References: <3527dd260610221432w74c4df12l8c5aefe44d0cec47@mail.gmail.com> <3527dd260610230633l49c654f8w81da1bfa3abe8390@mail.gmail.com> Message-ID: Hello, Josh! Thanks for the answers and for Globalize :) Tim -- Posted via http://www.ruby-forum.com/. From jramirez at aspgems.com Mon Oct 23 12:01:08 2006 From: jramirez at aspgems.com (javier ramirez) Date: Mon, 23 Oct 2006 18:01:08 +0200 Subject: [Rails I18n] Parse errors in accentuated strings after Globalizing In-Reply-To: <4a0743f942faa0dfcdcc87ce051abd99@ruby-forum.com> References: <4a0743f942faa0dfcdcc87ce051abd99@ruby-forum.com> Message-ID: <453CE744.6030608@aspgems.com> not sure, but it could be related to the fact that ruby doesn't natively support charsets in the strings. Usually you can fix this kind of problems by using jcode and setting KCODE to UTF-8 at environment.rb by adding these two lines of code |$KCODE = 'u' require 'jcode' | After you do this, the lenght of strings and so on works on multichar strings. A quick search in google by jcode and rails should put you on the right track for these. Not sure if that's your problem, but for sure it's a good practice when dealing with non-english charsets saludos ;) javier Jose miguel Almellones wrote: > After installing Globalize and adding the following lines to the files: > > ---------------------------------------------------------------------- > environment.rb at the end: > > include Globalize > Locale.set_base_language 'es-ES' > Locale.set('es-ES') > LOCALES = {'es' => 'es-ES', > 'en' => 'en-EN'}.freeze > > routes.rb at the begining: > > map.connect ':locale/:controller/:action/:id' > > application.rb: > > before_filter :set_locale > def set_locale > begin > Locale.set params[:locale] > rescue ArgumentError > redirect_to params.merge( 'locale' => Locale.base_language.code ) > end > end > ----------------------------------------------------------------------- > > some accentuated strings now give me a lot of problems that they were > not giving before the Globalize installation.I have a controller in > which: > > @options << option("Investigaci?n","investigacion","index") > > throws the following error: > ./script/../config/../app/controllers/menu_controller.rb:14: parse > error, unexpected tIDENTIFIER, expecting ')' > @options << option("Investigaci?n","investigacion","index") > ^ > This can be solved changing "Investigaci?n" with "Investigacion". But > I've read that the base language can be the one of your choice. Because > all the basic content of the web is spanish I decided to set the base > language to spanish. > > I'm worried because I thought that the web that I'm trying to > internationalize (to english) should work perfectly in spanish as it was > before. > > If someone had this problem and knows where the problem is, I would > appreciate a little help with the question. > > Best regards > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/railsi18n-discussion/attachments/20061023/c13cf263/attachment.html From patcito at gmail.com Sat Oct 28 15:24:05 2006 From: patcito at gmail.com (Patrick Aljord) Date: Sat, 28 Oct 2006 21:24:05 +0200 Subject: [Rails I18n] globalize or gettext? Message-ID: <6b6419750610281224j44619c64u3e15fd3177a54837@mail.gmail.com> Hey all, I'm starting a new rails app, I have both used globalize and rgettext in the past and they're both great. So I would like to know which one of the two scales better or if any of you know from experience which one is faster, has better performance etc? thanx in advance Pat