Lokalize icon indicating copy to clipboard operation
Lokalize copied to clipboard

Lokalize usage example on collection's text field

Open entelostre opened this issue 4 years ago • 2 comments

I would appreciate a minimal clear example of how to use the Localized option in a collection's text field.

Right now, when I set a field's Localization switch to ON, I then can't select a key from the Lokalize Project although I have some keys added.

image

PS. Hello and thanks for the amazing content!

entelostre avatar Nov 28 '20 12:11 entelostre

The localized collection field (Description) that you are working with has no connection to Lokalize as far as I know. Lokalize is a system to create localized strings. We use it to translate elements in our frontend application written in React.

If you want to localize your fields, you have to define a map of languages in your cockpit config, like this: https://zeraton.gitlab.io/cockpit-docs/guide/basics/configuration.html#languages-object-array

Thanks, I already realized that I wrongly connected those two. I currently have a small system of mine for the non-dynamic content of the front-end (which doesn't involve cockpit) but I might switch to this dynamic (through CMS UI user translation). However, I understood how to use the Localize switch in order to have definitions of collection/singleton field values in multiple languages. This link helped me: https://getcockpit.com/documentation/reference/configuration

entelostre avatar Nov 29 '20 12:11 entelostre