translation of core files

Jean-Christophe Michel <jc.michel-/aRvmaKoZxNWk0Htik3J/[email protected]> Mon, 02 May 2005 15:43:11 +0200
Newsgroups gmane.comp.lib.binarycloud.devel
Message-ID <[email protected]>
Hi all,

In cvs version (the soon-to-come rc4), there is now a way to translate
all strings for user on the fly, and to prepare core files (binarycloud/
and vortex/) to see developper messages (Log and Exceptions) translated too.

See the #207 on issue list. For those who don't follow issues, here's a
copy. Please help to localize ! Probably bc will be among the first dev
systems that fully handle unicode/utf-8 and that let people see messages
in their own lang!

To see an example of the syntax described below, see Node.php and the
en.xml and fr.xml.
8><--------------------------------

 With the new tool tools/i18n/i18n-translatecore.php it's possible to
 prepare a localized version of binarycloud, for all Log and Exception
 messages.
 To achieve it completely, all php files and lang files have to be
 reviewed:

 ++ String identifiers have to be corrected, with Log and Exception
 prepend:
 {{{
    #Class.Exception_id#
    #Class.Log_id#
 }}}
 has to be corrected into
 {{{
    #Exception.Class.Exception_id#
    #Log.Class.Log_id#
 }}}
 both in the php and in the lang/en.xml file.

 ++ Syntax of exceptions and log lines has to be changed, to have a
 commented string id and an explicit english message, like:
 {{{
    Log::entry(BC_LOG_DEBUG,sprintf(/*#Log.Node.ConstructTree#*/'Creating
 children of Node \'%s\'.', $this->id), __FILE__, __LINE__);
 }}}
 In details, this means:
 {{{
    '#Class.msg_id#'
 }}}
 has to be replaced by
 {{{
    /*#Log.Class.msg_id#*/'Real english message \'%s\'.'
 }}}

 ++ By the way, check that lang/en.xml list matches the really used
 messages in the class.
 Then */en.xml will have to be translated in as many langs as possible, and
 we'll have a fully localized php development tool.

 Nota: this does not require much programmation or xml skills. Anyone
 speaking alittle english can try it, then announce it and call for
 translators!

 The i18n tool is simple to use, simply specify a target dir and it will
 translate all binarycloud and vortex dirs.
-- 
Jean-Christophe Michel
_______________________________________________
dev mailing list
dev-PnctHDZWAvB/Cz2I37pSEPZ4XP/[email protected]
http://lists.binarycloud.com/mailman/listinfo/dev