Talk:Pootle

From SME Server
Revision as of 23:20, 28 January 2008 by Cactus (talk | contribs) (More remarks and suggestions :-))
Jump to navigation Jump to search

Thanks Normando, I have my pootle server running, but I'm don't see how to import the language files, have you imported them ?

A lot would come from sourceforge cvs > smeserver > smeserver-locale, but not all

maybe we could trial pootle on contrib translations, say sourceforge cvs > smecontribs > smeserver-vacation

Getting pootle to intergrate to the way SME currently updates files may be difficult I suggest see what the shad and charlie think in your bug 3782

Snoble 05:08, 21 January 2008 (MST)


Hello Snoble
First, I have added a test project, and assign to me and add a few languages. Then, because I am the admin of the project, I can add files to the project to translate.
The only files handle for pottle are PO or POT files. BUT it has a few of converters to make convertions between file.xxx to file.po and revert file.po to file.xxx. One of them converters is txt2po and po2txt (http://translate.sourceforge.net/wiki/toolkit/txt2po) .
Pootle handle directly po files under /usr/share/locale to translate.
I think to make a parser or analizer to convert formmagick panels to txt files, and then to .po, handled with pootle.
See http://translate.sourceforge.net/wiki/toolkit/formats about all converters. I think it is possible to make translations for formmagick panels within pootle.
Thank for the comment snoble
--Normando Hall 11:46, 21 January 2008 (MST)

I need your help

I want to colaborate with SME comunity with a translation system. With Pootle you can upload directly the PO files, those reside at /usr/share/locale. BUT formmagick panel can't, because these files are XML.

The idea is to convert from XML to PO before import in Pootle. To acomplish this, I tried some solutions.

The first is the converters come with Pootle without success (HTML2PO - TXT2PO).

The second is PO4A ( http://po4a.alioth.debian.org/index.php ), again, without success.

You can install enabling ATRPMS repo and install po4a.

To test, at your panels dir /etc/e-smith/locale/en-us/etc/e-smith/web/functions choose one file to translate (ex. backup), and run

po4a-gettextize -f xml -o tagsonly="<trans>" -m backup -p backup.po

Then you can upload the file backup.po in Pootle and translate. Then run the following command to return the PO file to normal XML again.

po4a-translate -k 0 -f xml -o tagsonly="<trans>" -m backup -p backup.po -l new_backup


The last is XML2PO ( http://linux.die.net/man/1/xml2po )

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

Before try, you must edit a few files. The first is /usr/bin/xml2po

Change at line 115 from "charset=UTF-8" to "charset=iso-8859-1"

Then change /usr/share/xml2po/empty.py

Line 27 from "return []" to "return ['base']"

Line 31 from "return []" to "return ['trans', 'A']"

Line 35 from "return []" to "return ['trans']"

Now you can test xml2po.

To test, at your panels dir /etc/e-smith/locale/en-us/etc/e-smith/web/functions choose one file to translate (ex. backup), and run

xml2po -m empty -e -o backup.po backup

View the new bakup.po file in the new PO format. Excelent. 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"?>

Remove this line.

The problem

With xml2po I can convert from formmagick panels to PO, but can't handle tags as CDATA. Try and test the file initial.cig and you can see section CDATA not appear at the PO file.

I have downloaded FormMagick from sourceforge to try if has a tool to extract ALL the text between <trans> and </trans> tags, but I don't know how to do it.

Please, if you can modify xml2po or po4a or formmagick processor to extract these lines and convert to PO, we can make a good online translation system for SME server. If contribs.org can't hosted, I can offer my server to host this system online.

Sorry my bad english.

--Normando Hall 08:31, 24 January 2008 (MST)

Once we have everything worked out how to interact with pootle and the formmagick stuff then I'll get something up on contribs.org that everyone can use. It would be really nice if we could automate the extraction/import of files that need to be translated into pootle but first things first. Slords (talkcontribs). 18:23, 24 January 2008 (MST)

More pootle documentation

Today I had a quick look at the pootle pages and found a wiki as well, which has some valuable information like for instance revision control using CVS/SVN: http://translate.sourceforge.net/wiki/pootle/version_control - Cactus 03:26, 25 January 2008 (MST)

New tool

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.

Before use, you can enable centosplus repo and install "tidy".

Download getpo from http://i18n.linux.net.cn/download/gettext-autowork/getpo-031.tar.bz2

See these address:

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.

Snoble: great about subversion

--Normando Hall 08:21, 25 January 2008 (MST)


Remarks

I would seriously advice you to:

  • not advice users to have them add the real location of the server panel, instead let them download the source from the CVS or download and extract the SRPMs, as the way it is instructed now might lead to problems with the servers.
  • not advertise this system in the forums, unless with a remark that this is a test setup and translations will not end up in SME Server as the system is far from complete for that.
  • use the bug tracker for discussions and findings instead of the Talk pages if implementation for SME Server development is concerned. It seems you already created bugzilla:3782 for that.

Cactus 03:08, 28 January 2008 (MST)


Normondo, your making good progress but the forum posts might be premature, I'd edit them until we have a method for merging the updated translations. Also you are missing a lot of already translated files

the smeserver-locale rpm has almost all sv,it,de,fr,es translated

I'd also heavily edit the two wiki pages,

  • one part explaining how to set up pootle, but being clear that that isn't necessary as they can do translations on your site,
  • The other part how to translate, although this is pretty clear if you use your site.

I don't have a problem with using this page for working out methods, you can re-edit the method so it gets more exact, with 50 posts in a bug report things get lost or confusing


Snoble 03:33, 28 January 2008 (MST)

Thanks for the advice Cactus and Snoble. Sorry for the premature posts.
Cactus, can you modify my posts and add an advice about that? Because your english is better than mine
I have posted at General - Francais - Italian - Dutch - Spanish forums. Of course, I can modify spanish forum :)
Related to PO files, I have upload those PO file are into the source RPM.
If you prefer, while finding a better way, I can close the site.
Snoble, I have granted admin access to your account for testing purposes. Cactus, I don't know if you have registered, but if you want I can granted admin access also to you.
I have now merged the translated files.
--Normando Hall 06:09, 28 January 2008 (MST)
I am sorry Normando, only you (for seven days after posting I believe) or a moderator can modify your posts so I am not able to do so, I think you should do so yourself. I do not have admin access, perhaps you can assign them as I go under the same user name on Pootle as here in the wiki and the forums.
I think your best bet is to edit all forum posts you made yourself (sorry) and perhaps add a banner to the top off your website stating the status of your server being a test server and perhaps also state the consequences for instance:
  • translations not being incorporated in the base
  • not all data of already translated locales is imported into Pootle, only the PO files
Cactus 15:20, 28 January 2008 (MST)