Here goes a English post in my blog. Expect changes to this article.
So a few months ago I started to develop an application that allows online translation of software as part of the process of localization. I named it Narro, it is a Latin word. Sadly for you, English speaker, I developed the application for the romanian users, so the app is all in Romanian. No biggie, it can be translated to English. That's a first, I only translate from English to Romanian. So here's an article about it if you're interested.
History
I started translating a few years ago software from English to Romanian. I've seen lots of people want to do that but the tech barrier is damn high, so only a few chosen ones can do it. I've seen I loose a lot of time with the maintenance. On the other hand, I am a open person and want to let absolutely everybody or anybody translate. I've searched. I've found pootle. Great, first run and I already found a great tool I said to myself. I started to translate the actual interface with it. It was great, I kept wanting to translate more. So I liked the idea of „Nexting” through the texts. I download it to use it. It only supports gettext format. It works directly on the files. It crashes. It's written in python, well no biggie, I figured I'll just have to learn Python. I started to configure it and hey, what did I found, it runs as a webserver, so it needs a dedicated port and the process has to remain running. I can't use that with shared hosting, so shish. I've searched again. I've found entrans. Hey, great, this one is in PHP, I can integrate it into a website. I know PHP so I can modify it. Well Search function is rather ackward in this application. It only supports po. The code is really not talking to me. I'm looking at the database. It was better than Pootle handling po files directly. But people wanted to dispute terms, to vote them, to be ranked, to see their own statistics. Search still sucked. Administration sucked. Is there no one on the web that already thought of doing a tool like I wanted? Well, haven't found any, I found myself with a lot of spare time, so I started to work on my own application. And that's history, pal!
What does it do?
It allows anyone to translate with a web browser by simply browsing and typing in. Just create a user and start translating anything. Found something translated wrong? Just hurry to Narro and type in a better suggestion.
It eases the administration part by allowing simply to import directly the file structure from CVS and export it back any time.
With Mozilla it takes en-US as templates, so the formatting, order, special instructions and comments from en-US are kept. If you have no translation for one text, it will export the english text, so no more undefined entity errors cause you forgot to translate something.
Performance
I've built Narro so it can be installed on a regular shared hosting server, so there's no huge loads.
Ajax calls are used intensely so there's no bandwidth issue either.
Tehnical information
The application is meant to handle only one pair of language, one to translate from and one to translate in. So each localization team should have its own installation. Narro is written in PHP5, uses qcodo framework, ZendFramework, Drupal and a MySQL database. Qcodo is used for automatic code generation and for forms data handling. Drupal is used to handle the users. ZendFramework is used for it's Lucene php implementation. You can drop drupal and make it a standalone php application, but you'll have to provide the user registration and administration feature somehow.
Narro works with the following objects so far:
- projects
- files
- texts
- contexts
- suggestions
Files are linked to projects. The hierarchical structure is kept. Each hard file has usually the following fields in some form:
- original text
- translated text
- some context information
For Narro, the original text is the text object. The translated text is a suggestion of translation to a text object. You guessed, the context is the context.
Texts are unique. They are stored separately in a table. With each import of a new file or project, eventually this table will grow.
The real big table is the context table. It links a text to a file. So if a file has 31 texts to be translated, you'll find those 31 contexts in the context table.
Each text can have several suggestions. They are stored separately in a table. They are linked to texts.
Having this approach allows me to delete anytime the context table and the texts and translation suggestions will stay linked. Also this allows sharing the translation efforts among projects and files. So think of the text and suggestion tables as a dictionary. When a user will check up a text from a file, he'll see the available suggestions.
Roles
The app now has 3 roles: admin, user and validator.
A user can:
- see all texts and translation, so there's 100% visibility among the translators
- add translation suggestions with optional comments
- vote existing suggestions
- search suggestions by the original text or by the translated one
A validator can:
- mark a suggestion valid for one context
An administrator can:
- delete suggestions
- import/export files/projects
- create projects
User suggestions are checked with an aspell dictionary, if a spelling error occurs, user gets noticed but can override the warning, they are also checked for entities to make sure that entites were not forgotten and checked for simple punctuation mistakes, extra or forgotten ..., .,! at theend of the text.
Narro currently supports directly dtd files, ini/properties files and OpenOffice sdf format. Anything else can be added with a php class of 100-200 lines.
ToDo
A lot. I got so many ideas. Here's a few:
- implement a glossary solution per project so that new translators get noticed that there's a preferred term translation within the project
- allow offline translation through download and importing back
- do something with the access keys so people don't have to wonder why there's a ~ or an & before a letter in a word
- add gettext po support
Conclusions
I'm not a great documentation writer. But you get the idea. I want to really lower the entry barrier to the software translation world. And I feel sorry for me and other people that waste a lot of time with the files, so I just want to press a button to do everything.
A short update:
I've gone over my head and translated the application in english. There's also a new project set up for anyone to contribute without an account. Go to the narro project list and choose "Firefox 3 (for Narro tests)". Please keep it clean and delete the suggestions you add after you test it.