How to change language file used by _e function

Actually you need to hook in the ‘locale’ filter to set the language you want: add_filter(‘locale’, function($locale) { return esc_attr($_GET[‘language’]); }); Then in the links of your switch, you need to pass the language variable: <a href=”https://wordpress.stackexchange.com/questions/260015/<?php echo add_query_arg(“language’, ‘xx_XX’) ?>”>XX</a> Where xx_XX is the language locale code for language XX

Setting the language of RSS feed

Within the default feed template you’ll find something like this: <language><?php bloginfo_rss( ‘language’ ); ?></language> As you can see the bloginfo for the feed (bloginfo_rss()) is called (instead of get_bloginfo()). You can overwrite the feed language separately via a filter in your functions.php: add_filter(‘bloginfo_rss’, ‘custom_rss_lang_attr’, 10, 2); function custom_rss_lang_attr($output, $show) { switch( $show ) { … Read more

Theme’s text domain & language.PO file not working

After inspecting your theme, this is what I came up with. I’ve taken the liberty to include Ruben’s solution as well to make this answer as complete as possible. There are several problems here: Number 1. load_theme_textdomain( ‘transparent’, get_template_directory_uri() .’/languages’ ); should be: function transparent_theme_setup() { load_theme_textdomain( ‘transparent’, get_template_directory() . ‘/languages’ ); $locale = get_locale(); … Read more

change only the theme language

Yes, rename your pt_AR.mo to ar.mo and pt_FR to fr_FR.mo. In step one install but not activate yet the plugin Admin in English. Edit the plugin’s php script. Find line with en_US string and replace this string with fr_FR. Save and activate the plugin. Now your Dashboard will be in French. In step two remove … Read more

Translate content, not instance, per-post

The easiest approach would be to have custom fields on the edit page: one text field for every language you want to use (and perhaps different title fields?) For this you could use a plugin like ACF. This would provide an easy interface for non-tech editors. Supposing you are building your own theme you can … Read more

What is the difference between the Package Language and the Site Language?

As you probably already know, WordPress supports language packs. Translation files that reside in wp-content/languages. Those are used to translate all the strings the user sees in WordPress. WordPress also allows translation teams on WordPress.org to provide localized release packages. These already come with the translation files included, plus a bit more. They can translate … Read more

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