ckan / ckanext-scheming

Easy, shareable custom CKAN schemas
Other
83 stars 161 forks source link

Translations for label name and placeholder not working. #405

Closed vj-addnode closed 6 months ago

vj-addnode commented 6 months ago

I gave a custom dataset schema yaml file for the fields and also generated a .Pot, .po and .mo files for the translations but that is not working. For ex., I gave field name & label as 'Title' for the title field so instead of translating it is just giving label name as 'Heading' in english and 'Rubrik' in swedish. Can anyone of you let me know how I can give custom label names to those fields ? Simply I just want to give custom heading and placeholder to those fields.

wardi commented 6 months ago

Would you share a minimal example schema that demonstrates what you're trying to accomplish?

vj-addnode commented 6 months ago

So, below is the yaml file in which there are fields. I am referring to first field i.e. 'Title'.

`scheming_version: 2 dataset_type: dataset about: A reimplementation of the default CKAN dataset schema about_url: http://github.com/ckan/ckanext-scheming

dataset_fields:

resource_fields:

wardi commented 6 months ago

What you're trying to do isn't clear to me. Maybe you want to give the specific label translations in the yaml file like shown in the readme: https://github.com/ckan/ckanext-scheming?tab=readme-ov-file#label instead of using gettext?

Note that scheming doesn't override every instance of the word "Title" across ckan so this will only work in the form. For other instances you need to override templates or use custom translations.

vj-addnode commented 6 months ago

Thanks, giving field translations in yaml file directly is working. I have custom HTML templates for which I generated .po file and was trying to translate using that.