rest api endpoint – accept diacritic characters

Looks to me like WordPress doesn’t enable UTF-8 mode when it runs the regex. https://github.com/WordPress/WordPress/blob/5.2.1/wp-includes/rest-api/class-wp-rest-server.php#L837 In PHP, matching multibyte characters requires the u flag. (The code above just adds the case-insensitive flag). So although some strings will still match (like “Département”), they’re not matching as whole Unicode characters. For example the following pattern matches when … Read more

Translation from .mo file not working in theme

Start a new theme from scratch to see if you have the same result. I test with theses files and the translation works style.css /* Theme Name: My Theme */ functions.php <?php add_action( ‘after_setup_theme’, ‘my_theme_load_theme_textdomain’ ); function my_theme_load_theme_textdomain() { load_theme_textdomain( ‘my-theme’, get_template_directory() . ‘/languages’ ); } languages/es_ES.po (file languages/es_ES.mo created with poedit) msgid “Featured” msgstr … Read more

Theme doesn’t want to load localization files

One error: the function is load_theme_textdomain(), not load_textdomain(). The former is used for Themes to define/load a textdomain; the latter is for core, I believe. (Plugins have an analogous function, load_plugin_textdomain().) Try using: load_theme_textdomain( get_theme_text_domain(), get_template_directory() . ‘/languages’ );

WordPress Theme .mo-file won’t load

load_theme_textdomain() needs an absolute path to the directory, so you should set your THEME_URL like so define(“THEME_URL”, get_template_directory()); define(“TRANSLATION_URL”, THEME_URL . “/languages”); It wasn’t working for you because get_bloginfo(“template_url”) is an URL and not an absolute path on your server.

Localize plugin name

Just add the full string of the plugin name into the plugin’s text domain. WordPress looks this up automatically. Same with Description, PluginURI, Author and AuthorURI. See the internal function _get_plugin_data_markup_translate. The string extractor in Glotpress (and my own plugin Loco Translate) adds these header strings automatically to new POT files.

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