Giter Site home page Giter Site logo

Comments (6)

daftspunk avatar daftspunk commented on July 30, 2024

Hi @jannikholsten

Where does this happen, is it using a plugin?

from translate-plugin.

jannikholsten avatar jannikholsten commented on July 30, 2024

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.

daftspunk avatar daftspunk commented on July 30, 2024

Ok, could you confirm what October CMS version and what version of RainLab.Translate that you are using?

from translate-plugin.

jannikholsten avatar jannikholsten commented on July 30, 2024

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.

jannikholsten avatar jannikholsten commented on July 30, 2024

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.

daftspunk avatar daftspunk commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.