Localization works but still get “This plugin is not properly prepared for localization” msg in directory

I figured it out almost immediately after asking the question, after months of frustration. The issue was I was using the load_textdomain function (which was the way I learned it) instead of the apparently newer/favored load_plugin_textdomain. The working code looks like this function rsvpmaker_load_plugin_textdomain() { load_plugin_textdomain( ‘rsvpmaker’, FALSE, basename( dirname( __FILE__ ) ) . ‘/translations/’ … Read more

Making a configurable field translatable

What I have seen in translation plugins (qTranslate, WPML, Multilingual Press) are two approaches. One is qTranslate’s (and the defunct xLanguage): use one field (one for title, other for content, etc) to hold all translations. And then, in the front end, decode its output according to the actual language. <!–en–>English<–:–><!–es–>Español<–:–> In the back end, the … Read more

How to set locale in ajax requests?

(this kind of issues is part of why my standard recommendation is to not have front end with two languages) The core reason to the problem is that your ajax returns text. AJAX should be treated like API which provide machine level values which the front end translate to human text. When your code is … Read more

Change text of twentyseventeen_edit_link()

The twentyseventeen_edit_link() function returns an accessibility-friendly link to edit a post or page. Here is its content: function twentyseventeen_edit_link() { $link = edit_post_link( sprintf( /* translators: %s: Name of current post */ __( ‘Edit<span class=”screen-reader-text”> “%s”</span>’, ‘twentyseventeen’ ), get_the_title() ), ‘<span class=”edit-link”>’, ‘</span>’ ); return $link; } Since it doesn’t provide a hook or filter, … Read more

How to extract translatable (double underscores and _e) strings?

One way is to use the WordPress i18n tools. I had to checkout WordPress trunk to make it work. On the command line: svn co http://develop.svn.wordpress.org/trunk once you have trunk somewhere, you’ll then want to call the makepot script. Again, on the command line: php /path/to/wordpress/trunk/tools/i18n/makepot.php wp-theme /path/to/your/theme/ After that script has run, the pot … Read more

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