This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

JimRed
JimRed

Dear All,

Could you please help me how could I translate (I mean set localization) my columns.yaml and fields.yaml files?

Thank you,
Patesz

ndcisiv
ndcisiv

You should be able to setup your lang.php file with something like this:

return [
    'yourmodelname' => [
        'yourfieldname' => 'Your Cool Label Name To Display',
        'yourotherfieldname' => 'Some other cool label',
    ],
];

Then your fields.yaml file would be setup like this:

fields:
    yourfieldname:
        label: yourname.yourpluginname::lang.yourmodelname.yourfieldname
    yourotherfieldname:
        label: yourname.yourpluginname::lang.yourmodelname.yourotherfieldname

Take a look at how the user plugin does it. fields.yaml file - https://github.com/rainlab/user-plugin/blob/master/models/user/fields.yaml#L9 lang.php file - https://github.com/rainlab/user-plugin/blob/master/lang/en/lang.php#L91

JimRed
JimRed

Thank you ndcisiv!

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.