Skip to content

How to translate custom fields #320

Answered by AIC-BV
AIC-BV asked this question in Q&A
Sep 21, 2021 · 3 comments · 9 replies
Discussion options

You must be logged in to vote

Finally found a solution to translate custom, extended backend fields.
I searched and tried everything in the documentation and other peoples posts/threads but I couldn't make it work at all.

After several days I found the solution here: https://octobercms.inetis.ch/advanced-repeaters-static-pages-plugin. Thank you Christophe Vuagniaux!

Below the super simple solution, I hope this will help many people out!
All you have to do is add:
$widget->model->translatable = [ 'viewBag[og_title]', 'viewBag[og_description]' ];
You can add as many fields as you want. All the fields will show up, translatable, in each staticPage.

I created a plugin using php artisan create:plugin aic.extendStaticPages

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
7 replies
@LukeTowers
Comment options

@bennothommo
Comment options

@AIC-BV
Comment options

@LukeTowers
Comment options

@AIC-BV
Comment options

Comment options

You must be logged in to vote
1 reply
@LukeTowers
Comment options

Answer selected by AIC-BV
Comment options

You must be logged in to vote
1 reply
@AIC-BV
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants