Date internationalization (for Leonard)
Posted: Sat May 12, 2007 5:57 pm
This is a discussion moved from the wiki, for Leonard Vertighel.
Hi there Leonard! Regarding date internationalization, I've already taken measures for this for the file entry submission dates, which uses the #makedate: parser hook. However, currently the parser hook is extremely basic, and only does English... I've wanted to make it do different languages, but have no idea where to start. The parser hook function is as follows:
It should not be code-wise technically hard to make it do different languages... as long as you figure out how to translate it You can find the language of the request by using $wgLang->getCode() where $wgLang is the global object (add "global $wgLang;" to the function if you want to use it).
If you have any more questions, feel free to ask me
Hi there Leonard! Regarding date internationalization, I've already taken measures for this for the file entry submission dates, which uses the #makedate: parser hook. However, currently the parser hook is extremely basic, and only does English... I've wanted to make it do different languages, but have no idea where to start. The parser hook function is as follows:
Code: Select all
function renderIMSLPDate( &$parser, $year = FALSE, $month = FALSE, $date = FALSE )
{
if( !$year or !$month or !$date ) return 'MKDATEERROR';
else return date( 'F d\, Y', mktime( 0, 0, 0, (int) $month, (int) $date, (int) $year ) );
}
If you have any more questions, feel free to ask me