Closed adrianug closed 8 years ago
I used php ar in a similar way for translations, and never been really satisfied. From what I've learned, translatable content is always complicated, especially when a cms and end-users come into play (should images be the same on all languages, are all languages populated, should it fallback).
So for me there hasn't been a true solution just yet..
I'm going to echo @koenpunt's comment here: I don't think there's a single, comprehensive solution to il8n that would appease all users. I don't think it's the purpose of this library to offer such support; your application/product's needs will drive the implementation for il8n.
One further comment: in your example, I think it would be best to pass your models thru to a view presenter/decorator which manages il8n rather than adding this feature to AR itself.
I'm looking for the best way to work in multi-language website
A little complex to retrieving and storing, i want to write less code, like
$page = Page::find(...); $page->translate('en')->name; // hallo
and$page = Page::find(...); $page->translate('fr')->name; // bonjour