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
24 votes
1 answer
41k 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). ...
Sok Vanrithy's user avatar
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 ...
Fabian Amran's user avatar
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 ...
Ayanize's user avatar
  • 237
7 votes
1 answer
17k 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"); ...
jansensan's user avatar
  • 183
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 ...
user1706680's user avatar
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 ...
Marko's user avatar
  • 597
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 ...
luke's user avatar
  • 533
4 votes
1 answer
2k 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 ...
André's user avatar
  • 51
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. ...
Ada's user avatar
  • 31
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.
T.Todua's user avatar
  • 5,800
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 ...
Marvin3's user avatar
  • 663
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 ...
Jean-philippe Emond's user avatar
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 ...
Phill Healey's user avatar
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 ...
Lucas Vendramini's user avatar
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() { $...
Mike's user avatar
  • 185
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 ...
Omid Mohammadi's user avatar
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 ...
jay's user avatar
  • 21
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() { ...
borayeris's user avatar
  • 148
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 ...
Talha Imam's user avatar
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")...
Rodrigo Butzke's user avatar
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 ***/ ...
roybatty's user avatar
  • 113
1 vote
2 answers
7k 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 ...
parker.sikand's user avatar
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)?
Django Reinhardt's user avatar
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: ...
Jeda Dragon's user avatar
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) ...
piot3rs's user avatar
  • 11
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 ...
Andrei Surdu's user avatar
1 vote
1 answer
1k 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($...
Ján Bočínec's user avatar
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 ...
macl's user avatar
  • 138
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....
Evan's user avatar
  • 11
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 ...
cjbj's user avatar
  • 14.6k
1 vote
1 answer
504 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 ...
Luke Carbis's user avatar
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 "...
BootUp's user avatar
  • 25
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 ...
iliyamas's user avatar
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 ...
luukvhoudt's user avatar
0 votes
1 answer
972 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 ...
Andrew's user avatar
  • 1,163
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 ...
Michiel Standaert's user avatar
0 votes
1 answer
580 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('...
Andrea Sciamanna's user avatar
0 votes
2 answers
182 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! ...
Django Reinhardt's user avatar
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 ...
Knott's user avatar
  • 454
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 ...
Mike's user avatar
  • 121
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 ==...
Fredy31's user avatar
  • 858
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 ...
walterdesign's user avatar
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, ...
iSaumya's user avatar
  • 934
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 ...
Hans Spieß's user avatar
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 ...
Malibur's user avatar
  • 579
0 votes
1 answer
200 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 ...
kath's user avatar
  • 601
0 votes
1 answer
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 ...
Raptor's user avatar
  • 272
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 &...
AHrtzt's user avatar
  • 13
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 ...
imagIne's user avatar
  • 83
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 ...
Mountain's user avatar
  • 101