Category Archives: translation

Zend_Translate: further separate content from code + avoid doublon in source language

There something I am not comfortable with Zend_Translate_Adapter behavior, it’s the fact that source string is used as key for translation array. To me it looks like mixing css and html within the same file, I prefer having css in dedicated files and html in dedicated files too. Here my approach is the same. Since content is translated in multiple languages (using translation tools => therefore stored in dedicated files), I don’t want to have it anymore within my php file. I find current implementation too risky. Let’s take a simple example: I have a single sentence, both in French […]

Zend_Translate: mixing translated content with code

I’m currently writing a multilingual application using Zend framework. This framework is very great, it’s well thought and use most of industry’s best practices. To handle translations, well I’ve used Zend_Translate component, and to go into further details I’ve used Xliff adapter. I am a complete newbie regarding translation management, so my analysis can be completely wrong. But so far, I am not comfortable at all with Zend_Translate approach. Below is Zend approach: // we create $translate instance $translate = new Zend_Translate(‘xliff’, ‘/my/path/source-de.mo’, ‘de’); $translate->addTranslation(‘//my/path/fr-source.mo’, ‘fr’); // later in our view script print $translate->_(“Here is line one !”); and here […]

I cannot submit my translation with pootle

Pootle has a rights-management mechanism. It’s possible that you’re capable of viewing content to be translated, even to click on edit and enter text, but if you don’t see “submit” button, it simply means you’ve no right to submit translation (i.e. you’re not considered to be a translator). In this case: contact the website administrator (or login as admin if it’s you) go to the admin page go to the projects admin page click on the project name for which you want to set permissions click on the language for which you want to set permissions add permissions for your […]

translate-toolkit: html2po converter

Html2po converter is used to extract content to be translated, using an html file as input and return a po file as output, format used by translation management softwares (like Pootle). Problem is sometimes html is not correctly parsed on some html nodes appear when they sould not. As seen in previous post on Pootle, we generate .pot files that pootle will use as template and automatically generate .po files for each translation language. Good news is that .pot file is just text (it’s python code) => you can edit it with a simple text editor. Therefore, if you spot […]

How to add files for translation to Pootle projects?

In this section, we will try to explain how to add files for translation to pootle projects. I am very new to Pootle, so it may not be the regular way to do it, but I’ve spent one entire day looking for clear explanations / guides, without finding any so I tried to do it on my own, with a trial-and-error approach. For this example, we consider we want to translate an existing html (to_translate.html) file using Pootle. We consider also that we’ve created an administrator account we can log into, along with a dedicated pootle project that will host […]

How to create Pootle projects?

We will try to explain how to create new translation projects using pootle. For now, it will be very simple projects, without svn repository. First go to your Pootle server and log in as admin (see previous post on Pootle installation if you don’t know how to do it) On top menu, click on “admin” link click on “projects” link You can remove both Pootle and Terminology projects, since they are generic / examples and do not correspond to any concrete project, and create your new project using provided interface: “project code” is used in url “full name” is displayed […]

How to install Pootle?

First install Pootle: “sudo apt-get install pootle” (it will install translate-toolkit as well) Then you must launch a pootle server, run “sudo PootleServer”, it will load pootle on port 8080 (if it is already in use by another program, then specify your own port with -P option) Connect to Pootle with your web browser, at the following url: http://127.0.0.1:8080 (change 8080 to your running port) Be aware, Pootle does not work properly on Opera (=> FF seems ok) At this point you should see Pootle home page First you need to create an account => click on Register on the […]

How does Pootle work?

Pootle looks like a great tool, it’s used in a lot of translation projects… but regarding documentation, it’s like hell! I’ve spent an entire day trying to find out to add files into projects for translating them. I will try to explain what I understood from pootle. First Pootle in itself is just a translation interface, written in python, accessible via a web browser. All file format handling is done by another project, Translate-toolkit, also handled by Pootle team. You use translate-toolkit to translate files into required formats (for example from html format to pootle format, and once translation is […]

Zend_Translate xliff bugs / limitations

I find Zend Framework to be very great for php developments. Its api doc is of high quality and its ref manual is not bad. Once you’re used to it, it speeds up your developments a lot, but above all makes them easier to maintain. Another great point of using this framework is that it helps you benefit from industry standards you may not know. For instance I wanted to translate my website (www.qc4web.com) both in English and Spanish. At first I thought defining PHP constants and include correct file depending on which language is active. I’m pretty sure it […]