This plugin adds possibility to display translatable fields grouped into tabs by locales using translations formwidget.
Can be also used in theme options form just by adding _translations field in the config (see the Documentation for example).
If you got a lot of translatable fields in a form it could be more convenient to switch all the fields locale at once rather then switching every field.
You may like my other plugins
- Front-end hierarchic roles - Allows to manage access rights based on roles hierarchy
- Excel - excel import-export tools
- JWT Auth API - Token Authentication for API integrated with RainLab.User
- Blog Views - Enables blog posts views tracking and displaying popular articles.
These plugin(s) are required for the plugin:
In model class you need to add 'Vdomah.TranslateTabs.Behaviors.TranslateTabbable' behavior to $implement array besides TranslatableModel behavior. Then define translatable attributes as you would do usually with Translate plugin.
public $implement = [ 'RainLab.Translate.Behaviors.TranslatableModel', 'Vdomah.TranslateTabs.Behaviors.TranslateTabbable', ]; public $translatable = ['name', 'excerpt', 'slug'];
In fields.yaml need to define _translations field like this (exact result of this config you can see on screenshot):
_translations: span: left type: translations form: fields: name: label: Name span: auto type: text slug: label: Slug span: auto preset: field: name type: slug type: text excerpt: label: Excerpt span: auto type: textarea
Same config works for theme options form in theme.yaml.
Found the plugin useful on 16 Nov, 2017
Don't you know, by holding CTRL when switching field language you switch all fields in form simultaneously?
Replied on 16 Nov, 2017
Clients don't know about Ctrl and don't want to know :) After several complains from different clients I decided to do the translations in tabs. It's just more obvious and visualy easier to understand.
Translatable tabs for theme options form.
Nov 27, 2017
Nov 13, 2017