charlie
2006-May-08 03:28 UTC
[Rails] Gettext not worked in firefox,but done well under IE
Anyone who has met such a kind of problem? I am adding i18n characteristics to my webapp using gettext,it works under IE,while not under firefox. here is my codes: po: po\zh_CN\myapp.po after rake makemo, i have got: locale\zh_CN\LC_MESSAGES\myapp.mo require ''gettext/rails'' class ApplicationController < ActionController::Base init_gettext "myapp" end Then I use the following to have a test in the application.rhtml <%= local %> <% local=("zh_CN") %> <%= local %> <%= _("Login") %> in IE,it can display as follows: en zh_CN ?? but in firefox,it can not work: en zh_CN Login Am i wrong or ignore some procedures? Thanks Charlie -- Posted via http://www.ruby-forum.com/.
Doug Dupory
2006-May-08 03:50 UTC
[Rails] Re: Gettext not worked in firefox,but done well under IE
I''ve gotten GetText 1.4 and Firefox 1.5.0.3 to work. Not sure how you set the lang (locale). I have mine be the first of request.env[''HTTP_ACCEPT_LANGUAGE'']. DD -- Posted via http://www.ruby-forum.com/.
charlie
2006-May-08 05:22 UTC
[Rails] Re: Gettext not worked in firefox,but done well under IE
Doug Dupory wrote:> I''ve gotten GetText 1.4 and Firefox 1.5.0.3 to work. Not sure how you > set the lang (locale). I have mine be the first of > request.env[''HTTP_ACCEPT_LANGUAGE'']. > > DDIt seems that I can not use GetText.local= to set lang value,although I have found it in the API of GetText : http://www.yotabanana.com/hiki/ruby-gettext-api.html?ruby-gettext-api -- Posted via http://www.ruby-forum.com/.
Robert Wagner
2006-May-08 12:32 UTC
[Rails] Re: Gettext not worked in firefox,but done well under IE
2006/5/8, charlie <blogyingfeng@gmail.com>:> Doug Dupory wrote: > > I''ve gotten GetText 1.4 and Firefox 1.5.0.3 to work. Not sure how you > > set the lang (locale). I have mine be the first of > > request.env[''HTTP_ACCEPT_LANGUAGE'']. > > > > DD > > It seems that I can not use GetText.local= to set lang value,although I > have found it in the API of GetText : > http://www.yotabanana.com/hiki/ruby-gettext-api.html?ruby-gettext-api >maybe this helps: http://manuals.rubyonrails.com/read/book/16 it says: Ruby-GetText chooses the current language by following these rules in the given order: 1. the first value passed the ''locale'' parameter of GetText.bindtextdomain method call 2. ''lang'' value of QUERY_STRING 3. ''lang'' value of the Cookie 4. the value of HTTP_ACCEPT_LANGUAGE 5. or default ''en'' (English). ciao, robert> -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Masao Mutoh
2006-May-08 13:21 UTC
[Rails] Gettext not worked in firefox,but done well under IE
Hi, On Mon, 8 May 2006 05:27:38 +0200 charlie <blogyingfeng@gmail.com> wrote:> Anyone who has met such a kind of problem? I am adding i18n > characteristics to my webapp using gettext,it works under IE,while not > under firefox. > here is my codes: > po: > po\zh_CN\myapp.po > > after rake makemo, i have got: > locale\zh_CN\LC_MESSAGES\myapp.mo > > require ''gettext/rails'' > class ApplicationController < ActionController::Base > init_gettext "myapp" > end > > Then I use the following to have a test in the application.rhtml > <%= local %> > <% local=("zh_CN") %> > <%= local %> > <%= _("Login") %> > in IE,it can display as follows: > en > zh_CN > ?? > > but in firefox,it can not work: > en > zh_CN > Login > > Am i wrong or ignore some procedures?Did your code work? I think you need to use locale not local. and also local=("zh_CN") set "zh_CN" to "local" variable. If you really want to work this sample, then> require ''gettext/rails'' > class ApplicationController < ActionController::BaseGetText.locale = "zh_CN"> init_gettext "myapp" > endBTW, Try "zh" locale instead of "zh_CN". locale\zh_CN\LC_MESSAGES\myapp.mo -> locale\zh\LC_MESSAGES\myapp.mo I suspect your locale of FireFox is "zh" not "zh_CN". (Check Edit -> Preferences -> Advanced -> Edit Languages) -- .:% Masao Mutoh<mutoh@highway.ne.jp>