phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

Translations -- use GNU GetText please

Discuss the future of phpBB. It is still nesting in its mother's womb, but it will grow a little bigger each day. Participate in its design & planning here.

Translations -- use GNU GetText please

Postby Jhong » Tue Aug 31, 2010 5:51 am

I did a search and didn't find anything recent relating to the phpBB translation process.

As a mod author, I find the translation system really grating:
- I have to keep track of constants across multiple files.
- As translations go out of date, the templates fall back to showing constants rather than the English equivalent.
- There are no good third-party tools for the phpBB translation system; why should translators have to learn PHP array syntax (however simple it may be?)

Not sure if Symfony will provide an in-built translation system, but I'd like to voice my support for the (pretty much industry-standard) gettext.

- As a developer, simply __('enclosing my strings like this') is easy and painless.
- For translators, they can use a multitude of tools to help them with the translation, including online tools like launchpad.net.
- When translated strings are missing, the original string is shown.
- The distribution and activation of language packs / files is effectively the same as it is now

I'd love to see this change.

J
Jhong
Registered User
 
Posts: 50
Joined: Tue Dec 26, 2006 3:28 pm

Re: Translations -- use GNU GetText please

Postby Oleg » Fri Sep 03, 2010 6:31 am

I am working with gettext in another project which is currently in early stages of development.

Gettext has many features, no doubt due to its maturity and wide user base. One feature in particular that most "roll my own" internationalization frameworks do not offer is proper support for inflections. There are facilities for specifying the number of inflection forms each language supports, the formula for figuring out which form should be used given a number/quantity, all in a concise format.

I cannot yet endorse gettext entirely simply because I have not used it enough, but I agree that it is a good option to consider.

In terms of practically using it I would be most concerned with its penetration among hosting providers. Since somewhere between many and most phpbb users do not administer their servers relying on an extension which is not widely available probably will not be acceptable.

How about this note from http://www.php.net/manual/en/gettext.requirements.php:
The GNU gettext library works on a per-process, not per-thread basis. This means that in a multi-user setting such as the Apache web server it will only work with a prefork MPM (i.e. one process per user). Worker and other threaded MPMs will not work.


Or user notes on http://www.php.net/manual/en/ref.gettext.php.

Php's execution model once again demonstrates a poor fit with large projects.
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Re: Translations -- use GNU GetText please

Postby Jhong » Wed Sep 08, 2010 4:43 am

there are php classes/libraries you can use for gettext if gettext isn't compiled into PHP itself. I think that's how WordPress does it.
Jhong
Registered User
 
Posts: 50
Joined: Tue Dec 26, 2006 3:28 pm

Re: Translations -- use GNU GetText please

Postby RonnyO » Mon Nov 15, 2010 10:01 pm

String looks promising, we'd like to test it soon for managing the Hebrew language pack. Any other translators here want to give it a try?

We do need to remember l10n is more than strings - Think calendars, RTL, typography, graphics etc.
But maybe String can do the job... at least for strings.
RonnyO
Registered User
 
Posts: 1
Joined: Mon Nov 15, 2010 8:52 pm

Re: Translations -- use GNU GetText please

Postby Kudlaty » Thu Nov 18, 2010 8:56 am

symfony already use gettext :)
User avatar
Kudlaty
Registered User
 
Posts: 4
Joined: Fri Oct 22, 2010 7:31 am

Re: Translations -- use GNU GetText please

Postby DrAcid » Sun Jun 12, 2011 7:27 pm

:idea:
Yes! Please, use gettext! it is amazingly useful and working with it is a breeze!
You can actually setup the translation process over web as well as offline!

I'm sorry but the translation process is a pain right now. especially making changes to lang files as new versions come out... :arrow:

And it works even better than just keeping strings in an array in a .php file :)
DrAcid
Registered User
 
Posts: 5
Joined: Thu Jun 09, 2011 5:03 am

Re: Translations -- use GNU GetText please

Postby number3nl » Sun Jul 17, 2011 9:06 am

+1 for this proposal!!!

