My theme is not translated

Make sure you put your function inside after_setup_theme action hook add_action( ‘after_setup_theme’, ‘load_translation’ ); function load_translation() { if( is_dir( get_stylesheet_directory() . ‘/languages’ ) ) { load_theme_textdomain(‘adifier’, get_stylesheet_directory() . ‘/languages’); } else { load_theme_textdomain(‘adifier’, get_template_directory() . ‘/languages’); } Also, you have to make sure your theme domain is matched with the translated file. For an easier … Read more

Transate plugin with js & wp_localize_script

In your PHP you are localizing the script using wp_localize_script(). The way you’ve used it will create an object in JS named messageClip with the string as the copy property, but then in your JavaScript you’re not actually using this. In your JavaScript just get rid of const message etc. and use: buttonclip.on(‘success’, function(e){ e.trigger.textContent … Read more

String translation with or without po file

the .po files are just the human readable version of the translation, but it is not actually used by wordpress for anything. What you need is to generate a .mo version (it is the .po file in some binary encoding form) with a tool like poedit.

change page name on page list

You can change built in post type labels with the post_type_labels_{$post_type} filter: function wpd_change_page_labels( $labels ) { $labels->menu_name=”Specials”; $labels->name=”Specials”; $labels->singular_name=”Special”; return $labels; } add_filter( ‘post_type_labels_page’, ‘wpd_change_page_labels’ ); EDIT- Refer to register_post_type for a full list of labels, there are probably some others you’ll want to add to this.

How to translate WP plugin name?

I didn’t find the right way but figured out this way: if (get_locale() == ‘fa_IR’) { parent::__construct( ‘araccordion_widget’, __(‘افزونه وردپرس’, $text_domain), array( ‘description’ => __( ‘توضیحات افزونه به زبان فارسی در اینجا نوشته میشود.’, $text_domain ), ) ); } else { parent::__construct( ‘araccordion_widget’, __(‘WordPress Widget’, $text_domain), array( ‘description’ => __( ‘The description in English, goes … Read more

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