Hello all
while looking at possibilities for web based translation tool, I (again) started to think about switching to gettext based system from current string based. The good thing is that the migration should not be hard (I already migrated one small PHP project to gettext).
Pros: - standard format, what means that translators can use translation editors or other tools - support for fuzzy translations - when we have to change English text, translators will know this and translation can be also fixed - support for plural forms - texts are directly in place where they are used - not used strings will be automatically dropped
Cons: - gettext extension in PHP is bad, we would have to use implementation in PHP (we can use http://savannah.nongnu.org/projects/php-gettext/) - more complicated releases/SVN deployment - you have to compile po files to binary form
What do you think?
In case we decide to switch I volunteer to do the migration.
Michal Čihař a écrit :
Hello all
while looking at possibilities for web based translation tool, I (again) started to think about switching to gettext based system from current string based. The good thing is that the migration should not be hard (I already migrated one small PHP project to gettext).
Pros:
- standard format, what means that translators can use translation editors or other tools
- support for fuzzy translations - when we have to change English text, translators will know this and translation can be also fixed
- support for plural forms
- texts are directly in place where they are used
- not used strings will be automatically dropped
Cons:
- gettext extension in PHP is bad, we would have to use implementation in PHP (we can use http://savannah.nongnu.org/projects/php-gettext/)
- more complicated releases/SVN deployment - you have to compile po files to binary form
What do you think?
In case we decide to switch I volunteer to do the migration.
Hi Michal, Would this have an impact on performance, for example? And what about you wrote previously: ---------- [*] I'd really prefer to migrate to gettext based solution for phpMyAdmin, but this seems unlikely, mostly because gettext as integrated in PHP is quite painful. Once you load translation, it is kept opened and any changes in the file lead to segfault and any replacing of the file is deleted. So the only way to make it see updated translation is to restart PHP (or Apache if you use mod_php). ----------
Marc
Hi
Dne Tue, 09 Jun 2009 08:38:22 -0400 Marc Delisle marc@infomarc.info napsal(a):
Would this have an impact on performance, for example?
Nothing measurable as far as I know.
And what about you wrote previously:
[*] I'd really prefer to migrate to gettext based solution for phpMyAdmin, but this seems unlikely, mostly because gettext as integrated in PHP is quite painful. Once you load translation, it is kept opened and any changes in the file lead to segfault and any replacing of the file is deleted. So the only way to make it see updated translation is to restart PHP (or Apache if you use mod_php).
Yes, that's why I do not propose to use gettext extension in PHP.
Michal Čihař a écrit :
Hi
Dne Tue, 09 Jun 2009 08:38:22 -0400 Marc Delisle marc@infomarc.info napsal(a):
Would this have an impact on performance, for example?
Nothing measurable as far as I know.
And what about you wrote previously:
[*] I'd really prefer to migrate to gettext based solution for phpMyAdmin, but this seems unlikely, mostly because gettext as integrated in PHP is quite painful. Once you load translation, it is kept opened and any changes in the file lead to segfault and any replacing of the file is deleted. So the only way to make it see updated translation is to restart PHP (or Apache if you use mod_php).
Yes, that's why I do not propose to use gettext extension in PHP.
I feel that this was discussed before, but anyway... can you give an example of what would happen with code like this:
zero_rows=<?php echo urlencode(sprintf($strFieldHasBeenDropped, htmlspecialchars($row['Field']))); ?>"
Also, I guess that there would no longer be source message files in the download kit?
Marc
Hi
Dne Thu, 11 Jun 2009 03:20:41 -0400 Marc Delisle marc@infomarc.info napsal(a):
Michal Čihař a écrit :
Hi
Dne Tue, 09 Jun 2009 08:38:22 -0400 Marc Delisle marc@infomarc.info napsal(a):
Would this have an impact on performance, for example?
Nothing measurable as far as I know.
And what about you wrote previously:
[*] I'd really prefer to migrate to gettext based solution for phpMyAdmin, but this seems unlikely, mostly because gettext as integrated in PHP is quite painful. Once you load translation, it is kept opened and any changes in the file lead to segfault and any replacing of the file is deleted. So the only way to make it see updated translation is to restart PHP (or Apache if you use mod_php).
Yes, that's why I do not propose to use gettext extension in PHP.
I feel that this was discussed before, but anyway... can you give an example of what would happen with code like this:
zero_rows=<?php echo urlencode(sprintf($strFieldHasBeenDropped, htmlspecialchars($row['Field']))); ?>"
sprintf(_('File %s has been dropped.'), htmlspecialchars($row['Field']))
Also, I guess that there would no longer be source message files in the download kit?
It can be, but it does not have to be.
Michal Čihař a écrit :
Hi
Dne Thu, 11 Jun 2009 03:20:41 -0400 Marc Delisle marc@infomarc.info napsal(a):
Michal Čihař a écrit :
Hi
Dne Tue, 09 Jun 2009 08:38:22 -0400 Marc Delisle marc@infomarc.info napsal(a):
Would this have an impact on performance, for example?
Nothing measurable as far as I know.
And what about you wrote previously:
[*] I'd really prefer to migrate to gettext based solution for phpMyAdmin, but this seems unlikely, mostly because gettext as integrated in PHP is quite painful. Once you load translation, it is kept opened and any changes in the file lead to segfault and any replacing of the file is deleted. So the only way to make it see updated translation is to restart PHP (or Apache if you use mod_php).
Yes, that's why I do not propose to use gettext extension in PHP.
I feel that this was discussed before, but anyway... can you give an example of what would happen with code like this:
zero_rows=<?php echo urlencode(sprintf($strFieldHasBeenDropped, htmlspecialchars($row['Field']))); ?>"
sprintf(_('File %s has been dropped.'), htmlspecialchars($row['Field']))
Also, I guess that there would no longer be source message files in the download kit?
It can be, but it does not have to be.
Have you tried the implementation of gettext in PHP (not the extension)? Latest version seems to be 1.0.7 dating more than 3 years ago.
Marc
Dne Thu, 11 Jun 2009 03:46:43 -0400 Marc Delisle marc@infomarc.info napsal(a):
Have you tried the implementation of gettext in PHP (not the extension)? Latest version seems to be 1.0.7 dating more than 3 years ago.
Yes I did some tests and it seems to work fine.
Michal Čihař a écrit :
Dne Thu, 11 Jun 2009 03:46:43 -0400 Marc Delisle marc@infomarc.info napsal(a):
Have you tried the implementation of gettext in PHP (not the extension)? Latest version seems to be 1.0.7 dating more than 3 years ago.
Yes I did some tests and it seems to work fine.
Is there any other requirement on the OS side or everything would be done in PHP?
For example, on http://en.wikipedia.org/wiki/Gettext I read "The user, on Unix-type systems, sets the environment variable LC_MESSAGES, and the program will display strings in the selected language, if there is an .mo file for it."
Marc
Dne Thu, 11 Jun 2009 03:58:49 -0400 Marc Delisle marc@infomarc.info napsal(a):
Michal Čihař a écrit :
Dne Thu, 11 Jun 2009 03:46:43 -0400 Marc Delisle marc@infomarc.info napsal(a):
Have you tried the implementation of gettext in PHP (not the extension)? Latest version seems to be 1.0.7 dating more than 3 years ago.
Yes I did some tests and it seems to work fine.
Is there any other requirement on the OS side or everything would be done in PHP?
No, everything can be done in PHP.
Michal Čihař a écrit :
Dne Thu, 11 Jun 2009 03:58:49 -0400 Marc Delisle marc@infomarc.info napsal(a):
Michal Čihař a écrit :
Dne Thu, 11 Jun 2009 03:46:43 -0400 Marc Delisle marc@infomarc.info napsal(a):
Have you tried the implementation of gettext in PHP (not the extension)? Latest version seems to be 1.0.7 dating more than 3 years ago.
Yes I did some tests and it seems to work fine.
Is there any other requirement on the OS side or everything would be done in PHP?
No, everything can be done in PHP.
I guess you have the green light, I hope you have a way to automate the changes.
Is 3.3 the target for this?
Also, will we have tools equivalent to check_lang.sh and sort_lang.sh?
Marc
Hi
Dne Thu, 11 Jun 2009 04:09:02 -0400 Marc Delisle marc@infomarc.info napsal(a):
I guess you have the green light, I hope you have a way to automate the changes.
Sure, I'm not going to do that much of work manually ;-).
Is 3.3 the target for this?
Yes.
Also, will we have tools equivalent to check_lang.sh and sort_lang.sh?
Yes, gettext does this.