Translations -- use GNU GetText please

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.2/Rhea followed by 3.3.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.1. If you need support for phpBB 3.1 please visit the 3.1.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Translations -- use GNU GetText please

Post by igorw » Tue Jul 19, 2011 11:25 am

Oh, and you guys may want to look at the docs of the Symfony2 translation component, as this seems like the obvious choice for Symfony2.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Translations -- use GNU GetText please

Post by Oleg » Tue Jul 19, 2011 1:39 pm

igorw wrote: 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?
The usual solution to this is to use more conservative strings in the code and provide an english language "translation", which is something we are already doing.

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Translations -- use GNU GetText please

Post by igorw » Wed Jul 20, 2011 7:39 am

Do you have an example of this? Just curious to see how it looks exactly.

User avatar
Sierron
Registered User
Posts: 62
Joined: Wed Aug 25, 2010 11:41 am
Contact:

Re: Translations -- use GNU GetText please

Post by Sierron » Wed Jul 20, 2011 9:58 am

Just as a question: Why don't you use the same language keys? Isn't the main reason to make it easier to translate things and untranslated things stay in english? I don't see a reason why you just could use the already existing languages keys.

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Translations -- use GNU GetText please

Post by igorw » Wed Jul 20, 2011 12:16 pm

Sure, we could do that. Then you just don't have the side-by-side translation with PO/xliff editors.

User avatar
Sierron
Registered User
Posts: 62
Joined: Wed Aug 25, 2010 11:41 am
Contact:

Re: Translations -- use GNU GetText please

Post by Sierron » Wed Jul 20, 2011 1:23 pm

Yeah, I guess that wouldn't be possible then. Someone mentioned removing translation from the codes so translators could have it easier is in some way false.

If you don't use the language keys and use the normal text instead, you have your templates full of the original english text (even if the languages keys are in some kind of #T#Long Text here.#T# thing (I imagine the original _() or gettext() things wouldn't be used)). Some templates have a massive usage of the language keys or just a big wall of text and moving the english text back into the templates would make it more confusing than it would be helpful. At least that's what i think.

number3nl
Registered User
Posts: 6
Joined: Sun Mar 07, 2010 12:38 am

Re: Translations -- use GNU GetText please

Post by number3nl » Wed Jul 27, 2011 7:59 pm

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?
I'm not sure about Symfony2 way, looked at the translation page of Symphony2 for a bit...

Like I said before, I have been translating a bit for phpBB3 MODs lately, it's still a pain. When I look at the work I've done with WordPress Plugin's, its easy. Even if there is no predefined language file, you can just let POedit parse the plugin folder, discover all language bits that have been "gnuText" prepared. And translate them. In a simple and transparent way.

If there is as similar tool for Symphony2, then fine. If not consider all the work translators have to put in.

The code "_" call for translations is actually not a big issue. It makes it really easy to add a translation after the fact to PHP code... I personally like the shorthand, and transparent calls (unlink the "trans(" and "transChoice(", but then again, that's also very clear for understanding code).

About the key to language, I have yet to run into problems with the plugins for wordpress, but I bet it could.
About language in template files, hé, using tools to extract the "language" and put it in a seperate file works great.
About XLIFF or PO files, as long as it works... it does not matter, the tools matter though... a translator needs to focus on translation, not coding. A developer should have little "fuss" for translations to add.

Hope a better solution then the current "workings" will be used in future releases, like 3.x or 4.x.... Its really hard making translations now, also including them in "MODS" is not as easy as dropping in the translation file... and that's whats counts when you want a "wide" support base, let the non-developers help with translations, make it easy for them to join.

DrAcid
Registered User
Posts: 5
Joined: Thu Jun 09, 2011 5:03 am

Re: Translations -- use GNU GetText please

Post by DrAcid » Mon Sep 05, 2011 9:09 am

@ number3nl
Have I mentioned how great You are? :)

I totally agree with everything You've said!

Besides all the PRO points You've listed before, there's another one:
With gettext, all the translations can be easily created and managed online, on translation portals like launchpad.net or transifex.net!

Of 3.2 had this, it would be a charm!

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1731
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Translations -- use GNU GetText please

Post by DavidIQ » Mon Sep 05, 2011 1:13 pm

FYI the majority of the actual translators, the ones that translate phpBB itself, do not agree with any of you. All they see here is a push to use something new and shinny and different and a way to make their jobs more difficult. Nothing else. You're going to have to do better than "everyone else is doing it so phpBB should do it as well". The online tools thing is a good positive point but a lot of the translators do translations offline so an online tool is useless to them. The use of arrays to indicate groupings is another point brought up, which this does not seem to do.
Image

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Translations -- use GNU GetText please

Post by Oleg » Mon Sep 05, 2011 10:37 pm

Please point your "actual translators" to this topic so that they can offer their views first-hand. Looking at the first page of this topic there are "actual translators" who would prefer gettext to the current way of doing translations.

Post Reply