toomasadam / aloxripper

Automatically exported from code.google.com/p/rubyripper
0 stars 0 forks source link

Separete language file #102

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I would like to translate Rubyripper into German and post it here or
wherever you want. With the current code structure that seems to be very
difficoult, as there is no separate language file and in the (GUI)-code
functions are called by the label and not by the label name, if I
understand the code correctly.

Would it be possible to split the GUI code into pure GUI code and a
language file? I would be happy to give something back...

Original issue reported on code.google.com by heinz.weigand@gmail.com on 19 Jul 2007 at 6:44

GoogleCodeExporter commented 9 years ago
It is theoretically certainly possible yes. But as these things go, it would 
have 
been much easier when initially started with the idea of a multilanguage 
application.

When supporting other languages Rubyripper would probably need to use the 
gettext 
library. I have looked for it before, but had problems finding some inspirating 
examples to get me going.

One of the problems with gettext is that it is not possible to make it 
optional. 
All users have to get the gettext library once rubyripper supports it.

Having said this, would you also like to translate the log file or just the 
gui? 
I'll look a bit more into it.

Original comment by rubyripp...@gmail.com on 19 Jul 2007 at 7:01

GoogleCodeExporter commented 9 years ago
I would completely translate the application. Can you confirm that translating 
for
example the button labels would make Rubyripper stop working because functions 
do
only work with the original label text?

Original comment by heinz.weigand@gmail.com on 19 Jul 2007 at 7:38

GoogleCodeExporter commented 9 years ago
Another question/idea: I know next to nothing about ruby, but have some good
knowledge about PHP. In PHP it would be possible to <php code>include<php code> 
a
language file (if you know what I mean).

Original comment by heinz.weigand@gmail.com on 19 Jul 2007 at 7:41

GoogleCodeExporter commented 9 years ago
I am already looking into ruby-gettext right now. Although I appreciate your 
enthusiasm, please have some patience. 

At first sight translating rubyripper doesn't seem to be so difficult after 
all. 
Once I have gone through all text string and replaced them, you can translate 
all 
strings and we'll see if it works out allright. Depending on how much time I'll 
find (and the weather ;) ) this might take a few days till 2 weeks.

Original comment by rubyripp...@gmail.com on 19 Jul 2007 at 7:50

GoogleCodeExporter commented 9 years ago
Great, sounds very good. I think translations in other languages will give 
Rubyripper
the userbase it deserves.
Heinz

Original comment by heinz.weigand@gmail.com on 19 Jul 2007 at 8:03

GoogleCodeExporter commented 9 years ago
With latest commit I made the rubyripper_gtk2.rb classes translatable. I'll see 
how 
fast I can do this for the rr.lib.rb classes as well. Not for tonight. Getting 
some 
sleep for now. Does miracles sometime ;)

You need the ruby-gettext package to be installed. For instructions how to work 
with translations, move over to: 
http://www.yotabanana.com/hiki/ruby-gettext-howto.html

If anyone has any experience in setting a translation file system up and 
running, 
please give some advice. Otherwise I'm gonna have to study the specs. I know, I 
am 
a lazy a** :)

Original comment by rubyripp...@gmail.com on 19 Jul 2007 at 9:12

GoogleCodeExporter commented 9 years ago
Wowh! Did not expect such a fast reaction. I have already generated a pot file 
and
translated about 50%, will do the rest on Saturday evening....

http://manuals.rubyonrails.com/read/chapter/105

Maybe that helps with setting up a translation file system...

Original comment by heinz.weigand@gmail.com on 19 Jul 2007 at 10:47

GoogleCodeExporter commented 9 years ago
Latest commit checks the translatable backend (rr_lib.rb) in ;) Next thing to 
do is 
to translate the cli frontend. After this I'll look into how to handle the 
translation files.

Original comment by rubyripp...@gmail.com on 21 Jul 2007 at 10:38

GoogleCodeExporter commented 9 years ago
rubyripper_gtk2.rb translation into German is finished. Can you please check it,
especially for to long strings and umlauts....
.po and .mo attached

Original comment by heinz.weigand@gmail.com on 21 Jul 2007 at 11:58

Attachments:

GoogleCodeExporter commented 9 years ago
...working on the translation of rr_lib.rb...

Original comment by heinz.weigand@gmail.com on 21 Jul 2007 at 12:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
rr_lib.rb translation into German finished, Please check attached files...

Original comment by heinz.weigand@gmail.com on 21 Jul 2007 at 6:05

Attachments:

