Recent Topics

1 May 02, 2008 03:15    

Maybe this should be in the Internationalization & Localization forum?

I'm looking at various _global.php files and notice something that I would like to better understand. All of them start off basically the same:

<?php
/*
 * Global lang file
 * This file was generated automatically from messages.po
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

The next bit you see in that file is where I get confused. The package ships with French and German so I'll talk about those, however of the 7 package translations I am looking at 5 do it the French way and 2 do it the German way.

Okay so in the French translation the _global.php file has this for the first bit of the trans array:

$trans['fr_FR'] = array(
	'' => "Project-Id-Version: b2evolution 2.3\nReport-Msgid-Bugs-To: http://fplanque.net/\nPOT-Creation-Date: 2008-03-16 15:39+0100\nPO-Revision-Date: 2008-03-16 15:46+0100\nLast-Translator: Francois PLANQUE <fplanque.net>\nLanguage-Team: François PLANQUE <http://fplanque.net/>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: 8bit\nX-Poedit-Language: French\nX-Poedit-Country: FRANCE\nX-Poedit-SourceCharset: iso-8859-1\n",
	'Categories' => "Catégories",


The German translation does it a bit differently:

$trans['de_DE'] = array('' => 'Project-Id-Version: messages
Report-Msgid-Bugs-To: http://fplanque.net/
POT-Creation-Date: 2008-01-17 00:48+0100
PO-Revision-Date: 2008-01-17 01:20+0100
Last-Translator: dAniel hAhler <daniel@thequod.de>
Language-Team:  <en@li.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Generator: KBabel 1.11.4
Plural-Forms:  nplurals=2; plural=(n != 1);
',
'Categories' => 'Kategorien',

The French method puts all the metadata on one line and surrounds it with double-quote characters. Also each line item of metadata is followed by "\n" before either the next bit or the double-quote character that closes the array element out. Also each actual translated bit is wrapped in double-quote characters.

The German method puts each piece of metadata on a unique line, the \N bits have been stripped out, and the element is wrapped in single-quote characters. Also each actual translated bit is wrapped in single-quote characters.

Therefore I ask: does this stuff even matter, and if so which one is more correct? I am extremely close to a plugin that will facilitate (a) making messages.pot files from properly built plugins and (b) making _global.php files from messages.po that are generated by poedit. I've been doing it the German way because to me it looks better, but who cares when the real point is that plugins be properly translated.

---------------------------

BTW when I have this thing fully functional I'll post a note on it in both the plugins and this forum as both plugin authors and text translators are the target audience. Just a few more details (in addition to this technical point) like how to properly share the end result and hopefully a slightly cleaner interface than I currently have.

2 May 02, 2008 03:25

Oh crap never mind. http://manual.b2evolution.net/Localization#Shortcut says everything I need to know.

It shows the "each bit on it's own line using single quote characters" AND it says I actually only need ONE piece out of all that stuff that shows up AND it says when I figure out a way to package stuff I can ditch everything but the _global.php file for each locale.

It might as well say stop posting stupid stuff in the forums.


Form is loading...