Skip Navigation

[Resolved] Translation of Date field

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 9 replies, has 2 voices.

Last updated by toolset-dave 7 years ago.

Assisted by: Nigel.

Author
Posts
#587503
date-field.png

Hi,

I wanted to translate Date field in CRED content form, so I translated "Select date", "Hour", "Minute" in files wp-cred.po and views.po where I found the strings, but the labels are still not in my language. Do I find it anywhere else?

#587534

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Dave

The datepicker itself and the strings for the hours and minutes should change automatically to reflect the language of your site, set at Settings > General, and that is what I see when I switch languages.

What language is your site in? I can check to see if the translations are missing.

#587535

I have WordPress in Czech language (cs_CZ).

#587585

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Dave

We provide language translation files for many languages—but not Czech, it seems.

I am requesting that we add it, though you should expect that will take some time.

If you wanted to do it yourself, the Hour and Minute strings are from the text domain 'wpv-view'.

Each of the Toolset plugins includes shared resources, and the language files are located in (e.g. for Types), wp-content/plugins/types/vendor/toolset/toolset-common/languages/

You would need to edit the .po file with the translations of the required strings, and then generate the .mo files for your language as required, for which you can use free tools such as poedit (hidden link).

You may need to copy the Czech .mo file to the same location in each of the Toolset plugins.

To learn more about what is involved with plugin localization works, see https://developer.wordpress.org/plugins/internationalization/localization/.

#587638

Hi,

now I see I was editing wrong views.po file. I am using Poedit yet (btw it´s Czech tool 🙂 ). But there is another problem, when Types will be updated, the translation will be lost. I tried to place the translation into /wp-content/languages/plugins/ as I do it with CRED translation (it works correctly), but with views-cs_CZ it doesn´t.

#587758

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Dave

I found the same earlier in my testing and it may be that Types and Views are doing something different than is typical when localizing plugins.

I'll take another look in the morning and see if I can establish exactly what's happening, when I can speak to colleagues if I need to.

#588051

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Dave

I did some more testing and can confirm that language files added to wp-content/languages/plugins are not recognised.

For Toolset to pick up the translations they must be stored in wp-content/plugins/types/vendor/toolset/toolset-common/languages (or the equivalent folder for Views, etc.).

This does mean that they will be lost during plugin updates and you will need to manually re-instate them.

Obviously this is far from ideal.

I'm filing a feature request that the language files be moved to wp-content/languages/plugins so that if you add your own translations they will not be lost.

#588084

This would be great, not to have manually place translation after plugin update. And I also found that strings "Select hour" and "Select minute" are not in translatable .po only in class.date.php file. Thank you.

#588256

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Thanks for spotting that.

I've reported it, and I guess there could be others, the plugin files will need re-scanning to generate a complete .po file.

#589146

Thanks.