Countown: No way to preview "Complete" text while editing it, and no D/H/M/S customization

When I want to edit the “Complete” content, I cannot see it. Probably I should set the countdown to Expire first, but that is not very user friendly. Especially because in the order of things, it is expected to set the date first. I think there should be a “Preview” checkbox to temporarily turn on the “Complete” text.

Also, there should be an option to customize the words “Days”, “Hours”, “Minutes” and “Seconds”, to make the Element useful in other languages too. The Compact mode can then be derived from the translations automatically.

Thanks!

1 Like

Howdy, @Misho! The preview text can indeed be triggered by setting a date older than your current time. We explored some other ideas for previewing the complete text, but ultimately felt it was cleaner to just have it happen by default by moving the date forward and backwards and keep the interface a bit tidier. Also due to the fact that it could potentially cause confusion if users forget they have it checked and are wondering why in the builder their Countdown element is not working.

As for the labels, both the singular letters and the longform words are localized, so they are able to be altered for other languages:

Hi, Kory. Sorry for my question. Does this code means, that if in Wordpress settings the language is set to any language instead of English it will displays a language which is set?

  1. I’m russian but i’m using Wordpress in english and never ever installing RU localization. And… My windows is in English too. There is a lot of problems with localizations and… you know, it’s very hard to find good tutorials on russian. So i m always using native software languages.

  2. I have installed RU language in WP settings and… nothing was happend.

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.

Nice answer! I’ll try.

P.S. Still waiting for this: https://theme.co/apex/forum/t/x-pro-ru-translation-2/48895/4?u=georgich
I want to translate X Pro for a very long time :slight_smile: But there was a lot of problems with this. Cause transnlating .po .mo was not a complete solution. A lot of text was inside CS not in translation files.

Thanks for sending that my way. I really appreciate your efforts to translate everything into Russian! I know we fixed many different unlocalized strings this cycle. I’m pretty sure that includes everything you’ve mentioned on that thread. One outstanding issue we have is that in Pro you need to have both the __x__ and cornerstone text domains localized.

Just want to let you know, that i’ve done it with “Say What?”

Thanks for sharing this! Looks like a handy plugin.

hello kory, great! do you have the function as a text (not as an image)? :wink:

Hi @oblaum,

The code Kory mentioned is the actual source of the element, which can’t be changed - it just means that the fields are localized. A few posts down there’s some more information on how to translate the localized strings