Associate any number of these tags to pages (through a query on a tag, select, etc field)
Translate these tags for each language in the site
But what users don’t want to do is having to add each tag to each page in each language, three of them in this site (a cumbersome process indeed)
They would like to add a tag to a page, and have it added in every language.
Put in another way they expect tags to be linked across languages, as a regular field would be: you create a field in one language, and translate it in the other language, but you don’t have to create each field in each language: they are linked.
But as far as I recall entries in fields such as tags or structure cannot be translated individually. We can add different entries to tags or structure in each language, but they are not linked, so adding a tag to a page won’t add the corresponding tag in a secondary language.
If the tags were static, I could use something like a select field, offering translated options. Although I believe value is not translated, only visible option text, I could nevertheless use language variables to show the correct language in the frontend.
But for dynamic, user-added, tags or categories, I can’t see a workaround.
Create a structure field with fields for the tags in each language. This can be done either in the site blueprint or in the parent page of the pages where the tags are used, up to you depending on use case.
In the page blueprint, where tags should be assigned, use a tags’ field but make it non-translatable (translate: false). This field should query the structure field with the defined tags.
In the frontend, pull in the translations from the structure field.
Find the entry that matches the value and then get the right value. I’d use underscores or just language code for the field names in the structure to make it easier.
fields:
en:
type: text
es:
type: text
ca:
type: text
I am realizing now that a second workaround would be to use either a structure or a tags field to define possible tags, and just ask them to keep the same number of tags in the same order across languages, something like:
fields:
test:
type: tags
help: Keep the tags in the same order across languages
… then using tag order to fetch from each language in the frontend. Although of course this seem much more fragile than your solution.