Countdown Translate?

How does one translate the countdown labels. It says days, hours, minutes and seconds, but I can’t find those back in the translation files. I though it might be grabbed from Wordpress Core, although my localization is already in dutch.

See example on live site

Hi Hindrik,

Thank you for writing in, so as you delve into plugin/theme code, anytime you see something like the following code means a string is translatable via the text domain provided in the second parameter:

$something = __( 'Translatable Text', 'text-domain' );

If you translate WordPress core, it handles all strings that don’t have a text domain. So by installing Russian from WordPress settings you’ve only translated things like the backend, and common front end functionality like the comment forms.

We use two text domains depending on where the code is stored: __x__ for theme code and cornerstone for plugin code. You can translate these by creating *.mo files from the provided *.pot files if you use a tool like PoEdit.

I think I’ve seen WPML active on your sites before. Do you have WPML string translation? This is a plugin that can scan for localized strings and gives you an admin interface to swap the values. I remember doing something similar with this plugin (https://wordpress.org/plugins/quick-localization/) but it looks like it hasn’t being maintained in a while.

Another option would be using the gettext filter directly. Here are some links to help with that process:


https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext

Because we localize strings, everything is customizable. The reason we don’t have controls that let you do this directly on the element is because of how unlikely it would be to need multiple countdowns with different labels. By it’s very nature, you’re just going to need Days, Hours, Minutes, and Seconds. Aside from using another language, it isn’t really something that you would need to customize frequently enough to warrant a separate set of controls.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.