How can you locate the .po file used for translation of a page?

I'm trying to translate a plugin, Dokan Pro, but I can't seem to find the correct .po file that my Wordpress site is using to translate. Part of it is already translated in Italian, but other parts are still in English. I've tried by placing the .po and .mo file for the plugin, named correctly as per documentation (dokan-it_IT and dokan-lite-it_IT) in the /wp-content/languages/plugins directory, but it won't take that files. Is there any other .po files from where it …
Category: Web

Apostrophes replaced by '

I use a plugin for automatic posting of articles on social networks, and when I send an article on Facebook or Twitter from my website, the apostrophes of my articles are replaced by this: ' It is possible that the problem comes from the theme, but I am not sure. I tried to do a "search and replace" to replace this code with an apostrophe using a "regex" but it does not work at all
Category: Web

How can all E-mails be sent with BCC copy to Admin?

I'm translating WordPress page into seven different languages. Have around 70 plugins active and working, no worries. Subscriptions, shop, pre-orders you name it. Getting there with translations, using WPML but I have not found, not even searching, all templates for emails going out to users, customers, shop editors, bloggers, etc. I'm sending all emails out through Mailster. Is there a way that would be Admin able to get BCC copy of each and every e-mail sending out? I would take …
Category: Web

Translate javascript with WordPress built-in localization API for static strings

I have been trying to implement the translation to a couple of strings in a .js file but nothing has worked. First try to do it like I do in php, in the .js file add this variable var __ = wp.i18n.__; and I put the strings like __( 'Hello World', 'text-domain'), but it didn't work. After looking for information about it, I found a post where they talk about passing the translated strings with wp_localize_script something like that. // …
Category: Web

`wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin

Short description: I try to translate strings in JS file. To test it I decided to create a simple test plugin. I have PHP and JS strings there. Translated PHP strings work fine, JS strings don't work. Tools and environment: WP-CLI 2.4.0 Wordpress 5.5.1 Ubuntu 20.04 Original languange: English (United States) Translate language: German Plugin PHP file content: <?php /* * Plugin Name: Test * Text Domain: test * Domain Path: /languages */ /** * Init all */ function run() …
Category: Web

wordpress plugin translation not working

I have no idea what is wrong here. First I would like to share probably all required info. Plugin tree: $ tree . ├── classes │ ├── database │ │ ├── plugin-auth.php │ │ ├── plugin-user.php │ │ └── wp-user-x.php │ ├── main │ │ └── plugin.php │ └── woocommerce │ └── plugin-order.php ├── config.php ├── plugin.php ├── languages │ ├── plugin-shop-en_US.mo │ ├── plugin-shop-en_US.po │ ├── plugin-shop-pl_PL.mo │ └── plugin-shop-pl_PL.po └── templates └── register.php plugin.php contains Text Domain: plugin-shop …
Category: Web

Add a string to file .pot using Poedit

I want to add a string to a pot document for language, but it says there’s an error. I have opened file .pot with a text editor and I have add this code #:D:\Programe\InstantWP\InstantWP_4.3.1\iwpserver\htdocs\wordpress\wp- content\themes\sydney-child/category-38.php:56 msgid “” “Read more” msgstr “” while in my file I have add this one <?php _e( ‘Read more’, ‘sydney-child’ ); ?> Then I have downloaded file .pot and I have opened it with Poedit, I have add the translation “Read more”, but when I …
Category: Web

why is translation not working on theme?

Background I am using the theme Rookie from Sportpress. I created a child theme. Translation files are existing, especially german in my case. Wordpress is set to german language. The Problem Translation is working fine everywhere except on themes provided templates like the search results page content or pagination. Affected are the SRP title, nothing found page title and nothing found page content. They just stay in default english language. Pagination is affected too. The search form in the content …
Category: Web

How to implement Polylang functions in my theme's php file?

I am translating a site with Polylang that was created by someone else using a custom theme. Some strings couldn't be found by Polylang, so I need to manually register them for Polylang to see. Now, some of the strings were pretty easy to translate using __(): $args = shortcode_atts([ 'link' => 'service', 'text' => __('Get the code now!'), 'title' => __('Code'), 'id' => '', 'class' => 'width300', ], $args, '' ); But I don't know how to translate strings …
Category: Web

Translate pages and URLs without duplicating

I would really appreciate some suggestions about what plugin to use in WP with DIVI editor, to translate my web site and following these specs: do not duplicate pages (that's really important) translate page URLs, translate page visible text, as well as hidden text (meta tag values), keep in place existing page layouts and elements built with DIVI, Actually I am not sure that is possible, having pages designed with DIVI. I am playing with Polylang, but looks like is …
Category: Web

Load textdomain from global languages directory

I am creating translations for my plugin. To fetch .mo files from my-plugin/languages directory , I use the function //Load translation function load_plugin_textdomain() { load_plugin_textdomain( 'my-plugin', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); } add_action( 'plugins_loaded', 'load_plugin_textdomain' ); How can i set the location to wp-content/languages Setting the location to ABSPATH.'/wp-content/languages' doesn't work.
Category: Web

How to edit T&C checker text in Woocommerce checkout page? gettext?

I'm trying to edit wording in terms & conditions checkbox on checkout page (order review section), but without luck. It was easy to edit other fields like billing and shipping fields. But I'm not sure how to target this specific T&C checkbox. For other input fields the code below works fine: // WooCommerce Rename Checkout Fields add_filter( 'woocommerce_checkout_fields' , 'custom_rename_wc_checkout_fields' ); // Change placeholder and label text function custom_rename_wc_checkout_fields( $fields ) { $fields['billing']['billing_first_name']['placeholder'] = 'Type your first name...'; $fields['billing']['billing_first_name']['label'] = …
Category: Web

Translation for a text that is not printed on the screen

How can I enable the translation for a text that is not printed on the screen? I was recently implementing the translation to my plugin and everything worked as expected. But doing the tests I realized that I was missing something. There is a small piece of code in my plugin that creates terms based on a condition, but one of them is a text and I need it to be translated. how can I do? I understand that __ …
Category: Web

Translation of plugin in MU-PLUGINS directory not working

I have successfully translated a child theme, but not the same result in mu-plugins folder. The name of the plugin is "mu-functions.php". In this file I have added the "Text Domain: mu-functions" in the header and then I have loaded the textdomain: add_action( 'plugins_loaded', 'myplugin_muload_textdomain' ); function myplugin_muload_textdomain() { load_muplugin_textdomain( 'mu-functions', basename( dirname(__FILE__) ) . '/inc/languages' ); } The structure of the plugin that I have created in the mu-plugins directory is the following: In the same directory I have …
Category: Web

Wordpress different language footer text

I am new to WordPress, and I have a problem building my website. I use the Sydney theme and Polylang plugin for my multilanguage website. I have build a website in 4 different languages and now I would like to have a different footer text for every language in the sub footer part. For e.g. where it says in English language 'Copyright I Privacy policy' ', with the hyperlink on provacypolicy/en, that I have created. For the German start page …
Category: Web

Translation for frontend

In my plugin I have many strings to translate for the backend and only a few for the frontend. For the visitors of the website it is nicer to read the words in the language of the site. Is there a more elegant way to mark for the translators which words appear in the frontend or backend than _x: _x("string to translate", "In Frontend", "text-domain") Thank you very much.
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.