Translate via code (localizable fields) #8863
Replies: 1 comment
-
You can do your translations through a custom controller. Trying to hit one of the control panel routes is not something I'd recommend as it could change at any time. In your controller you can do something like Entry::find($id)
->set('some_field', $someFieldValue)
->save();
None. Only top level fields can be localized. Unfortunately that means the entire replicator field. See statamic/ideas#439 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Code-based Translation:
We want to import translations. Is it possible to use code to translate a Replicator field with sets on a page? Can I achieve this with GET & POST/PATCH requests or through a custom controller? It's essential that only localizable fields are targeted for translation.
Question 2: Data Structure Issue:
I've noticed that when the 'page_builder' (replicator) field is set to 'Non-localizable', its contained fields become read-only, regardless of them being enabled for localizations. How can I determine which 'page_builder' fields can be translated?
Beta Was this translation helpful? Give feedback.
All reactions