GoogleCodeExporter commented 9 years ago
This issue will have to wait a little longer. After having a short break last 
weekend, I somehow got myself a holiday to the German Wacken festival. I'll be 
back 
on the 5th of August. Then I can finally continue to put some time in coding.

Original comment by rubyripp...@gmail.com on 27 Jul 2007 at 5:10

GoogleCodeExporter commented 9 years ago
Don't worry, take your time...

Original comment by heinz.weigand@gmail.com on 28 Jul 2007 at 12:16

GoogleCodeExporter commented 9 years ago
The rubyripper_cli file is now also translatable. I was kinda stuck why it 
didn't 
work as I intended, but another issue leaded to the solution.

Original comment by rubyripp...@gmail.com on 6 Aug 2007 at 6:34

GoogleCodeExporter commented 9 years ago
translation of rubyripper_cli into German attached. It gave me gettext errors 
though,
no idea why, all other files where ok. You may want to check if they are ok. 
Its only
the *.mo and *.pot, *.po file wont compile...

Original comment by heinz.weigand@gmail.com on 7 Aug 2007 at 9:13

Attachments:

GoogleCodeExporter commented 9 years ago
Must have closed this issue by accident. Anyway, I've made the complete cli 
file 
translatable, not only the first part. (I did thought I did do so before, but 
apparently I'm wrong). So please redo the cli one.

I'll see if I can get the basis file structure into svn this weekend.

Original comment by rubyripp...@gmail.com on 10 Aug 2007 at 6:44

GoogleCodeExporter commented 9 years ago
The basic file infrastructure is checked into svn. Translations are not loaded 
yet 
by default. Will fix this soon.

Original comment by rubyripp...@gmail.com on 11 Aug 2007 at 12:54

GoogleCodeExporter commented 9 years ago
By default the translation file is loaded if present :D. No need for any bloody 
install ;). Will have to find a way to let it work when installed though. I 
suppose 
I'll just have to copy all the *mo files to /usr/share/locale/

Dutch translation of the cli file has just been updated to work 100% correctly.

Look out for all the "fuzzy" comments. They mean that the source string is 
altered. 
After checking for correctness, remove the "fuzzy" comments. To update the 
mo-files, you can do -> rake makemo (when rake is installed ofcourse).

Original comment by rubyripp...@gmail.com on 11 Aug 2007 at 3:25

GoogleCodeExporter commented 9 years ago
The Dutch translation is now 100% complete (revision 137). I hope I've fixed 
all 
problems in the ruby files. The german translation should be updated as well.

Original comment by rubyripp...@gmail.com on 2 Sep 2007 at 9:46

GoogleCodeExporter commented 9 years ago
Got the Makefile updated. The german translation still needs some work!

Original comment by rubyripp...@gmail.com on 26 Sep 2007 at 6:48

GoogleCodeExporter commented 9 years ago
Sorry for the delay. My wife took my laptop abroad because hers was broken.

German translations of rubyripper_cli attached.

Cheers,
Heinz

Original comment by heinz.weigand@gmail.com on 27 Sep 2007 at 10:42

Attachments:

GoogleCodeExporter commented 9 years ago
German translations of rr_lib

Original comment by heinz.weigand@gmail.com on 27 Sep 2007 at 10:48

Attachments:

GoogleCodeExporter commented 9 years ago
German translations of rubyripper_gtk2

Original comment by heinz.weigand@gmail.com on 27 Sep 2007 at 10:54

Attachments:

GoogleCodeExporter commented 9 years ago
German po files are checked into svn with commit 143. Thanks for the updates.

Original comment by rubyripp...@gmail.com on 29 Sep 2007 at 11:29

GoogleCodeExporter commented 9 years ago
German translations had a few smaller problems, those are fixed with attached 
files
(somehow the umlauts got screwed up in cyberspace).

Also, there seems to be a problem with the status window and the log. All text 
is in
English there if you rip a CD. The text are translated though in the po and mo 
files
and compiles without any errors from rake.

Could you please check in the new files so that I can check out again and see if
everything is ok now?

Heinz

Original comment by heinz.weigand@gmail.com on 29 Sep 2007 at 4:25

Attachments:

GoogleCodeExporter commented 9 years ago
I've updated the translation files. It seems to be working just fine for me. 
Also 
the log creation looks good.

Original comment by rubyripp...@gmail.com on 29 Sep 2007 at 5:02

GoogleCodeExporter commented 9 years ago
>I've updated the translation files. It seems to be working just fine for me. 
Also 
>the log creation looks good.

hmm, strange. Have a look at the two screenshots. Everything in German, except 
status
and log(summary)...

Original comment by heinz.weigand@gmail.com on 29 Sep 2007 at 8:17

