Replacing strings within posts with the translatable string

Being part of the post content, the string can’t be translated using translation function. You probably need a multilanguage plugin like WPML or Multilingual Press. In that way you’ll be able to have different “version” (one per language supported) of the same post. However, if the only thing you need to translate is the word … Read more

translating wordpress with poedit

Take a closer look at next_post_link and previous_post_link. Specifically; how the function arguments are arranged. Next, take a closer look at translating strings; and how the function arguments are arranged. Now, when you put the two together; you should have something like this: <?php previous_post_link( ‘<span class=”meta-nav”> %link </span>’, __( ‘&#9668; Previous’,’twentyten’), TRUE ); ?> … Read more

How to translate functions like get_the_date()?

Why not do it in plain PHP? For example, you can write a function like: function get_the_german_date($date=””, $post = null) { $d = get_the_date($date, $post); if ($d) { $d = new DateTime($d); return $d->format(‘d.m.Y’); } else return false; } Similary, if you want to follow the WordPress standards: function the_german_date($date=””, $post = null) { $d … Read more

where to set the PO file for a plugin?

First of all, the plugin should support translation. If it is so, the directory where to put po/mo file is defined by plugin, usually they are in a directory /langs or /languages in plugin directory. That directory is (should be) defined by plugin using load_plugin_textdomain The plugin you are using has a subfolder cimy-user-extra-fields/langs where … Read more

setlocale for date

Use date_i18n( $format, $i ); echo date_i18n(‘j F Y’, strtotime( $event_date[0] ) ) . ‘ ‘ . date_i18n(‘j F Y’, strtotime( $event_from_time[0] ) ) . ‘ do ‘ . date_i18n(‘j F Y’, strtotime( $event_to_time[0] ) ); See also: How to integrate get_post_time with date_i18n function?

WPML Translated Term

Actually there is already in their API something for this: icl_object_id(ID, custom_taxonomy_name, return_original_if_missing,language_code) Works like a charm. More read on this : Language Dependent IDs

Is this a correct usage of esc_html_e?

You should always escape output. end of sentence, and end of story. The questions is like asking if you can use globals and goto. Sure they are part of the language and in some edge cases they are the only way to produce working and readable code, but the guide is to never use them … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)