Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [textdomain]

Identifier for translatable strings.

0
votes
1answer
20 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 "...
1
vote
1answer
40 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
1answer
32 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
1answer
30 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 ...
1
vote
2answers
39 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
1answer
101 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 ==...
1
vote
1answer
73 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: ...
0
votes
2answers
172 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....
0
votes
0answers
317 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
0answers
55 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
1answer
72 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 ...
2
votes
1answer
186 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
1answer
117 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
1answer
46 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 ...
9
votes
2answers
2k 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 ...
0
votes
0answers
1k 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
1answer
447 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( ...
0
votes
0answers
772 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 ...
8
votes
1answer
459 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 ...
1
vote
2answers
1k 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 ...
1
vote
2answers
148 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
2answers
2k 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 ...
1
vote
2answers
126 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) ...
0
votes
1answer
139 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
1answer
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
1answer
85 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....
0
votes
1answer
3k 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)?
1
vote
1answer
3k 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
1answer
1k 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
1answer
269 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
1answer
165 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 ...
0
votes
1answer
338 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 ...
1
vote
1answer
578 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 ...
2
votes
1answer
264 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 ***/ ...
0
votes
1answer
432 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 ...
0
votes
1answer
1k 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: ...
1
vote
1answer
2k 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() { ...
0
votes
1answer
266 views

Translation of this theme not showing up in the real host. why?

i translate many wp themes until now and i don't see this problem yet. I make mo and po files for this theme and in the function i put this code load_theme_textdomain( 'rokesh', ...
3
votes
1answer
8k views

Why is “plugins_loaded” not called/fired?

I am trying call load_plugin_textdomain once the plugins are loaded, however this does not happen. I do have a plugin activated, so shouldn't this fire? add_action("plugins_loaded", "test_override"); ...
1
vote
2answers
5k views

Find proper “text domain” within theme

I have a client with a wordpress theme, Nevada, and we are having trouble making the built in translations work for it. The theme contains .mo files for English, German, and Slovenian, and appear to ...
0
votes
1answer
401 views

Theme doesn't want to load localization files

Here is my functions.php excerpt: function get_theme_text_domain() { //Same behavior if I return the string as 'return 'whatever' $theme = wp_get_theme(); return $theme->get('...
1
vote
1answer
326 views

Multiple textdomains

I have a bunch of plugins. Obviously, they all have their own unique textdomains for internationalization (i18n). I also have a bunch of files that I include in all my plugins - I throw them all in a ...
3
votes
1answer
8k 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
1answer
472 views

Does the textdomain have to be the theme's name?

Does a theme's text domain have to be the actual theme name? If you develop WP themes, couldn't you just use the same name (perhaps your business name) for all the theme's you develop, making it ...
0
votes
2answers
177 views

Should all references to a text domain be to my current theme?

I'm running Theme Check on a theme I've inherited and I've come across lots of recommendations like this one: RECOMMENDED: Text domain problems in loop.php. The twentyten text domain is being used! ...
4
votes
1answer
1k views

Overwrite textdomain of plugins by default - Lost Translation

Wordpress is awesome, but there is something that is driving me crazy. Whenever a plugin or a theme is updated, all files are deleted and replaced. So if I have custom code or a translation in one ...
0
votes
1answer
155 views

Theme Checker Text Domain

$output .= '<li class="recentcomments">' . sprintf(_x('%1$s %2$s - %3$s %4$s', 'thst'), get_avatar( $comment, 48 ), (...); This is my line of code and Wordpress Theme Checker tells me "Text ...
0
votes
1answer
2k views

How to keep a variable in COOKIE or GET query string?

I'm working on adding a language variable (locale) in my custom WordPress theme. I made the translation working by adding ?l=en_US to the URL. I would like to add the parameter into COOKIE, such that ...
1
vote
1answer
576 views

Action hook load_textdomain $domain variable

I use the load_textdomain action hook to list all active localization text domains with corresponding path to translation files. function mo_location( $domain, $mofile ) { if ( !is_array($...
17
votes
1answer
24k views

What is a Theme textdomain?

I've found that any WordPress theme uses this functions, but I don't understand what is the purpose of it and what is it, in this case 'themify'? Here are some examples in Themify functions.php: 1). ...