mrmonat / nova-translatable

Nova Field for spatie/laravel-translatable package.
81 stars 26 forks source link

Language switcher #9

Closed devmsh closed 6 years ago

devmsh commented 6 years ago

It's nice to have the index text displayed by default using the app()->getLocale()

What about having a language switcher card? so the admins can easily switch the language?

I don't now if Nova table offer better customization options to include the language switcher before or after each table, but at least the switcher card can help overcome the problem right now?

mrmonat commented 6 years ago

I think a language switcher card is out of scope of this package, because it is not possible for a "Field" Package to add something before or after the table.

To make a language switcher card you would need to create a separate "card" package (https://nova.laravel.com/docs/1.0/customization/cards.html#overview) to globally change novas current locale.

I hope nova will add support for url prefixes soon, so you can integrate Nova with url localization (e.g. /en/nova, /de/nova, /fr/nova) to show different locales based on the url.