Monday, August 24, 2009

The final changes

GSoC is finished and I have been told that I have passed :)

Changes done before the deadline include:

1. The scripts have been moved to website/ and changed so that you don't have to configure them with the location of the files.

2. I added a line in the Makefile so that you can run make translations to write the translated documents before building and pushing the website.

3. I wrote a HOWTO that gives a quick introduction to pot, po, wml and Pootle, as well as explain how to convert existing translations, update current translations and write the translated documents.

4. I updated the README with a list to check if something goes wrong.

Monday, August 3, 2009

Logging in wml2po

To keep track of the files that, for one reason or another, could not be processed by wml2po, the script writes the filenames to a logfile. I am not sure whether or not logging will be of any use in po2wml. I mean, if a file have been converted to pot, there shouldn't be a problem with converting it back to wml.

Time to work on the documentation.

Sunday, August 2, 2009

Changelog: wml2po

A few things have happened since I last updated my blog. The biggest change is that wml2po no longer converts to .po, but to .pot, and it doesn't convert for all available languages, just English.

A way to handle translation priority was added to the code last week. The script checks the translation priority of the .wml to determine the filename of the .pot. If the .wml doesn't have a translation priority set, the script assumes that the file doesn't need to be translated.

Tuesday, July 28, 2009

Translation priority

A while back, Roger and I talked about the translation priority used in the wml files and how this could be carried over to the po files. The idea is that Pootle will sort the files after translation priority, giving new translators an idea of where to begin.

I have started to work on a solution for this. The plan is to read the translation priority from the wml file and include this in the filename for the po file. Take bridges.wml as an example. This file has the translation priority "1-high", so the resulting po will be named 1-high.bridges.po.

Then there's the small details that need to be taken care of. What if the script is looking for 2-medium.bridges.po, but only 1-high.bridges.po exist? This can be the case if someone decides to change the translation priority for that file. Or what if the file simply hasn't been converted to po yet?

Monday, July 27, 2009

Testing of wml2po and po2wml

I have tested wml2po and po2wml again, and like last time I made sure that Pootle was poked at the right time, that I could translate files using Pootle and commit without problems.

I'm glad to say that everything worked just as I expected; wml2po converted all of the files to po, and po2wml convert the translated files back to wml again.

Sunday, July 26, 2009

Different directory structure

The website directory in svn has the following structure..
website/en/*.wml
website/de/*.wml
website/docs/en/*.wml
website/docs/de/*.wml
.. and I always thought that having the same structure in the pootle project directory would be possible..
translation/projects/website/en/*.po
translation/projects/website/de/*.po
translation/projects/website/docs/en/*.po
translation/projects/website/docs/de/*.po
.. but yesterday I found out that pootle does not accept any directory, directly under the project directory, other than a language directory. So I had to come up with a solution for a different directory sturcture. This is the result:
translation/projects/en/*.po
translation/projects/de/*.po
translation/projects/en/docs/*.po
translation/projects/de/docs/*.po
The structure of the website directory in svn remains the same.

So, the plan for tomorrow is to go through the 7 steps again and make sure the whole process works nicely.

Tuesday, July 21, 2009

Todo for po2wml

Use both po4a-gettextize and po4a-updatepo
If a .po file does not exist, use po4a-gettextize to create it, set the right encoding and charset as well as the correct copyright. Nicolas François said that he would add this functionality to po4a-gettextize. However, if the .po file does exist, simply use po4a-updatepo to update if the .wml has changed.

Use the current .wml if that is more complete than the .po
The nice thing with po4a-translate is that it will only write the translated .wml if 80% (the default value) or more has been translated. The not-so-nice thing with po4a-translate is that it will delete the .wml if less than 80% has been translated.

My suggestion for dealing with this is the following: use po4a-translate to write the file $lang-$file.wml. If that file was actually written, rename the file to $file.wml.

Document it
This isn't just for po2wml, but I should write a README explaining the basics.