Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english

Looks like this has been introduced in WordPress 6.7 - I have the following code: $loaded = load_theme_textdomain(MY_TEXTDOMAIN,get_stylesheet_directory() . '/languages'); // internationalization $...
Blackbam's user avatar
  • 565
0 votes
1 answer
44 views

Dashboard and Site Language only partially translated (in own theme)

I developed my own Block Theme. The default language of my Wordpress installation is English (US). If I change it to e.g. German (Switzerland), only a few words/sentences are translated in the ...
beat's user avatar
  • 43
0 votes
1 answer
35 views

Include external po file for 3th party plugin to theme

I used 3th party plugin in my theme but some of them don't have my target language support.I want to add new language support to these plugins from my theme plugin.How can I do it?
attack-to-overflow's user avatar
0 votes
1 answer
27 views

how to unlocalize theme/plugin?

I have theme with this code in one php file : 'logged_in_as' => '<p class="logged-in-as">'. sprintf( __( 'Logged in as <a href="%1$s">%2$s</a&...
masoud nkh's user avatar
0 votes
1 answer
193 views

Wordpress theme doesn't read my translations from pt_BR.po file

I used PoEdit to create my .pot file. Added some translations, then created a .po file alongside with automatically created .mo file. My .po file looks like this: msgid "" msgstr "" "Project-Id-...
Olga's user avatar
  • 1
1 vote
1 answer
63 views

Translation Issue with Wordpress Theme Check in comment_form function

I ended my wordpress theme, which called the_mdttheme. I tried to check it and get two errors with translation in comment_form(). Can't understand what did wrong, can someone help me? Here is two ...
Aslan's user avatar
  • 55
2 votes
2 answers
513 views

Some translations do not work in my template class

I am struggling with the translations of my theme. I use the function get_permalink_date of my class. The relevant snippet is: $permalink_title = sprintf( /* translators: 1 = Post Title, 2 = ...
chrisbergr's user avatar
-1 votes
1 answer
340 views

Apostrophes replaced by &#39;

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: ' ...
Frenchy35's user avatar
0 votes
1 answer
61 views

Theme starter content translation is not working

I have written and translated a theme and all is working fine, except the starter content. It seems that i am not able to translate the content and it is still displayed in English, even though I have ...
Badan's user avatar
  • 225
1 vote
1 answer
294 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
0 votes
0 answers
48 views

Menu names not getting translated

I've got the following code in a theme to register two menus: register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'text-domain' ), 'secondary' => esc_html__( 'Secondary', 'text-...
user54141's user avatar
0 votes
1 answer
54 views

Do translation functions like __e() have to take strings in English in themes?

I'm developing a theme and curious if strings could be written in a language different from English and still be properly translatable? What I mean is when using translation functions in a custom ...
Oleg's user avatar
  • 135
1 vote
0 answers
18 views

Single translation for many locales

Greetings to everyone, Is it possible to do make a single translation for many locales? Let me explain it better: Can I create a single translation file for my theme called es.po and es.mo so it ...
Ivan Montilla Miralles's user avatar
3 votes
1 answer
627 views

Change text of twentyseventeen_edit_link()

Where do we go, or what do we do in order to change the default text displayed as Edit for the given function twentyseventeen_edit_link() which is originally part of the tweentyseveteen theme. Thanks
klewis's user avatar
  • 899
1 vote
0 answers
62 views

comment form args are not translatable (customized comment form)

I customized the comment form by changing the 'args'. Short Example: $comments_args = array( 'title_reply' => esc_html__( 'Leave a comment', 'mytheme' ), 'title_reply_to' =&...
Benmay's user avatar
  • 361
-1 votes
1 answer
219 views

Problem with Poedit [closed]

I have a directory structure like theme-name/inc/lang that I need to add the PO file inside the lang folder and the text to be translated is foresure inside theme-name. So now when I try to specifiy ...
Mohamed Omar's user avatar
0 votes
1 answer
60 views

Using HTML links within translatable string

What harm could happen if I didn't use the wp_kses function when using HTML links within translatable string? I know what this function do but what I don't understand is why and when should I ...
Mohamed Omar's user avatar
2 votes
2 answers
1k views

My custom theme does not load the translations

I made a custom theme named testTheme having these files: And I wanted to put some translation on it therefore I created the required .po and .mo files for greek language via poedit as seen in the ...
Dimitrios Desyllas'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
0 votes
1 answer
60 views

Any way to permanently translate themes?

For the reason beyond my imagination Wordpress never had chance to get real theme updater (i.e. the one that would actually update only changed files) and instead offers a-joke-called-updater, that ...
trejder's user avatar
  • 332
3 votes
1 answer
2k views

Make a custom theme translate-ready

I created a my own theme, now I wish to make it translatable. I made two files: theme.pot msgid "know_more" msgstr "Vuoi saperne di più?" it_IT.po msgid "know_more" msgstr "Vuoi saperne di più?" ...
wav's user avatar
  • 197
0 votes
1 answer
465 views

Translate a child theme with pure PHP and gettext

I'm trying to translate a child theme of a parent theme that has all msgstr empty. Therefore, I've created the file de_DE.mo using the "WordPress i18n tools" recommended in the docs together with ...
Philipp Zedler's user avatar
2 votes
0 answers
78 views

Translating plugin inside the theme [closed]

I've developped a WordPress Business theme and I use it to sell websites to local businesses. Everything works like a charm. But. One thing doesn't. I've included the Redux plugin into my theme. ...
Jorrit's user avatar
  • 21
1 vote
2 answers
114 views

Default string not appearing want to translate

I am trying to make my theme translatable so I am using the following command to output text. But its just returning an empty value some reason? No error is displayed <?php __('PLAYER POINTS AT A ...
dotnetdevcsharp's user avatar
4 votes
1 answer
510 views

Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations

Is it good to add a text domain as an argument to every __(), _e() and __n() gettext call such like these, even though I'm not planing to create my own translations? __( 'Post', 'my-theme' ); _e( '...
5ervant - techintel.github.io's user avatar
3 votes
1 answer
202 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
2 votes
1 answer
256 views

Prevent WordPress updates from overriding custom language translations?

my site's language is persian and persian is a right-to-left language. Wordpress has a default installation package for this lang but for some cases like very bad translation for dashboard or default ...
Mostafa Ghanbari's user avatar
2 votes
2 answers
102 views

Translation-readiness of Koi theme

I am migrating a (non-English-language) blog using the Koi theme on WordPress.com to a self-hosted environment, but see that certain strings are no longer being translated. For example, if my wp-...
NewBee's user avatar
  • 19
54 votes
11 answers
79k views

How to create .pot files with POedit?

I've spent hours today on what seemed like something really simple, which is to create a .pot file for a Wordpress theme that I'm creating. I've read the Smashing Magazine article, the Tutsplus ...
user1981248's user avatar
  • 1,067
25 votes
1 answer
21k views

When to use _e and __ for the translation?

What is difference between _e() and __() functions for the translation? In what cases e() and __ ()should be used?
jay's user avatar
  • 267
0 votes
1 answer
3k views

Translate a theme with a PO file

I'm new to WordPress. two weeks ago I downloaded a theme for my Arabic language blog, and the theme is scripted in English but it contains a folder called languages/ and inside it has two files one is ...
Alex C.'s user avatar
  • 135
1 vote
1 answer
337 views

How to make the_tags title translatable?

How can I make the text in the_tags function translatable? Currently I'm using following: <?php the_tags('<div class="tags">Post Tags',' ','</div>'); ?> But I'd like to make '...
jay's user avatar
  • 151
1 vote
1 answer
543 views

Set parent theme language with custom .mo files

I am using Buttercream as my parent theme. I have translated the .mo file located in themes\buttercream\languages and saved it as nl_NL.mo and nl_NL.po. Now I want to display the parent theme in Dutch ...
Bram Vanroy's user avatar
0 votes
1 answer
991 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
211 views

Display Today's date outside the loop?

Is there any way to display the Today's date outside any loop/post using WordPress date/time function instead of using the PHP date() function? I'm using the PHP date() function but it does not ...
jay's user avatar
  • 81
24 votes
1 answer
42k 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
2 votes
1 answer
492 views

How do I translate this string - PHP syntax question

I need some help on how to correctly format this code snippet for translation: <?php next_post_link( '%link', __( '<span class="meta-nav">←</span> Nästa nyhet') ); ?> I've used ...
Johan Dahl's user avatar
  • 1,343
1 vote
2 answers
61 views

Internationalization and functions that use it

I'm building a new design into WP and so technically it is a theme, however it is only a design for one site and won't be a theme anyone can use and hence I don't want to bother with ...
Brett's user avatar
  • 414
3 votes
1 answer
260 views

What is the purpose of an extra file for translation?

What code is required to put in functions.php in order to make the theme translation ready? The TwentyEleven theme has only following line: load_theme_textdomain( 'twentyeleven', ...
jay's user avatar
  • 65
4 votes
2 answers
2k views

How to concatenate inside the _e() function the right way?

I'm trying to create a function for the title inside my functions.php, I'm having a problem with the search title part where I have to concatenate here's the part with issues: elseif (is_search()) { ...
Pierre's user avatar
  • 1,024
0 votes
1 answer
586 views

Why set a second parameter in the translate function?

The second parameter in the translate function is optional, but I always see people use it and some don't. So I want to know if I should use it or not and if yes, how I will use it later. I asking ...
Pierre's user avatar
  • 1,024
2 votes
3 answers
7k views

Help with "text domain", comments_form in WordPress theme

I've been plugging away at creating my own theme and am pretty much there, but ran the Theme Check plugin and had a few concerns/questions: Throughout the theme, wherever there is text, I've used _e( ...
Zach's user avatar
  • 1,943
0 votes
3 answers
109 views

Should we localize custom-made themes / plugins?

Does anyone know how much do the localization functions from WordPress affect the speed of a website? Do you think it's worth replacing all strings with gettext inside a theme, even if it will only ...
onetrickpony's user avatar
  • 13.6k
16 votes
2 answers
6k views

pass object/JSON to wp_localize_script

I've got a working piece of javascript that contains an object literal. But I need to localize it, and I'm ytrying to figure out how to rewrite it so that I can get wp_localize_script() to accet it, ...
mikkelbreum's user avatar
  • 2,466