I18n module for Kohana 3
you're right, there's no example of it in readme, but it's no magic really:
echo ___('I\'ve scanned :where and found :what', array( ':where' => ___(':count directories', $x, array(':count' => $x)), ':what' => ___(':count files', $y, array(':count' => $y)), ));
Sure, not as clean looking as the simplest examples, but IMO still better than some insane syntax with inline rules and whatnot :)
I agree, that the parameter order is primarily a matter of preference. I've just found it easier to support
___($string, $context, $parameters, $language) than
___($string, $parameters, $context, $language), here's why:
if the $context parameter is omitted, I can tell by looking at
is_array($context), because in this case, the $parameters are the 2nd. If $context is 3rd parameter and $language the last, I can't tell it as easily, which of them is omitted, because they can be the same type. See init.php on how it works exactly.
So you should be safe to use it the same way as
__() function. Any of these should work:
___($string, $context, $parameters, $language); ___($string, $context, $parameters); ___($string, $parameters); ___($string, $context);
Just note, that the $language parameter has another meaning, than in original
__() function, it is target language instead of source.