All Questions
Tagged with translation theme-development
44 questions
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
$...
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 ...
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?
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&...
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-...
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 ...
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 = ...
-1
votes
1
answer
340
views
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: '
...
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 ...
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 ...
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-...
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 ...
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 ...
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
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' =&...
-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 ...
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 ...
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 ...
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
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 ...
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ù?"
...
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 ...
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. ...
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 ...
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( '...
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 ...
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 ...
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-...
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 ...
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?
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 ...
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 '...
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 ...
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 ...
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 ...
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).
...
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 ...
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 ...
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', ...
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()) {
...
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 ...
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( ...
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 ...
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, ...