Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [textdomain]

Identifier for translatable strings.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Load textdomain in the website, not in the admin, based on user settings not general settings

When you load textdomain with load_theme_textdomain() hooked on 'after_setup_theme' it loads your translations both in the admin and on the website, but it translate the website based on the option &...
0 votes
0 answers
23 views

Localization PHP: How can I scan the theme to detect the addition of a new string to be internationalized?

In my theme I added "languages" folder (my-theme/languages/)and in my global css file I have well the text domain. I work only with php internationalization (no javascript). I don't use ...
5 votes
5 answers
8k views

How to load translation in JavaScript?

I am struggling to load translation in JavaScript for my simple plugin. Translation works for PHP, but not in JS. What seems to be the problem, how can I debug this? I have loaded text domain in my ...
0 votes
1 answer
616 views

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( ...
1 vote
1 answer
1k views

Two text domains in one plugin

From start: A = main plugin(the library), B = child plugin I develop a plugin B that will depend on another plugin A in order to work properly. I do this because I'm one of the persons who don't ...
0 votes
0 answers
391 views

Translations only load from `wp-content/languages/plugins` but not from the plugin's languages folder

I translated my plugin and put all the files (my-plugin-de_DE_formal.po, my-plugin-de_DE_formal.mo, my-plugin.pot) in the wp-content/plugins/my-plugin/languages folder. My plugins header says: … Text ...
2 votes
1 answer
485 views

How to get menu strings, categories and tags into po file for translation

I'm prepping my theme for translation. I've added the following line to my functions.php, and added the text domain within my theme files. <?php /*** LOAD THEME TEXTDOMAIN ***/ ...
2 votes
2 answers
3k views

How to override languages files in wp-content/languages/themes with child theme

I want to create a child theme for TwentyFifteen theme, which will customize a lot of things, including translation. When I install WordPress in my language (Farsi), it includes TwentyFifteen language ...
2 votes
1 answer
34 views

Problem in Internationalizing a plugin built for network level usage

Context: I have created a plugin that is enabled only at the network level and it handles certain synchronizations between the child sites. As it is a network level plugin, it has its menu added to ...
1 vote
1 answer
51 views

Plugin translations not installed but... strings are translated!

I've had for a long time a site with the famous Recent Tweets Widget. The plugin came as part of a theme, and back in the day, it included translation .po and .mo files for French language. I didn't ...
0 votes
1 answer
113 views

load_plugin_text_domain() never works

This code never works: function i18n_load_plugin_textdomain() { $path = '[DIR]/wp-content/plugins/my-plugin/languages/my-plugin-de_DE.mo'; load_plugin_textdomain( 'my-plugin', false, $...
0 votes
1 answer
413 views

Filter in Custom post type to find the parent post

function fws_admin_posts_filter( $query ) { global $pagenow; if ( is_admin() && $pagenow == 'edit.php' && !empty($_GET['my_parent_pages'])) { $query->query_vars['post_parent'] = ...
0 votes
1 answer
871 views

WordPress filter load_textdomain_mofile not working inside a child theme's functions.php but works form inside a plugin

Function in a plugin is behaving differently than function in the functions.php inside a child theme. I have a custom simple plain plugin with nothing but the following code in it and it works ...
2 votes
0 answers
248 views

How to reload wordpress textdomains at runtime

I'm currently using this to reload my theme and plugin textdomain in order to send e-mails (admin move, in admin language) in the user language. add_filter("theme_locale", array($this, "theme_locale")...
3 votes
1 answer
226 views

How can I translate the name of my Plugin for other languages?

How can I translate the name of plugin for other languages? For example: When Wordpress is in pt-BR language, the plugin would be "Meu plugin". If the Wordpress is in en-XX language, the plugin name ...
1 vote
1 answer
624 views

What is the correct naming procedure of text domain, directory and theme name?

This is the example on the WordPress codex: /* * Theme Name: My Theme * Author: Theme Author * Text Domain: my-theme * Domain Path: /languages */ Is it possible the for the directory be called "...
3 votes
1 answer
913 views

load_plugin_textdomain in `plugins_loaded` or `init`?

Which is the best/recommended way to hook load_plugin_textdomain within - plugins_loaded or init? and what are drawbacks using either.
1 vote
1 answer
286 views

Should I change text-domain of TGM library inside theme?

I created a theme and I want to publish it in wordpress.org. I used TGM library to check to require plugins. but the Theme-check get bellow warning: Warning: More than one text-domain is being used ...
0 votes
1 answer
172 views

Translation ready code format for taxonomy

https://codex.wordpress.org/Function_Reference/register_taxonomy i have these doubts _x( 'Categories', 'taxonomy general name' ) does it make taxonomy general name a text domain? wont it resulting ...
3 votes
2 answers
615 views

Multiple text-domains per single plugin - admin and frontend

There is a plugin: In admin area it has about 300 various strings added via __('', 'my-textdomain'). Most of these are form labels, titles, etc. On "frontend" (which end user sees), there just 15 ...
0 votes
1 answer
533 views

How to debug load_textdomain?

I'm really stumpted here. I've got this code to load my textdomains for the english version of the site I'm working on. The following code is in the Functions.php theme file. if(ICL_LANGUAGE_CODE ==...
9 votes
2 answers
7k views

Is a text-domain necessary for a child theme

Sorry for the noob question. Is a text-domain necessary for a child theme? I am building a simple child theme with no text-domain declared. So, when I use strings which are to be translated, should I ...
1 vote
1 answer
350 views

Internationalization: Not loading plugin translated text

I am trying to internationalize the plugin I am creating but it doesn't seem to display the translated texts that are translated in the .po file. Firstly, I have referred to the following sources: ...
1 vote
2 answers
783 views

.mo translation strings not loading in PHP scripts that handle AJAX calls

using the standard __('some-string', 'myplugin') for translations, strings are being correctly loaded for a Japanese (ja) locale in every function and script other than my AJAX functions. my-plugin....
3 votes
1 answer
200 views

Theme elements not translating

Ive got a theme that is set-up for translating but didn't come with any translations. I used poedit to automatically detect the strings, and subsequently translated it in full. However certain ...
9 votes
1 answer
2k views

Is it ok to use a function to output the text domain name in a wordpress theme

I am working on a theme and I want to make it available for translating. I have not been including a text domain on translated text because I don't know what the text domain is going to be yet. I ...
0 votes
0 answers
459 views

Theme check warning about text domain

While running theme check plugin in my theme, it shows a warning [More than one text-domain is being used in this theme.The domains found are industrypro-thecreo,]but I am using only one text domain ...
0 votes
0 answers
201 views

Translation not working for Constant strings in Plugin

I want to translate constant strings in my plugin defined as: define( 'CONSTANT', __( 'string-A', 'textdomain' ) );. The 'string-A' is available for translation and I have uploaded the mo files in the ...
1 vote
1 answer
189 views

Use the wp-admin translations on the front end

Currently I'm working on implementing the user profile form on the front end. Unfortunately the front end core translation file (wp-content/languages/lang_LANG.po) doesn't have any of the translated ...
0 votes
2 answers
4k views

How to solve a translation function issue with no arguments and missing a text-domain?

I have a warning via WordPress Themecheck plugin WARNING : Found a translation function that is missing a text-domain. Function esc_html__, with the arguments As you can see, there is no arguments ...
3 votes
1 answer
3k views

translation does not work with text_domain

I am trying to translate my custom plugin. I can translate my plugin if I place the fr_CA.po/.mo into my wp-content\languages\plugins manually. But I would like to be able to put my .po/.mo into my ...
0 votes
1 answer
310 views

Fix Problem With Textdomain Translation

I translate some text with textdomain: _e( 'My Text', 'my-text-domain' ); And I am using Loco Translate plugin. It was working fine, but now it has stopped working. What is the best way to find the ...
0 votes
1 answer
72 views

WordPress theme directory naming

Suppose, I named my WordPress Theme folder as TrueLove. Look 'True' is in the uppercase 'T' and 'Love' is in 'L'. This folder name is the slug of that theme that I found using this function echo ...
0 votes
0 answers
2k views

Adding translation files to a child theme

I am building a website with WordPress and I am using the Generatepress theme. However: I need to add functions, so I created a child theme. Generatepress is not available in a language I need (...
0 votes
0 answers
2k views

Custom post type translation

I would like to translate the name of a custom post type with page capabilities. I'm using qtranslate-x but even it works for custom posts, it doesn't translate the custom post type name. I.e. my ...
2 votes
1 answer
3k views

load_child_theme_textdomain doesn't work in function.php

I have a child theme which is not localized. So I added this in function.php add_action( 'after_setup_theme', 'my_child_theme_setup' ); function my_child_theme_setup() { ...
1 vote
2 answers
151 views

Simple way to get two language WP site

I am trying to make a site with two languages. I was looking for a solution and didn't find a simple how-to answer. Also, I prefer not to use plugins when it is possible. What I'm trying to do: 1) ...
7 votes
1 answer
8k views

How to debug failed load_theme_textdomain()?

I made my theme ready for translation. My text domain is my_theme and my .po and .mo (de_DE.po and de_DE.mo) files are located in a subfolder languages in my themes folder. In my functions.php I ...
1 vote
2 answers
386 views

Localization / textdomain is slow and chaotic

My theme has a lot of templates. Most of them contain messages in the usual way: echo __('This is the message','mytextdomain') This has several disadvantages. For instance, if I want to change the ...
0 votes
1 answer
717 views

How to change default text for specific post type

Prelude: Let's say the text "Comments are closed" is a default WP String and you wanna change that text string to something else like "Hello World!" if is_singular('post-type') is true. Issue: Now, ...
2 votes
1 answer
3k views

Theme check: Missing a text-domain

I'm using following code to display the number of comments: printf(_n('1 comment', '%1$s comments', get_comments_number()), number_format_i18n( get_comments_number() ), 'text-domain' ); Is there ...
0 votes
1 answer
111 views

Warning: The actual loaded translation content contains mixed textdomains and is not pure translateable within one textdomain

We're using the CodeStyling Localization plugin and getting this warning: Warning: The actual loaded translation content contains mixed textdomains and is not pure translateable within one textdomain....
1 vote
1 answer
9k views

How can I see my theme's text domain?

Where can I discover my current theme's text domain for use with translation (GetText)?
2 votes
1 answer
6k views

Use WordPress default text domain for translating labels

I am wondering if there is a way to use the "default" text domain ("WordPress" or "default") to translate labels. E.g I have following code: // Register Custom Taxonomy function custom_taxonomy() { $...
0 votes
1 answer
2k views

Wordpress Theme .mo-file won't load

I am developing a theme that implements multiple languages. I have a few strings that will have to be translated in the theme itself. I would like to use a .po and .mo file. For some reason, when I ...
5 votes
1 answer
362 views

switch_to_blog(): Load textdomain

I am using the WordPress multisite feature with Multilingual Press Pro to create a multilingual site with linked posts. In a network activated plugin the custom post types are registered. For ...
3 votes
1 answer
10k views

Warning/Notice about functions.php

I have trouble about the notice shows on the top of the home page as: Notice: load_plugin_textdomain was called with an argument that is deprecated since version 2.7 with no alternative available. ...
0 votes
1 answer
445 views

How to translate Widget Description in constructor?

I'm building a localized widget and the translation works everywhere but in the language string in the constructor. I have read that the whole plugin initialisation has to be bound to the init ...
0 votes
1 answer
2k views

Notice: Use of undefined constant Redux_TEXT_DOMAIN - assumed 'Redux_TEXT_DOMAIN'

I am building my first Wordpress site, I just downloaded and installed v3.9.1. I bought a theme (rustik3) and I am trying to install it, but I am running into these errors produced by WP_DEBUG: ...
0 votes
1 answer
690 views

Loading plugin text domain before registering post type

I'm building a wordpress plugin, that will register a post type. Im trying to set up a simple test case where all it does is registering a post type with get text functions and translating it with ...