Hi Sam,
thanks for your reply. Yes, it was just a quick proof-of-concept hack which is not ready for production, and it should either be a controller extension or built in basic Controller class, not a separate controller.
IMHO it should not only be an extension to Translatable cause some of us also have non English single language sites. I18N and _t() works without translatable and in a long term every module should have the actions translatable, at least in the lang files.
The “problem” of translatable actions consists of two tasks: Incoming URLs (define translations in $url_handler) and outgoing URLs (translate the action string in every call to Link() method)
Translatable actions now work with actions defined in parent class, I’m always surprised how easy this is to achieve when digging around in Silverstripe’s source looking for methods that addressed a similar problem.
I extended the functionality to also generate “{controller}.urlhandler_{sanitised urlhandler}” for translating the edge cases where we may have already action aliases defined. I don’t know if this is really necessary as it opens a huge hole for destroying url handling in language files. Maybe we shouldn’t generate it automatically…
Do you think $ inside the translation key is a problem?
Outgoing URLs is another problem. How about a static method in controller to translate the action name?
Cheers,
Werner
--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at http://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.