Changes

From SME Server
Jump to navigationJump to search
916 bytes added ,  08:21, 2 February 2008
Line 9: Line 9:     
== Formagick ==
 
== Formagick ==
I have found a good tool (getpo) for convert HTML to PO and revert. The best is you can customize to handle xml tags. It has use TIDY lib.
+
Normando suggested a few tools, I'm using XML2PO, see the others in the history
 +
http://wiki.contribs.org/index.php?title=Talk:Pootle&oldid=7649#I_need_your_help
   −
Before use, you can enable centosplus repo and install "tidy".
+
===XML2PO===
 +
( http://linux.die.net/man/1/xml2po )
   −
Download getpo from http://i18n.linux.net.cn/download/gettext-autowork/getpo-031.tar.bz2
+
I have packaged for a better installation. You can download from  
 +
http://mirror.contribs.org/smeserver/contribs/nhall/sme7/contribs/pootle/rpm/gnome-doc-utils-0.12.0-1.noarch.rpm
   −
See these address:
+
Before try, you must edit a few files.  
http://mail.gnome.org/archives/gnome-i18n/2004-March/msg00070.html
  −
http://tidy.sourceforge.net
  −
http://www.w3.org/People/Raggett/tidy/
  −
http://tidy.sourceforge.net/docs/quickref.html
     −
I want to play with it to finally convert formmagick panels to PO correctly.
+
The first is /usr/bin/xml2po
 +
:Change at line 115 from "charset=UTF-8" to "charset=iso-8859-1"
   −
===progress===
+
Then change /usr/share/xml2po/empty.py
Is this working manually yet Normando ?
+
:Line 27 from "return []" to "return ['base']"
 +
:Line 31 from "return []" to "return ['trans', 'A']"
 +
;Line 35 from "return []" to "return ['trans']"
   −
:Not yet because I need help from a python or perl specific programmer. Anyway I can playing with these converters.
+
===Create .po===
:--[[User:PicsOne|Normando Hall]] 08:21, 25 January 2008 (MST)
+
Now you can test xml2po.
 +
 
 +
To test the lexicons
 +
xml2po -m empty -e -o backup.po backup
 +
 
 +
View the new bakup.po file in the new PO format. Excellent. Now you can translate PO with pootle, and return again to formmagick panel with this command:
 +
 
 +
xml2po -p backup.po backup > new_backup
 +
 
 +
As you can see, if you not translate backup.po, new_backup file is equal to original backup file, BUT with one diference. new_backup file has added at the header:
 +
 
 +
<?xml version="1.0" encoding="utf-8"?>
 +
 
 +
Do we have to remove this line. ?
 +
 
 +
===bugs===
 +
xml2po ignores tags as CDATA, CDATA does not appear at the PO file.
 +
 
 +
The workaround is to find and replace the problem code, add more to the list if you find them
 +
 
 +
Using a sample panel yum2
 +
perl -pi -e 's/<!\[CDATA\[/STARTCDATA/g' yum2
 +
perl -pi -e 's/\]\]>/ENDCDATA/g' yum2
 +
perl -pi -e 's/\&/AMP/g' yum2
 +
 
 +
Or delete CDATA if the tag doesn't really require it (for contribs)
 +
 
 +
===problems on pootle===
 +
Newlines aren't clear
 +
 
 +
the pootle edit box is tiny !!
    
== revision control using CVS/SVN ==
 
== revision control using CVS/SVN ==

Navigation menu