Comments (6)
Where does this happen, is it using a plugin?
from translate-plugin.
Hi @daftspunk
It happens in our own developed plugin (in my company).
For example, in the screenshots above for the "Datenschutz Hinweistext" field, I'm using folling code, to make it translatable:
public $implement = ['System.Behaviors.SettingsModel', '@' . \RainLab\Translate\Behaviors\TranslatableModel::class];
// map_hint_text for "Datenschutz Hinweistext"
public $translatable = ['linktext', 'map_hint_text', 'map_hint_btn_text', 'map_hint_cookie_text'];
It has worked before too.
from translate-plugin.
Ok, could you confirm what October CMS version and what version of RainLab.Translate that you are using?
from translate-plugin.
Sure, I use October CMS 3.6.11 and RainLab.Translate 2.2.8
But I also just figured out, that probably I do something wrong, because with the JanVince.SmallContactForm plugin for example, everything works as expected.
from translate-plugin.
I still have the same problem.
Now I figured out, that I probably have to use the model name "Settings", then it works. My settings model called "GlobalSettings" and does not work. I need multiple settings models in my project, so I cannot rename it so "Settings" because I allreay use it for something else.
Does not work because name is "GlobalSettings":
class GlobalSettings extends Model
{
use Validation;
public $implement = [
'System.Behaviors.SettingsModel',
'@' . \RainLab\Translate\Behaviors\TranslatableModel::class];
Would work because model named "Settings":
class Settings extends Model
{
use Validation;
public $implement = [
'System.Behaviors.SettingsModel',
'@' . \RainLab\Translate\Behaviors\TranslatableModel::class];
But I need to work with "GlobalSettings", as I said before, it has already worked before with the exact same implementation.
from translate-plugin.
Interesting...
Try updating to the latest spec for the Settings model, see if it helps: https://docs.octobercms.com/3.x/extend/settings/model-settings.html#model-class-definition
class GlobalSettings extends \System\Models\SettingModel
{
public $settingsCode = 'acme_demo_settings';
public $settingsFields = 'fields.yaml';
}
from translate-plugin.
Related Issues (20)
- How to get the translated file from the Model HOT 3
- Recursion happening in afterSave method, trying to save translated slug HOT 2
- New translation strings are not added after scanning HOT 1
- How to get the translated file from the Model HOT 4
- localePage markup returns duplicated prefixes HOT 1
- Language switching not working on secondary pages HOT 1
- Trait "RainLab\Translate\Traits\MLControl" not found HOT 2
- Model not supports translatable HOT 1
- How to Translate Custom CMS Page Settings HOT 1
- translate components not shown on component picker HOT 2
- Get translated model by active language not default language HOT 1
- Redirect to translated slug HOT 1
- setContext doesn't exist anymore, how can we change the language to send an email? HOT 2
- Can't install 2.2.8 HOT 1
- Attempt to read property "subject" on null in ThemeScanner.php:221 HOT 1
- Broken translation editing in CMS HOT 2
- Cannot save translation with "quotes" HOT 3
- How can I access specific "locales" based on back-end administrator users permissions? HOT 3
- Unable to install v2.2.8 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translate-plugin.