[Toolserver-l] Toolserver Intuition - Tech spec (Toolserver goes I18N!)

Maciej Jaros egil at wp.pl
Wed Mar 30 22:37:57 UTC 2011


Looks promising, maybe just one question...

Krinkle (2011-03-29 02:46):
> * Fallback languages:
>    If a message is not found in the current user language, a fallback
> will be used. And if that one isn't found English is used.

Do you plan to make the first fallback language set-able by the tool 
developer? Some tools are for certain wikis (in certain language) and 
would be best to have the fallback to the language of the wiki the tool 
was designed for.

I'm not sure if it's a good idea, but did you thought about bulk updates 
of the list of messages? The main problem I'd like to address is making 
a new tool with a lot of new or very specific texts. How would I get 
them translated quickly just for testing? How would I quickly lunch an 
application with main users in one language but with bigger perspectives 
in few months?

BTW. What would be returned if a message is not found? I think a notice 
should be thrown and the message should be returned as is. Meaning 
_('Something to be written') would return 'Something to be written'. And 
the notice probably should be optional (not thrown when testing).

Also I think there has to be some mechanism for overriding some 
variables. This is done on Wikipedia by changing a message on local 
MediaWiki page and it doesn't affect other Wikis. Similarly certain tool 
author could change (should be able to) some message to better suit it's 
tool while leaving the name unchanged. One should be encouraged to 
change the translation on TRLwiki or add a new translation, but I think 
we shouldn't force him to do so.

It was supposed to be one question, but... :-)

> * Variable replacement ($1, $2, etc.)
>
> 	$welcome = $I18N->msg('welcomeback', array( 'variables' =>
> array( $username, $lastvisit ) )
> 	from [[Toolserver:Mytool-welcomeback]] which contains "Welcome back
> $1 (last visit: $2)".

I think named variables work much better then those driven by certain order.

For example:

$welcome = $I18N->msg('Welcome back', array('username'=>$username, 'lastvisit'=>$lastvisit))
[[Toolserver:Mytool-Welcome back]] contains:
"Welcome back {{username}} (last visit: {{lastvisit}})".

Could be shorter but still usable:

$welcome = $I18N->msg('Welcome back', array('u'=>$username, 'v'=>$lastvisit))
[[Toolserver:Mytool-Welcome back]] contains:
"Welcome back %u (last visit: %v)".


Sorry, but one more thing - what about offline (localhost) testing? Will 
there be a downloadable message file?

Cheers,
Nux.



More information about the Toolserver-l mailing list