Attachments:

GoogleCodeExporter commented 9 years ago
Well I checked again and everything is working fine, unlike your screenshots.

I guess that the following has happened. You have installed rubyripper before 
from 
the subversion codebase onto your system. The language file will still be taken 
from the old install, instead of the updated language file. 

You should install another time with make install. Or use make uninstall to 
ensure 
you're using the subversion files. 

I'll show you a screenshot to prove that it's working:

Original comment by rubyripp...@gmail.com on 29 Sep 2007 at 8:43

Attachments:

GoogleCodeExporter commented 9 years ago
Very strange. I always check out in a new directory and install from there. 
Made a
complete uninstall a couple of minutes ago and checked, that nothing rr related 
was
left in /usr/share/locale/de/LC_MESSAGES.

After a new install I have the same situation as before.

I am giving up.

Original comment by heinz.weigand@gmail.com on 29 Sep 2007 at 9:48

GoogleCodeExporter commented 9 years ago
You are sure you're updated to the latest commit (148)? By the way, you can 
simply 
use the command "svn update" to update your directory.

I don't know if it makes any difference, but I launched rubyripper as follows 
from 
the subversion directory: LANG=de_DE ./rubyripper_gtk2

Original comment by rubyripp...@gmail.com on 30 Sep 2007 at 8:37

GoogleCodeExporter commented 9 years ago
>You are sure you're updated to the latest commit (148)? By the way, you can 
simply 
>use the command "svn update" to update your directory.

yes, I am sure. I use RapidSVN and always check out to a new directory with the 
days
date. I prefer to have several revisions local. I install from that directory 
on the
command line with sudo make install.

>I don't know if it makes any difference, but I launched rubyripper as follows 
from 
>the subversion directory: LANG=de_DE ./rubyripper_gtk2

I tried that earlier today before reading your latest comment: launching
./rubyripper_gtk2 from my svn directory (without the LANG suffix) results in a
perfectly translated RR even in the status directory, so this does the trick.

So there must be a problem in the normal install process.

Heinz

Original comment by heinz.weigand@gmail.com on 30 Sep 2007 at 12:32

GoogleCodeExporter commented 9 years ago
Just tried another fresh install, same problem, everything in German except the
status window if called from usr/local/bin.

heinz@samsung:~/rubyripper-svn/30092007$ sudo make install
Password:
chmod +x rubyripper_gtk2.rb
chmod +x rubyripper_cli.rb
install rr_lib.rb `ruby helpfile.rb`/rr_lib.rb # install in the standard ruby 
location
install rubyripper_cli.rb /usr/local/bin/rrip_cli
echo "The cli interface is installed as /usr/local/bin/rrip_cli"
The cli interface is installed as /usr/local/bin/rrip_cli
install rubyripper_22.png /usr/share/pixmaps/rubyripper_22.png
install rubyripper.desktop /usr/share/applications/rubyripper.desktop #create a 
menu
entry
install rubyripper_gtk2.rb /usr/local/bin/rrip_gui
echo "The gtk2 interface is installed as /usr/local/bin/rrip_gui"
The gtk2 interface is installed as /usr/local/bin/rrip_gui
`echo rake makemo`
(in /home/heinz/rubyripper-svn/30092007)
./locale/po/de/rr_cli.po -> ./locale/de/LC_MESSAGES/rr_cli.mo
./locale/po/de/rr_gtk2.po -> ./locale/de/LC_MESSAGES/rr_gtk2.mo
./locale/po/de/rr_lib.po -> ./locale/de/LC_MESSAGES/rr_lib.mo
./locale/po/nl/rr_cli.po -> ./locale/nl/LC_MESSAGES/rr_cli.mo
./locale/po/nl/rr_gtk2.po -> ./locale/nl/LC_MESSAGES/rr_gtk2.mo
./locale/po/nl/rr_lib.po -> ./locale/nl/LC_MESSAGES/rr_lib.mo
install locale/nl/LC_MESSAGES/rr_cli.mo 
/usr/share/locale/nl/LC_MESSAGES/rr_cli.mo
install locale/nl/LC_MESSAGES/rr_gtk2.mo 
/usr/share/locale/nl/LC_MESSAGES/rr_gtk2.mo
install locale/nl/LC_MESSAGES/rr_lib.mo 
/usr/share/locale/nl/LC_MESSAGES/rr_lib.mo
install locale/de/LC_MESSAGES/rr_cli.mo 
/usr/share/locale/de/LC_MESSAGES/rr_cli.mo
install locale/de/LC_MESSAGES/rr_gtk2.mo 
/usr/share/locale/de/LC_MESSAGES/rr_gtk2.mo
install locale/de/LC_MESSAGES/rr_lib.mo 
/usr/share/locale/de/LC_MESSAGES/rr_lib.mo