As a MOD translator (ea. Anti-SPAM ACP, Download MOD [from phpBB2.x onward from time to time]) I find that phpBB is a hard to translate, not because of language ofcourse. I have been working with phpBB for over 5 years now, and from time to time I have to upgrade. The reason why I fear upgrade with phpBB, they will always give me work. Work as a PHP hacker and work in my translations. MODs are even worse in that regard, since most MOD authors don't think about the translations at all.

I have been working with wordpress for over 2 years now, and I have to say it's a breeze maintaining both code and translations.

With Wordpress they use GNUtext, it seperates the "language" from the coding. No longer I work in "PHP code" files I have to hunt down in places in the code tree of the program. I just use POedit, I scan the plugin directory (yes, more room for improvement for phpBB, all code of a plugin is located in a single directory!.

This means that I can focus on a correct translation, but putting a translation file into the language directory the translation is done. Without touching php code, meaning I cannot break the plugin (mod) or software I work on.

So pro's for a translator:
1. Work on translating, instead of PHP code. Code and Text are seperates resources.
2. Do'nt worry about "coding" your translation into PHP correctly (if you do make mistakes now it breaks the code, and is hard to find).
3. No hunting for php files with "text" that need translation, POedit helps you there, it finds text.

One improvement for MODs would be that they stay in a single directory. Instead of having a single "language" directory, every MOD should have it's own language. Now I know this might give some performance issue, but I would improve on more then just translation. I mean having to hunt for phpBB code, to find the code that belongs, to "patch" instead of "plugin". I noticed that there is a lot of talk on moving toward a more plugable codebase. DO THAT!

I also coded on a plugin that connects phpBB3 and wordpress, in the form of a widget (recent_posts_phpBB3). From that I learned that its simple to implement for a developer, so simple its hard to agrue not using it :D

Pro's for developer:
1. Easy of implementation, it's adding some simple libs and statements to your code, but not intrusive. No lookup's in the code, you code like you normally do.
2. Seperate the code from the text, making it simple for the translators.
3. More translations can be added, simply by adding the translation files.

O, right, and all the talk on performance. I have seen wordpress on large sites, it works. It performs. Lets look at other projects, like wordpress how they use GNUtext...

Please add GNUtext to a future release, its good for the phpBB ecosystem. Its good coding practice, and, it will give more people the possibility to giveback doing translations.
number3nl
Registered User
 
Posts: 6
Joined: Sun Mar 07, 2010 12:38 am

Re: Translations -- use GNU GetText please

Postby Maël Soucaze » Tue Jul 19, 2011 1:32 am

Definitively a good system, a +1 from me!
MAËL SOUCAZE • STYLES TEAM MEMBER • TRANSLATIONS & INTERNATIONAL SUPPORT TEAMS MANAGER
STOP ACTA! HTTP://WWW.STOPACTA.INFO/
Maël Soucaze
Registered User
 
Posts: 17
Joined: Thu Jul 07, 2005 7:45 am
Location: France

Re: Translations -- use GNU GetText please

Postby igorw » Tue Jul 19, 2011 6:42 am

Kudlaty wrote:symfony already use gettext :)

I'm not sure what symfony1 does, but Symfony2 does not use gettext. It has a custom parser for the XLIFF format. There are however tools to convert between PO and xliff.

One of the things I don't like about these is that you no longer have a 'language key' for translation. This means your 'key' is the sentence itself, and if it ever changes, you have to change it in ALL language files. Correct? How do others deal with this?
User avatar
igorw
Registered User
 
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Translations -- use GNU GetText please

Postby callumacrae » Tue Jul 19, 2011 7:07 am

igorw wrote:
Kudlaty wrote:symfony already use gettext :)

I'm not sure what symfony1 does, but Symfony2 does not use gettext. It has a custom parser for the XLIFF format. There are however tools to convert between PO and xliff.

One of the things I don't like about these is that you no longer have a 'language key' for translation. This means your 'key' is the sentence itself, and if it ever changes, you have to change it in ALL language files. Correct? How do others deal with this?

That doesn't sound very backwards compatoble :?

I also don't like "__" as a function name.

~Callum
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 882
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Next

Return to [4.x] Discussion

Who is online

Users browsing this forum: No registered users and 5 guests