Provides an instant overview of your shop's current customers and the contents of their carts.
Since date and time formatting differs regionally, it makes sense to configure them to be language specific. WPML does not do this by default but here’s a way to change that.
Normally you set up the date and time formatting under Settings > General. Since there’s no WPML UI to provide different values per language, we can add a snippet of code that allows you to translate the values using WPML String Translation. First add the following code to your theme’s functions.php:
add_filter( 'option_date_format', function( $format ) {
do_action( 'wpml_register_single_string', 'Date formats', 'Date format', $format );
return apply_filters( 'wpml_translate_single_string', $format, 'Date Formats', 'Date format' );
} );
add_filter( 'option_time_format', function( $format ) {
do_action( 'wpml_register_single_string', 'Date formats', 'Time format', $format );
return apply_filters( 'wpml_translate_single_string', $format, 'Date Formats', 'Time format' );
} );
Then visit WPML > String Translation and filter by the domain “Date formats”. This should now return 2 rows for the date and time formats where you can enter the alternative values for the non-default languages.
If the Date formats domain does not appear in the dropdown yet, it might be necessary to load a page on your site that displays a date. Then refresh the String Translations page and it should appear in the list.
Posted by Berend on
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Thanks, that’s exactely what I was looking for.