Original comment by heinz.weigand@gmail.com on 30 Sep 2007 at 12:43

GoogleCodeExporter commented 9 years ago
Perhaps it's due to a different version of ruby-gettext? I do get some remark 
that 
a function is redefined. See output below. This has something to do with the 
mo-files. Make sure they do not yet exists when executing make install.

`echo rake makemo`
(in /mnt/data/software/rubyripper)
/usr/lib/ruby/site_ruby/1.8/gettext/utils.rb:90: warning: method redefined; 
discarding old create_mofiles
./locale/po/de/rr_cli.po -> ./locale/de/LC_MESSAGES/rr_cli.mo
./locale/po/de/rr_lib.po -> ./locale/de/LC_MESSAGES/rr_lib.mo
./locale/po/de/rr_gtk2.po -> ./locale/de/LC_MESSAGES/rr_gtk2.mo
./locale/po/nl/rr_cli.po -> ./locale/nl/LC_MESSAGES/rr_cli.mo
./locale/po/nl/rr_lib.po -> ./locale/nl/LC_MESSAGES/rr_lib.mo
./locale/po/nl/rr_gtk2.po -> ./locale/nl/LC_MESSAGES/rr_gtk2.mo
install locale/nl/LC_MESSAGES/rr_cli.mo 
/usr/share/locale/nl/LC_MESSAGES/rr_cli.mo
install 
locale/nl/LC_MESSAGES/rr_gtk2.mo /usr/share/locale/nl/LC_MESSAGES/rr_gtk2.mo
install locale/nl/LC_MESSAGES/rr_lib.mo 
/usr/share/locale/nl/LC_MESSAGES/rr_lib.mo
install locale/de/LC_MESSAGES/rr_cli.mo 
/usr/share/locale/de/LC_MESSAGES/rr_cli.mo
install 
locale/de/LC_MESSAGES/rr_gtk2.mo /usr/share/locale/de/LC_MESSAGES/rr_gtk2.mo
install locale/de/LC_MESSAGES/rr_lib.mo 
/usr/share/locale/de/LC_MESSAGES/rr_lib.mo

Original comment by rubyripp...@gmail.com on 30 Sep 2007 at 1:03

GoogleCodeExporter commented 9 years ago
>Perhaps it's due to a different version of ruby-gettext?

libgettext-ruby1.8 (1.7.0.1) here.

/locale/de/LC_MESSAGES was clean of any RR *.mo files before install.

Any ideas?

Heinz

Original comment by heinz.weigand@gmail.com on 30 Sep 2007 at 1:30

GoogleCodeExporter commented 9 years ago
It seems that I've got a newer version of rgettext (1.10.0). Perhaps they 
changed 
something internally. I suggest you also upgrade to the 1.10.0 version. It 
seems 
like a bug of your software configuration, since I cannot reproduce it.

I've ran out of other ideas.

Original comment by rubyripp...@gmail.com on 30 Sep 2007 at 2:00

GoogleCodeExporter commented 9 years ago
Are you sure that we are not talking of gettext itself? This is indeed at 
1.10.35.

Here is a quote from the package list of the upcoming Ubuntu Gutsy (still 
alpha):

Other Packages Related to libgettext-ruby-util
[dep]= depends  [rec]= recommends   [sug]= suggests

    *

      [dep] gettext (>= 0.10.35)
          GNU Internationalization utilities

    *

      [dep] irb1.8
          Interactive Ruby (for Ruby 1.8)

    *

      [dep] libgettext-ruby1.8 (>= 1.9.0-1)
          Gettext for ruby1.8

    *

      [dep] ruby1.8
          Interpreter of object-oriented scripting language Ruby 1.8

Original comment by heinz.weigand@gmail.com on 30 Sep 2007 at 2:39

GoogleCodeExporter commented 9 years ago
Solved!

The problem lies here in rubyripper_gtk2.rb:

if File.exists?('rr_lib.rb')
    require './rr_lib.rb' # run from local directory
else
    require 'rr_lib.rb' # installed in ruby directory

I had an old rr_lib.rb lying arround in my home directory and it seems that 
this was
loaded instead of the new one in /usr/local/bin

Heinz

Original comment by heinz.weigand@gmail.com on 30 Sep 2007 at 3:13

GoogleCodeExporter commented 9 years ago
I'm really glad you've found the problem :D

Original comment by rubyripp...@gmail.com on 30 Sep 2007 at 8:37