From: Jesse P. <je...@st...> - 2004-09-06 16:23:34
|
Luca Turlon Donà wrote: >I've spent some time last week to study the approach of gettext, and my >opinion is that we the gettext solution is efficient but has the problem that >the translations can be done without any control, i.e. you simply change a >text file. > > Seems like database could be changed just as easily and that most users who could figure out how to change the file could figure out how to change the db... am I missing something? >I also enlarged the db column containing the label identifier: now it's 100 >chars and can be enlarged again. > > I'm not sure that a DB backend to this is the way to go. That's going to make upgrade scripts a nightmare, plus you a have a whole new table to worry about perfomance on. I'd also worry about your mention to just have all the translations in the $lang[] array. That certainly should not be populated out of the DB on every page load... >As you can understand, using this approach I am addressing your main concern, >which is maintaining the code easy to read. >But also I am addressing my 2 concerns: having the application working at any >time, even during translation, and having a simple way to translate without >the danger of destroying the application. These issues are very important to >me; since I believe that a translator have to be free to see exactly where a >certain sentence appears, in order to deeply understand the meaning and give a >proper translation. A translation with the gettext approach is done without >simultaneously looking at the application. Using my approach you can have one >browser on the application and the other one in the application created for >translation (i.e. some php pages that show the original and let you write the >translation in a form) > > The worst I've seen that may cause a problem is the caching the apache or php supposedly does on strings - I've read many times that you need to restart apache every time you change a PO/MO file... I've never translated anything, but it would seem that between a file of strings and being able to look at the running application, it would not be that hard to do... they would just have to wait to actually see the translations on the page... The strings in the gettext PO files do at least reference the page (and line no if the translator can pick through code)... Real time updating of strings could be hard anyway (once you see the English that come from creating a Purch Order, you will really have no other choice but to create another Purch Order and submit it after the translations are done to see if you changed things correctly). >Now I am trying to solve the problem of parameters within a sentence, and in >particular the fact that the position of parameters can change from one >language to another (see the english-german example in the gettext >documentation).. > > A legitimate concern... you will likely run into the same problems I had testing gettext to handle the same (which was not easily done). An answer on how to do it correctly is likely in the code to the gettext replacement I mentioned a few posts ago, but I have not yet looked through its code to see how they handled it. jesse |