indico icon indicating copy to clipboard operation
indico copied to clipboard

Add option to translate title and description of categories

Open elsbethe opened this issue 2 years ago • 1 comments

Add the possibility to translate the title and description of categories.

In the settings I've added buttons to create new fields to add a translation for a language

screenshot1

With the button you get a select field to select the desired language and an input field to enter the translation. You can add multiple translations if you click the button multiple times.

screenshot2

When the translations are saved, they appear in the form, so you can always edit them. When you empty the field, the translation is discarded.

screenshot3

When browsing through the categories/events the user sees the title and description of the category in the language he chose, if there is a translation available for that language. If no translation is available, the default title/description is shown.

closes #5353

elsbethe avatar Jul 08 '22 14:07 elsbethe

There's one somewhat tricky issue: In some places we use the chain_titles if a category which contains the titles of the parent category chain (queried in an efficient way). But of course this currently doesn't take into account the i18n you added...

I'm not sure what's the best solution for this, possibly adding an chain_titles_translations property similar to chain_titles where each entry contains the json object with the translations?

ThiefMaster avatar Jul 25 '22 12:07 ThiefMaster