Ticket #860 (closed defect: fixed)
Prado::localize() bug
| Reported by: | japplegame | Owned by: | xue |
|---|---|---|---|
| Priority: | low | Milestone: | 3.1.3 |
| Component: | Prado Framework v3 | Version: | 3.1 |
| Severity: | minor | Keywords: | |
| Cc: |
Description
Prado version 3.1.2 Prado::localize() ignores current value of Application.Globalization.TranslationCatalogue property For example: Content of Index.page
<%@ Application.Globalization.TranslationCatalogue="mycat"%> <com:TTranslation Text="Sample text"/><br/> <%[Sample text]%>
TTranslate gets translated text from "mycat" catalogue. That's right. Prado::localize ignores <%@ Application.Globalization.TranslationCatalogue?="mycat"%> directive and gets translated text from default catalogue "messages".
I have changed PradoBase.php and bug has gone. But i am not shure that it is right solution. Diff:
Index: framework/PradoBase.php =================================================================== --- framework/PradoBase.php (revision 2463) +++ framework/PradoBase.php (working copy) @@ -572,11 +572,11 @@ if($app===null || ($config = $app->getTranslationConfiguration())===null) return strtr($text, $params); - Translation::init(); - if(empty($catalogue) && isset($config['catalogue'])) $catalogue = $config['catalogue']; + Translation::init($catalogue); + //globalization charset $appCharset = $app===null ? '' : $app->getCharset(); @@ -587,7 +587,7 @@ if(empty($charset)) $charset = $appCharset; if(empty($charset)) $charset = $defaultCharset; - return Translation::formatter()->format($text,$params,$catalogue,$charset); + return Translation::formatter($catalogue)->format($text,$params,$catalogue,$charset); } }
Change History
Note: See
TracTickets for help on using
tickets.
