Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: how to find po files?

  1. #1
    Join Date
    Feb 2005
    Location
    sweden
    Beans
    56
    Distro
    Ubuntu 6.06

    how to find po files?

    I would like to translate som program to swedish but i can't find how to work with po files. Is there any good description about how to do that? I dosen't know there po file is on the computer?

  2. #2
    Join Date
    Aug 2005
    Beans
    169

    Re: how to find po files?

    Gnu Gettext is the app that generates .po files for different locales.

  3. #3
    Join Date
    Oct 2004
    Location
    Germany, Old Europe
    Beans
    379
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: how to find po files?

    Usually po files are not installed on the system with the software, only the binary mo files. The mo files are generated from the po files via gettext. On Ubuntu you find most mo files under /usr/share/locale-langpack/ .

    Thus to get the po files you have to get the source of the package. Usually you find them in the source under a 'po' subdirectory. You can get the source via 'apt-get source <package>' or directly from a upstream webpage/mirror/cvs.

    There are several applications which make it more convenient to work with and manage po files like kbabel or GTranslator. I am sure there are plenty of others out there.

    Here is the documentation for the GNU gettext Utilities. Here is some more information about POT and PO Files from the KDE translation howto.

    Because this is a Ubuntu forum I highly recommend Rosetta for translations. For more information see Ubuntu WIKI: Rosetta and RosettaFAQ.

  4. #4
    Join Date
    Aug 2010
    Location
    INDIA
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to find po files?

    are you able to do any translations in your language.
    i m also trying to convert some applications of ubuntu in hindi, but unable to do so.
    i need help please reply...

  5. #5
    Join Date
    Sep 2007
    Location
    Christchurch, New Zealand
    Beans
    1,328
    Distro
    Ubuntu

    Re: how to find po files?

    Quote Originally Posted by c2tarun View Post
    are you able to do any translations in your language.
    i m also trying to convert some applications of ubuntu in hindi, but unable to do so.
    i need help please reply...
    The first thing you must do is top get a .po file for the application.

    If you have the source code you can use the xgettext tool to extract all the translatable strings. If it is a well established project then they probably have a mailing list and are eager to get help from translators in different locales.

    Here is an excellent introduction tutorial that was everything I needed to know to making my own translations. I wrote project exploring internationalization and localization here and the html documents are full of ideas experiments and code. Full working examples are in the other files of the project.

  6. #6
    Join Date
    Aug 2010
    Location
    INDIA
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to find po files?

    do we have to install our language support first or we can do it directly??

  7. #7
    Join Date
    Sep 2007
    Location
    Christchurch, New Zealand
    Beans
    1,328
    Distro
    Ubuntu

    Re: how to find po files?

    Quote Originally Posted by c2tarun View Post
    do we have to install our language support first or we can do it directly??
    Since the actual translation is done manually you can prepare .po files for any lanuage without installing support for that language.
    You will evidently have to be able to enter the appropriate characters somehow.
    If they are not on your keyboard. You can also compile the .po file into a .mo file (the binary run time version) without installing the language support, but if you want to use it and test it you must run sudo locale-gen. Here I'll copy my notes from when I started learning that Oriya tutorial:
    Code:
    from http://oriya.sarovar.org/docs/gettext_single.html
    
     create internationalized version of hello.c
    
    $> gcc -o hello hello.c
    
    # extract translatable strings with:
    $> xgettext -d hello -s -o hello.pot hello.c
    
    The -s option tells xgettext to produce sorted output.
    The message domain for the program should be specified as the argument to
    the -d option, and should match the domain specified in the call to textdomain
    (on line 9 of the program source)
    
     copy the portable object template to oriya.po using
    $> msginit -l or_IN -o oriya.po -i hello.pot
    # Note: -l (letter l) option defines the locale
    
    
    do the translations by hand
    
    # compile it to machine object
    $> msgfmt -c -v -o hello.mo oriya.po
    
    copy it to the location whose base directory is given by the second argument to
    bindtextdomain. The final location of the file will be in the sub-directory
    LL/LC_MESSAGES or LL_CC/LC_MESSAGES under the base directory, where LL stands
    for a language, and CC for a country
    
    $> sudo mkdir -p /usr/share/locale/or_IN/LC_MESSAGES
    $> sudo cp hello.mo /usr/share/locale/or_IN/LC_MESSAGES
    
    #generate the locale if it doesn't exist:
    $> sudo locale-gen or_IN
    
    #select the locale
    $> export LANG=or_IN
    
    #run the program:
    $> ./hello
    I often still refer to this to make sure I use the right commands
    Last edited by worksofcraft; October 16th, 2010 at 08:37 PM. Reason: lines too long

  8. #8
    Join Date
    Apr 2007
    Location
    (X,Y,Z) = (0,0,0)
    Beans
    3,715

    Re: how to find po files?

    Quote Originally Posted by c2tarun View Post
    do we have to install our language support first or we can do it directly??
    Code using gettext will need to know what locale is being used in order to choose the correct language file... so, yes, you need to have support for the needed language support to work correctly.

  9. #9
    Join Date
    Aug 2010
    Location
    INDIA
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to find po files?

    Quote Originally Posted by worksofcraft View Post
    Since the actual translation is done manually you can prepare .po files for any lanuage without installing support for that language.
    You will evidently have to be able to enter the appropriate characters somehow.
    If they are not on your keyboard. You can also compile the .po file into a .mo file (the binary run time version) without installing the language support, but if you want to use it and test it you must run sudo locale-gen. Here I'll copy my notes from when I started learning that Oriya tutorial:
    Code:
    from http://oriya.sarovar.org/docs/gettext_single.html
    
     create internationalized version of hello.c
    
    $> gcc -o hello hello.c
    
    # extract translatable strings with:
    $> xgettext -d hello -s -o hello.pot hello.c
    
    The -s option tells xgettext to produce sorted output.
    The message domain for the program should be specified as the argument to
    the -d option, and should match the domain specified in the call to textdomain
    (on line 9 of the program source)
    
     copy the portable object template to oriya.po using
    $> msginit -l or_IN -o oriya.po -i hello.pot
    # Note: -l (letter l) option defines the locale
    
    
    do the translations by hand
    
    # compile it to machine object
    $> msgfmt -c -v -o hello.mo oriya.po
    
    copy it to the location whose base directory is given by the second argument to
    bindtextdomain. The final location of the file will be in the sub-directory
    LL/LC_MESSAGES or LL_CC/LC_MESSAGES under the base directory, where LL stands
    for a language, and CC for a country
    
    $> sudo mkdir -p /usr/share/locale/or_IN/LC_MESSAGES
    $> sudo cp hello.mo /usr/share/locale/or_IN/LC_MESSAGES
    
    #generate the locale if it doesn't exist:
    $> sudo locale-gen or_IN
    
    #select the locale
    $> export LANG=or_IN
    
    #run the program:
    $> ./hello
    I often still refer to this to make sure I use the right commands


    wow....
    you tutorial is awesome, now i am able to translate some of applications to my native language.
    but it is just one steps among several to complete my project.
    still i have no idea how to convert linux ubuntu into hindi.
    what i thought is dowload the source code for gnome, and change po files there.
    or download the source code for gnome default window manager and make changes there.
    but still its a vague idea.
    can you please suggest me something.
    thanx

  10. #10
    Join Date
    Sep 2007
    Location
    Christchurch, New Zealand
    Beans
    1,328
    Distro
    Ubuntu

    Re: how to find po files?

    Quote Originally Posted by c2tarun View Post
    ...
    still i have no idea how to convert linux ubuntu into hindi.
    what i thought is dowload the source code for gnome, and change po files there.
    or download the source code for gnome default window manager and make changes there.
    but still its a vague idea.
    can you please suggest me something.
    thanx
    When you install Linux you can select Hindi as your native language. I gave it a try in a virtual box to see what it does. You see below is the image where you select Hindi as your native language during installation and then also I include an image of it running.

    As you can see it still has mostly English on the task bar and in the menus. The reason for this is because they are configurable...

    ... like text for the main menu is in /etc/xdg/menus/applications.menu and then there are separate .directory files in /usr/share/desktop-directories and presumably nobody has made Hindi versions of them yet

    I suppose you could try editing them but I would strongly suggest you do that in a virtual machine where you can save a "snapshot" to restore if something goes wrong!

    p.s. There are many gnome translation teams active all around the world and I see there is also a translation website for Hindi there. I suspect they will be pleased if you want to help them and should be able to help you get started
    Attached Images Attached Images
    Last edited by worksofcraft; October 17th, 2010 at 03:52 AM. Reason: mention gnome translation teams

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •