Laravel-Backpack/PageManager

Missing i18n - pages are not translatable

lloy0076 opened this issue · 3 comments

It appears that i18n is missing for this package!

This would be a relatively "easy" first PR as it really involves little change to the actual code structure!

I've started a new project and I still learn the whole Backpack with it's managers. So far so good, but it miss a functionality for multi languages. So, is there any progress with the PageManager to have i18n or at least can somebody help how to achieve this?

@tabacitu should we provide an easy way for developers to have translatable fields on their side?
I do this on my projects by having an "extras_translatable" field on pages database. The field is translatable, so when I want to have a translatable field I just do "store_in" => "extras_translatable".

Should we add this by default on the package?

I think translatable pages are out-of-scope for this package. That's because:

  • I believe 99% of websites don't need translatable pages. And out of the 1% that do, at least 50% don't actually need them, it's just a client requirement, with the end result that some pages will become out-of-date and untranslated very fast after launch (because of the admin, not the dev); at least that's my experience with creating translatable websites 😂 in theory they're great, in practice most of the time we should teach clients that they won't maintain them so they should save the money spent on creating them;
  • This package really isn't a full-fledged solution for managing front-end pages; it's more of a proof-of-concept; it works for super-simple websites, but it will not fit more complicated needs; not just because of the lack of translatable support, but because of the architecture itself - if a page template needs dozens of fields to be edited, it won't be a pretty experience for the admin; it can be made better using ->size() but it'd still require back-and-forth between the page and the Edit screen;

That's why I say I'd rather not add translatable to this package. I do agree we should instruct people on how to do so, though. Either here as a comment, or in the README.

Sorry guys, I don't think this is worth doing. Let me know if you disagree - I'm wrong all the time too.
Cheers!