The localization tag has no wiki summary.
8
votes
2answers
140 views
Translate a string to a language with masculin/feminine nouns
So in english we don't have gendered nouns. It is always "a table" or "a desk" with no need to worry about it being "une table" or "un tableau" (french). So my question is that when working on the ...
6
votes
3answers
345 views
What's the point on gettext syntax?
So far I've been handling some translations in Wordpress and tried to read the official gettext documentation but won't get the point of one maybe simple thing: What's the differences between those ...
5
votes
2answers
109 views
Can I leave off plugin textdomain for terms used in core?
I've got a plugin that puts post statuses into post type admin menus. I'm in the middle of internationalizing it, and I'm wondering how to handle this situation.
The plugin uses some unique strings ...
5
votes
1answer
539 views
How to provide translations for a WordPress TinyMCE plugin?
I know that I can get my translations into JavaScript doing:
$MyTranslations = array(
'translation1' => __("Some String 1", "MyTranslations"),
'translation2' => __("Some ...
5
votes
1answer
127 views
Gettext details
I've got a few gettext() questions that are not covered anywhere in WordPress Codex but I think they are important.
__('string') in THEME should be used for strings that are likely to be present ...
4
votes
4answers
2k views
Theme localization of “slugs” (custom post types, taxonomies)
in my theme I want to define a series of custom post types and custom taxonomies, each one having its own customized slug; the base language of my theme is english, therefore the slugs will be in ...
4
votes
1answer
42 views
How to i18n slugs for templates?
some templates are chosen from WordPress based on slugs (e.g. category-{slug}.php).
Problem:
How can I use the same template for an i18n'ed slug?
Example:
I have a category-news.php and an english ...
4
votes
1answer
45 views
How to integrate get_post_time with date_i18n function?
I have date format and would like to translate to another language with date_i18n function how can I integrate with get_post_time here is my code :
$time = get_post_time('F j, Y', ...
4
votes
1answer
140 views
Using plural-only translation of register_post_status() in plugin
tl;dr: My plugin wants to translate strings from core or other plugins that use _n_noop(). How?
This question related to this plugin and is sort of a follow up to this question.
My plugin adds ...
3
votes
1answer
567 views
How to make a WordPress plugin translation ready?
What is the best way create a plugin that is translation ready?
It doesn't have to be translated from the beginning but it has to be easily translatable so fellow developers from different cultures ...
3
votes
4answers
1k views
How to translate a plugin via .po .mo?
I want to translate this plugin. This plugin already has translations to some languages, and it has .pot file for adding new languages (as far as I understood from description). Although I never had ...
3
votes
1answer
110 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', ...
3
votes
1answer
1k views
How does printf( __( ) ); work?
Today I work through a theme to get a better understanding of WordPress and templating.
I discovered this:
<?php
printf(
__('Designed by %s', 'Anyword'),
'<a ...
3
votes
2answers
518 views
Localizing text from XML files
Do you guys know any way I could automatically pick up strings from .xml files and store them in a .po / .pot file, just like PoEdit does with the ones from .php files?
The XML structure looks like ...
3
votes
2answers
185 views
Localizing strings that come from outside of plugin?
Plugin queries remote API and under certain circumstances (mostly errors) displays textual messages from API responses. All messages in API responses are in English, but since they are more or less ...
3
votes
1answer
91 views
Localized WordPress is much slower?
I'm using xdebug and webgrind to profile my WordPress installation because it's a bit slow. As there are some 20 plugins activated, I figured xdebug will be able to find the bottleneck.
However, to ...
3
votes
2answers
279 views
Localization: I want the backend: english and frontend in defined language
I'd like to have the backend of Wordpress in English and use a different locale for the frontend
so far I figure out perhaps I could do it by setting in the wpconfig the locale I want to use in the ...
3
votes
1answer
70 views
localize inline css
I'm providing a theme setting to define a group of images for the frontpage background. On page load, I want to pick an image at random from this pool.
My approach is to add a line of inline CSS ...
3
votes
2answers
111 views
Running WP Cron on specific local time
The scenario is to run insert_post function every midnight (00:00) of local time. Must run daily on weekday.
function add_daily_task(){
if((date('l', time()) != 'Saturday') || (date('l', time()) ...
2
votes
2answers
71 views
Should i use _n for pronouns in translation?
I use _x() now! I accepted the answer just because he understood right and was first. So don't get confused!
$like_me_on = __('Like me on %s', 'my-plugin');
$like_us_on = __('Like us on %s', ...
2
votes
1answer
96 views
Use a language specific thousand separator
I have a views counter on each post. When it reaches for example 1000, it adds a dot as the thousand separator, the result is 1.000. This is odd in my language, I should have a space as separator or ...
2
votes
2answers
698 views
add spans and characters into paginate_links
I am using paginate_links on my custom page query.
What I have already works sweet and this is the code I have so far...
<?php
global $wp_query;
$big = 999999999; // need an unlikely ...
2
votes
1answer
378 views
Change language of comments template
I have a Wordpress installation in italian, I need to keep italian for the admin section but the frontend needs to be in english. The theme is custom so that's ok, but in single posts I'm using ...
2
votes
0answers
56 views
Singular name Plugin localization
I'm trying to localize the singular name of a custom post type.
...
'singular_name' => __('key', 'plugindomain')
...
I created a .po and compiled it as .mo. I also loaded the translation using ...
2
votes
1answer
244 views
Adding another arg to comments_popup_link
what WordPress core functions do I have to modify to change
comments_popup_link('Ni komentarjev', '1 komentar','% komentarjev')
to
comments_popup_link('Ni komentarjev', '1 komentar', **'2 ...
1
vote
2answers
67 views
Two language versions for each article
I have a Wordpress website that needs to be available in two different languages. We have the articles written in both languages already.
I've seen a lot of solutions providing automatic ...
1
vote
1answer
175 views
_n() Single and Plural for search results?
This code produces
Search Results for "hello" - 1 articles "
<h3>Search Results for <?php echo'"'?>
<?php /* Search Count */
$allsearch = &new ...
1
vote
2answers
948 views
Change locale at runtime?
I wonder, is there a way to change the locale at runtime using WordPress ?
What I mean, is, I have create a custom URL in order to create an XML file with data for integration with another web ...
1
vote
1answer
64 views
Localiztion in javascript
Wordpress currently uses the gettext feature which is available in php but unfortunately not in Javascript.
I have searched this matter on the web and have come up with this trick. But there is a ...
1
vote
1answer
59 views
Strings including html for localisation
How to localise this string (including html) ?
echo "<div class='updated'><p>All options are restored successfully.</p></div>" ;
Is this correct?
echo '<div ...
1
vote
2answers
123 views
variables in translatable text
I am adding a list of suggested plugins to my theme using TGM Plugin Activation - https://github.com/thomasgriffin/TGM-Plugin-Activation/
However, when I run theme check, about 40 or so ...
1
vote
1answer
64 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
2answers
36 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 ...
1
vote
1answer
120 views
How-to Change Content with location change?
I have to develop a site using wordpress having thousands of pages. Pages will have the same content but there will be change in the location of the content. For example location will be Sydney, ...
1
vote
1answer
370 views
Why load_textdomain work but not load_plugin_textdomain?
In my plugin's init function
load_textdomain( 'myplugin', ABS_PATH_TO_MO_FILE ); // OK
load_plugin_textdomain( 'myplugin', false, ABS_PATH_TO_LANGS_DIR); // No effect
echo( __('Test', ...
1
vote
1answer
47 views
The effect of x() family of functions
So I know that _x() and it's wrappers allow a developer to specify the context of a translated string. I'm pretty clear on "how" to use this function as well as "why" it should be used. I am wondering ...
1
vote
2answers
128 views
Mapping Subdomains in Wordpress to give the appearance of a localised site, best approach?
I am building a classifieds website and am using Wordpress for the functionality of user accounts, Paypal integration, custom taxonomies and of course super flexible custom post types for the ...
1
vote
1answer
124 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 ( ...
1
vote
1answer
38 views
2 localizations inside a WordPress theme
I'm building a theme which includes a separate "section" and I want to make both the theme and the separate section localizable. However, I don't want to have them under the same textdomain.
Would ...
1
vote
1answer
76 views
How do I amend the fixed “author” part in the URL?
I am creating a localized instance of WordPress and one can easily configure the category and tag parts of the URL but I cannot find anything similar for authors. So for instance I get this:
...
1
vote
1answer
48 views
sprintf bloginfo odditie
Why the disco funk this is happening I can't quite put my finger on - but I guarantee you it's because I'm probably missing some simple PHP best-practice:
<?php echo '<h3>' . ...
1
vote
3answers
2k views
Wordpress multisite,one theme,and different languages?
I'm not sure is this possible,for example I have english,french and italian blog,they all use same theme,I just want when visitor is on french site for example to display date,(some strings like ...
1
vote
1answer
250 views
Preparing a string in an array for localization
I'm working on a WordPress plugin and want to make sure that all text that is displayed is prepared for localization. I'm having trouble localizing the text that resides inside an array.
For ...
1
vote
1answer
376 views
Wordpress Locale Switching on Accept-Language Header
Is there anyway to get wordpress to automatically switch locales based on the HTTP Accept-Language header?
Similar to how ASP.NET can do it with their globalization="auto" config setting. The reason ...
1
vote
1answer
162 views
Editing URL character replacement
Whereabouts can I edit which characters in permalinks are replaced? For example apostrophe's are replaced with nothing, and I would like to have them replaced with hyphens instead.
Thanks.
1
vote
1answer
28 views
Text Domains Across Multiple Plugins & Themes
A common situation: a developer builds an entire site, based on WordPress, of course, for a client.
This site includes many custom plugins as well as a custom theme -- maybe another theme or a child ...
1
vote
0answers
37 views
Wordpress Localization and Templating
I'm using Smarty Templates for the back-end and Handlebars for the front-end for the plugin that I'm building.
It's only now that I discovered that the localization doesn't work when I declare my ...
1
vote
0answers
53 views
Wordpress translation loading english file
I am trying to translate a wordpress site but whatever I do the english file is always loaded.
In functions.php I've set load_theme_textdomain('twentyeleven', get_template_directory() . ...
1
vote
0answers
42 views
What would be the correct way to manage a multiple locale site with Wordpress [closed]
We are a professional company with lots of big clients and have adopted Wordpress 2 years ago to build professionnal grade websites. Being locate in a multiple language country, we have to make our ...
1
vote
3answers
66 views
Plugin for single language localisation
I have found dozens of plugins which helps you to translate a Wordpress website into different languages. However, I cannot find anything that would help me localise Wordpress for different regions, ...
