Hi, Has anyone has any success using the gettext translation methods mentioned in this wiki page? http://manuals.rubyonrails.com/read/chapter/105 I got up to running the localize script at which point it protests about not being able to find ''gettext/rgettext'' from the require line at the top of the script: script/localize:8:in `require'': no such file to load -- gettext/rgettext (LoadError) from script/localize:8 I''m using the Debian (Sarge) packages libgettext-ruby1.8 and libgettext-ruby-util thanks -- Mark Beattie Easy Schedule Management http://easy-online-schedule.com
Daniel Wislocki
2005-Nov-07 07:55 UTC
Re: Using Gettext To Translate Your Rails Application
I''ve gotten it to work, but I am using an older version. In the version I''m using, it''s expecting a file called rgettext.rb in the same directory as the localize script. Sounds like it''s now installed in a separate directory. Since the path (''gettext/rgettext'') is relative to your current working directory, you may have to be careful where you''re calling the localize script from -- it may not work where you''re calling it now. Do you know where gettext/rgettext.rb is located?
Mark Beattie wrote:> Hi, > > Has anyone has any success using the gettext translation methods mentioned in > this wiki page? > > http://manuals.rubyonrails.com/read/chapter/105 > > I got up to running the localize script at which point it protests about not > being able to find ''gettext/rgettext'' from the require line at the top of the > script: > > script/localize:8:in `require'': no such file to load -- gettext/rgettext > (LoadError) > from script/localize:8 > > I''m using the Debian (Sarge) packages libgettext-ruby1.8 and > libgettext-ruby-utilThanks for the info. I will put this on the list of corrections I plan to incorporate soon(ish). I am bogged down in PHP programming right now :( Sascha Ebach
Hi, On Mon, 7 Nov 2005 11:45:25 +0900 Mark Beattie <beattie.mark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Has anyone has any success using the gettext translation methods mentioned in > this wiki page? > > http://manuals.rubyonrails.com/read/chapter/105 > > I got up to running the localize script at which point it protests about not > being able to find ''gettext/rgettext'' from the require line at the top of the > script: > > script/localize:8:in `require'': no such file to load -- gettext/rgettext > (LoadError) > from script/localize:8 > > I''m using the Debian (Sarge) packages libgettext-ruby1.8 and > libgettext-ruby-utilI think your Ruby/Gettext is old. The wiki page is written for Ruby-GetText-Package-1.0.0. Use latest version of Ruby-GetText-Package. Thanks. -- .:% Masao Mutoh<mutoh-+e5RZkbjevhHfZP73Gtkiw@public.gmane.org>
Hi Masao,> I think your Ruby/Gettext is old. > > The wiki page is written for Ruby-GetText-Package-1.0.0. > Use latest version of Ruby-GetText-Package.Ah, this might be it. I will put a big disclaimer on top of the article stating the version of Ruby-GetText which should be used. Sascha Ebach
Hope I''m not flogging a dead horse on this, but I only just found your reply. This is one busy list! It''s a strange arrangement using Debian Sarge for gettext. The libgettext-ruby1.8 package only provides these libraries: /usr/lib/ruby/1.8/gettext.rb /usr/lib/ruby/1.8/gettext /usr/lib/ruby/1.8/gettext/locale_win32.rb /usr/lib/ruby/1.8/gettext/mo.rb /usr/lib/ruby/1.8/gettext/locale_table_win32.rb /usr/lib/ruby/1.8/gettext/iconv.rb /usr/lib/ruby/1.8/gettext/parser /usr/lib/ruby/1.8/gettext/parser/glade.rb /usr/lib/ruby/1.8/gettext/parser/ruby.rb /usr/lib/ruby/1.8/gettext/locale.rb /usr/lib/ruby/1.8/gettext/locale_default.rb /usr/lib/ruby/1.8/gettext/textdomain.rb It''s only the gettext ruby gem which provides rgettext.rb in /usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib/gettext: -rw-r--r-- 1 root root 1610 2005-11-14 12:08 cgi.rb -rw-r--r-- 1 root root 638 2005-11-14 12:08 container.rb -rw-r--r-- 1 root root 498 2005-11-14 12:08 erb.rb -rw-r--r-- 1 root root 2149 2005-11-14 12:08 iconv.rb -rw-r--r-- 1 root root 799 2005-11-14 12:08 locale_default.rb -rw-r--r-- 1 root root 1352 2005-11-14 12:08 locale.rb -rw-r--r-- 1 root root 4167 2005-11-14 12:08 locale_table_win32.rb -rw-r--r-- 1 root root 662 2005-11-14 12:08 locale_win32.rb -rw-r--r-- 1 root root 7382 2005-11-14 12:08 mo.rb drwxr-xr-x 2 root root 4096 2005-11-14 12:08 parser -rw-r--r-- 1 root root 814 2005-11-14 12:08 rails.rb -rw-r--r-- 1 root root 3984 2005-11-14 12:08 rgettext.rb -rw-r--r-- 1 root root 7683 2005-11-14 12:08 rmsgfmt.rb -rw-r--r-- 1 root root 4120 2005-11-14 12:08 textdomain.rb -rw-r--r-- 1 root root 244 2005-11-14 12:08 version.rb I tried calling the localize script from there, but then it just gives the error: undefined method `target?'' for GetText::GladeParser:Module Not even Google had an answer for that one. Any more ideas? I''m beginning to suspect that having both the debian gettext package and the gem installed at the same time is causing some kind of conflict. The thing is that the debian package is required by poedit, while the ruby gem is required to get rgettext.rb for the localize script to generate the po files. cheers On Monday 07 November 2005 4:55 pm, Daniel Wislocki wrote:> I''ve gotten it to work, but I am using an older version. In the > version I''m using, it''s expecting a file called rgettext.rb in the > same directory as the localize script. Sounds like it''s now installed > in a separate directory. Since the path (''gettext/rgettext'') is > relative to your current working directory, you may have to be careful > where you''re calling the localize script from -- it may not work where > you''re calling it now. Do you know where gettext/rgettext.rb is > located? > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-- Mark Beattie Easy Schedule Management http://easy-online-schedule.com _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, On Mon, 14 Nov 2005 13:29:41 +0900 Mark Beattie <beattie.mark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hope I''m not flogging a dead horse on this, but I only just found your reply. This is one busy list! > > It''s a strange arrangement using Debian Sarge for gettext. The libgettext-ruby1.8 package only provides these libraries:> It''s only the gettext ruby gem which provides rgettext.rb in /usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib/gettext: >> Not even Google had an answer for that one. Any more ideas? I''m beginning to suspect that having both the debian gettext package and the gem installed at the same time is causing some kind of conflict. The thing is that the debian package is required by poedit, while the ruby gem is required to get rgettext.rb for the localize script to generate the po files.libgettext-ruby1.8 seems old. Could you remove libgettext-ruby-1.8 and install Ruby-GetText-1.0.0, then retry it? -- .:% Masao Mutoh<mutoh-+e5RZkbjevhHfZP73Gtkiw@public.gmane.org>
On Monday 14 November 2005 2:31 pm, Masao Mutoh wrote:> libgettext-ruby1.8 seems old. > > Could you remove libgettext-ruby-1.8 and install Ruby-GetText-1.0.0, > then retry it?Sorry to be late to reply again. The problem I think is that the Debian Sarge version of libgettext-ruby1.8 provides version 0.8.0-1, while the Unstable (Sid) version provides the 1.0.0-1 version required. Sascha - maybe save Debain Sarge users some trouble by changing "Alternative: If you are using Debian like I do..." to "Alternative: If you are using Debian Testing/Unstable like I do..." I removed libgettext-ruby1.8 and libgettext-ruby-util, and installed the gettext ruby gem as follows. Should I now be able to run the localize script described in the article? gem install gettext Attempting local installation of ''gettext'' Local gem file not found: gettext*.gem Attempting remote installation of ''gettext'' Updating Gem source index for: http://gems.rubyforge.org Select which gem to install for your platform (i386-linux) 1. gettext 1.0.0 (ruby) 2. gettext 1.0.0 (mswin32) 3. Cancel installation> 1Building native extensions. This could take a while... Makefile:111: warning: overriding commands for target `/usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib'' Makefile:109: warning: ignoring old commands for target `/usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib'' Makefile:111: warning: overriding commands for target `/usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib'' Makefile:109: warning: ignoring old commands for target `/usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib'' ruby extconf.rb install gettext checking for setlocale()... yes checking for nl_langinfo()... yes creating Makefile make gcc -fPIC -Wall -g -O2 -fPIC -I. -I/usr/lib/ruby/1.8/i386-linux -I/usr/lib/ruby/1.8/i386-linux -I. -DHAVE_SETLOCALE -DHAVE_NL_LANGINFO -c _locale.c gcc -shared -L"/usr/lib" -o _locale.so _locale.o -lruby1.8 -lpthread -ldl -lcrypt -lm -lc make install install -p -m 0755 _locale.so /usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib Makefile:111: warning: overriding commands for target `/usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib'' Makefile:109: warning: ignoring old commands for target `/usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib'' Makefile:111: warning: overriding commands for target `/usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib'' Makefile:109: warning: ignoring old commands for target `/usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib'' ruby extconf.rb install gettext checking for setlocale()... yes checking for nl_langinfo()... yes creating Makefile make make: Nothing to be done for `all''. make install install -p -m 0755 _locale.so /usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib Successfully installed gettext-1.0.0 many thanks -- Mark Beattie Easy Schedule Management http://easy-online-schedule.com
Mark Beattie wrote:> On Monday 14 November 2005 2:31 pm, Masao Mutoh wrote: >> libgettext-ruby1.8 seems old. >> >> Could you remove libgettext-ruby-1.8 and install Ruby-GetText-1.0.0, >> then retry it? > > Sorry to be late to reply again. The problem I think is that the Debian Sarge > version of libgettext-ruby1.8 provides version 0.8.0-1, while the Unstable > (Sid) version provides the 1.0.0-1 version required. > > Sascha - maybe save Debain Sarge users some trouble by changing "Alternative: > If you are using Debian like I do..." to "Alternative: If you are using > Debian Testing/Unstable like I do..."Good idea. Changed.> > I removed libgettext-ruby1.8 and libgettext-ruby-util, and installed the > gettext ruby gem as follows. Should I now be able to run the localize script > described in the article?Yes, you should. If not let us know what failed. Sascha
On Friday 18 November 2005 8:41 pm, Sascha Ebach wrote:> > Sascha - maybe save Debain Sarge users some trouble by changing > > "Alternative: If you are using Debian like I do..." to "Alternative: If > > you are using Debian Testing/Unstable like I do..." > > Good idea. Changed. >Nice one, cheers.> > I removed libgettext-ruby1.8 and libgettext-ruby-util, and installed the > > gettext ruby gem as follows. Should I now be able to run the localize > > script described in the article? > > Yes, you should. If not let us know what failed. >Before I go on, thanks for taking the time to write the article, and for sharing the script with us. The good news is that I got it working, but with a one last Debian Sarge specific peculiarity: This is the output from running the localize script from the Rails app''s basedir: script/localize appname ./gettext/rgettext.rb:16:in `require'': no such file to load -- gettext (LoadError) from ./gettext/rgettext.rb:16 from script/localize:8:in `require'' from script/localize:8 So, Debian Sarge users, dpkg -r libgettext-ruby1.8 and libgettext-util, install the gettext ruby gem (gem install gettext), and then run the localize script successfully like so: 1) cd /usr/lib/ruby/gems/1.8/gems/gettext-1.0.0/lib/ 2) /path/to/rails/app/script/localize appname eg: /var/www/killerapp/trunk/killerapp/script/localize killerapp Thanks again Sascha and Mutou-san, much appreciated -- Mark Beattie Easy Schedule Management http://easy-online-schedule.com