[Fedora-trans-ar] Re: .PO &.txt?.. what makes PO Very Special!!

Sherif Abdelgawad sherif at redhat.com
Tue Aug 30 00:44:00 UTC 2005


Maha,
   PO files are special formated txt files. You can read about the specific format at:

http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html

The most important thin when you edit the files is the encoding. Ensure that UTF8 is the 
encoding used. Also the line feed should not be DOS format line feed. 

So basically you can have the header part read all at once this includes all the stuff
about copyright and other comments.

To give you insight about why PO files are special. Basically all programs extract strings
used within the program from that file. Depending on your languag, it will be able to pick
up the right translation. PO files is where the translators contribute translaiton, then final
format of the translation are the MO files. MO files get compiled with the final packaging,
hence you never see the PO file in a final package.  

Sherif


  Ok.. got another question.. what's the difference between .txt and .po .. sure there is a difference.. but am thinking about how to deal parse and rebuild PO file from java code.. we need to read po file each to update the db..so we need to do some parsing work and understand how to read it..the second time i need to deal with PO file when am populating the data backward from the db into the files; modify the already existing file or create a new one.. what if i did treat it as a text file that am looking for say "daemon" take it with its translation, know if it's translation is fuzzy or not.. and then populate the data into db table.  vice verse.. i want to create or modify PO file.. I'll be looking for a keywords and change the text or a value of a header.. that's it!! i guess so :)) 


  We have 3 significant data in PO file:
      1- The original string and its translation; search on msgid&msgstr keywords
      2- Knowing whether or not the string is fuzzy; by searching on this "#, fuzzy" in the header of the current string am parsing on..
      3- The file headers.. for example..at the top of samba file you will see this section and it's existing in each po file:

  # translation of system-config-samba.po to Arabic

  # This file is distributed under the same license as the PACKAGE package.

  # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER.

  # Ossama M. Khayat <okhayat at yahoo.com>, 2004.

  # Maha Helwa <mahahelwa at gmx.net>, 2004.

  # Sherif Abdelgawad <sherif at redhat.com>, 2004.

  # Munzir Taha <munzirtaha at newhorizons.com.sa>, 2004.

  #

  msgid ""

  msgstr ""

  "Project-Id-Version: system-config-samba\n"

  "POT-Creation-Date: 2005-03-09 15:51+0100\n"

  "PO-Revision-Date: 2005-04-10 02:31-0800\n"

  "Last-Translator: maha <mahahelwa at gmx.net>\n"

  "Language-Team: Arabic <fedora-trans-ar at redhat.com>\n"

  "MIME-Version: 1.0\n"

  "Content-Type: text/plain; charset=UTF-8\n"

  "Content-Transfer-Encoding: 8bit\n"



  Only 3 values that are changeable by the time of checkin any PO file:
  > Add the name of the contributor at the end of contributors list and update the value of "last translator" tag or whatever it's called ..
  > Date of Revision.. i don't think every checkin.. when this value is changed?

  So i want to know why i should not treat any PO file just as a normal text file? is it about the encoding? well am not sure but i guess it can be handled from the java side!! decided to read/write any part of PO file with certain encoding "utf-8"? 


  Yareet had yerod.. sherif..what do think?! shall i do it in this way?! 
  FYI.. i did not read the source of kbabel yet.. i get shocked when i tried to look for a piece of code that reads the strings from PO file..which is doing what?! i get lost and frustrated after this try.. i don't remember C.. what a shame!! 

  Maha.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-trans-ar/attachments/20050829/8ed889dd/attachment.htm>


More information about the Fedora-trans-ar mailing list