Unknown language json files

what are these language files for? (I guess it is for localizing javascript?) You guessed right. The JSONs are for use specifically with the new wp_set_script_translations function in WordPress 5. is it necessary to add/commit/push them to the live server? They are used at runtime, just like .mo files are. So yes, add them to … Read more

Disabling Translation Update

You’ve already given the answer using auto_update_translation. I wasn’t aware this didn’t work after manual updates (and haven’t tried it) but perhaps also look at async_update_translation which according the documentation “Asynchronously upgrades language packs after other upgrades have been made”. Regardless of the above, I recommend a different approach whereby the community translations are still … Read more

Obtain a list of available translations

You can get a list of available languages with get_available_languages( $dir ). It returns an array with all .mo files where the names does not start with ‘continents-cities’, ‘ms-‘ or admin-. To get a readable name for the file use format_code_lang( $code ). If you scan a directory for language files and get an array … Read more

How to handle text with function __(?

I cannot find the reference for hard answer on this, but likely it can handle large strings just fine. From quick look at WP’s own files somethings like this: __(‘Your account has been activated. You may now <a href=”https://wordpress.stackexchange.com/questions/174179/%1$s”>log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at … Read more

what’s different between _x() and _()

_x() let’s you add a context to your strings. This is useful when you are using the same string in different places. This string may need different translations depending on the language. Your example would be : echo ‘a1 in context 1 ‘ . _x(‘a1’, ‘context1’, ‘mydomain’); echo ‘a1 in context 2 ‘ . _x(‘a1’, … Read more

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