Tim
  • Member for 7 years, 9 months
  • Last seen more than a month ago
2 answers
3 votes
4k views
Unknown language json files
Accepted answer
6 votes

what are these language files for? (I guess it is for localizing javascript?) You guessed right. The JSONs are for use specifically with the new wp_set_script_translations function in WordPress 5. ...

View answer
1 answers
3 votes
462 views
load_plugin_textdomain in `plugins_loaded` or `init`?
Accepted answer
4 votes

Load translation files as late as possible for your plugin's use-case. This allows other plugins as much time as possible to fully initialise. Why should you care about other plugins? Because they ...

View answer
2 answers
0 votes
53 views
Localize plugin name
Accepted answer
3 votes

Just add the full string of the plugin name into the plugin's text domain. WordPress looks this up automatically. Same with Description, PluginURI, Author and AuthorURI. See the internal function ...

View answer
1 answers
0 votes
626 views
rest api endpoint - accept diacritic characters
Accepted answer
2 votes

Looks to me like WordPress doesn't enable UTF-8 mode when it runs the regex. https://github.com/WordPress/WordPress/blob/5.2.1/wp-includes/rest-api/class-wp-rest-server.php#L837 In PHP, matching ...

View answer
1 answers
0 votes
298 views
Found a translation function that is missing a text-domain. Function _n
Accepted answer
2 votes

Your error (actually a warning) seems to come from the Theme Check plugin. There's nothing wrong with the code you're showing above. 'acf' is your text domain. and the _n function takes four ...

View answer
1 answers
2 votes
66 views
Do i have make the content() also translation ready in theme?
Accepted answer
2 votes

Do i have make the content() also translation ready in theme? Short answer - No. 1). Content held in the database is generally not translated via static files. That includes post content and other ...

View answer
3 answers
1 votes
2k views
Is this a correct usage of esc_html_e?
2 votes

Your argument appears to be that "Product" will always be "Product". As others have pointed out, this is not the case because (1) it may print a translation, and (2) it can be altered by filters in ...

View answer
1 answers
1 votes
76 views
Transliterating search term in another language
1 votes

If you have PHP's Intl extension installed, you can use the wonderful Transliterator class. I get some pretty good results, like this: $t = Transliterator::create('Latin-Greek', Transliterator::...

View answer
2 answers
0 votes
30 views
Is it best practice to use English as the base of a translation-ready theme?
Accepted answer
1 votes

The default language of WordPress is always English (en-US). Regardless of what your site language is set to. This is what the entire WordPress community expects for the language of source strings, ...

View answer
1 answers
-1 votes
151 views
Translations in source code
1 votes

This is "normal" in WordPress 5 as this is what the new wp_set_script_translations function is for. The function tells WordPress to associate a JSON file containing translations with a specific ...

View answer
1 answers
1 votes
529 views
Different translations for the same plugin inside a multisite
Accepted answer
1 votes

You can use WordPress hooks to load site-specific files, but it requires some work. In this example, we'll keep a common Dutch language file at a system location. This can contain any strings that ...

View answer
1 answers
0 votes
1k views
Can't translate the post meta data (Date) in another language
Accepted answer
1 votes

You don't need to change any code. get_the_date without an argument will use the date_format option in your WordPress settings. The option F j, Y will substitute F as "September", but if you have a ...

View answer
2 answers
3 votes
45 views
Problems with localization
1 votes

1) Presuming you're running WordPress 4.x. The WPLANG constant does nothing. WordPress 3 and below defined the default language in wp-config.php but since WordPress 4 setting your site language is ...

View answer
2 answers
1 votes
645 views
How to override default Wordpress core language file
Accepted answer
1 votes

Correcting the answer given by Max. To use this approach, the filter you need is gettext_with_context because your string is translated via _x() not __(). Note that the filtered argument passed is ...

View answer
1 answers
5 votes
966 views
Cache Wordpress translations
1 votes

I answered a similar question on Stack Overflow recently. Don't forget that the profiler itself adds a big overhead. If your page loads are still really slow with XDebug disabled then I don't think ...

View answer
2 answers
5 votes
4k views
Disabling Translation Update
Accepted answer
1 votes

You've already given the answer using auto_update_translation. I wasn't aware this didn't work after manual updates (and haven't tried it) but perhaps also look at async_update_translation which ...

View answer
1 answers
1 votes
742 views
loco translate plugin edits file in plugin folder
Accepted answer
1 votes

I thought (and hoped) that the translations were written in the folder wp-content/languages/loco/plugins/my-plugin. They are, but only when you create the file in that location. Any users wishing ...

View answer
1 answers
0 votes
231 views
How to change WordPress core language using Loco Translate?
0 votes

There are only four files in the default text domain. I found "Add Media" in the first one. (Development). I don't recommend generating your own template. This is an advanced tool for authors. Use ...

View answer
1 answers
0 votes
36 views
Securing langugae folder
0 votes

The short answer is to use the location wp-content/languages/woocommerce/ to store custom translations. See WooCommerce documentation. This location should be safe from all WordPress updates. ...

View answer
1 answers
0 votes
34 views
How connect my plugin translation to my page
0 votes

And what to do next? I guess it should be linked somewhere. The plugin loads your language itself, so you don't need to do anything. However, it must be named correctly. I added my translated .po ...

View answer
1 answers
0 votes
29 views
Translate are not working for standard admin
Accepted answer
0 votes

The only instance of "Count" I can see in the default domain's admin file has a context value of "Number/count of items". So your code should be: add_action( 'admin_init', 'action_admin_init' ); ...

View answer
1 answers
0 votes
63 views
Load custom translation in custom plugin fails
Accepted answer
0 votes

I think Jacob has probably solved your problem in the comments. However, to your question: How to debug further this issue? I would hook into the load_textdomain_mofile filter and check the fully ...

View answer
2 answers
1 votes
562 views
Child Theme Translations with PoEdit
0 votes

Does the child theme's text domain have to be the same as the parent theme's text domain? It must NOT be the same. Text domains must be unique. If the parent theme loads a file into "...

View answer
2 answers
0 votes
2k views
Uncaught SyntaxError: missing ) after argument list
0 votes

You have the same error repeated on each script. Look at the attribute delimiters. They start using double quotes, then switch: <script src="https://...js' defer onload='"> ...

View answer
1 answers
0 votes
92 views
Wordpress in French Language
Accepted answer
0 votes

You have a UTF-8 encoding issue. You are seeing single, unprintable bytes. That suggests the data is either stored in a single byte character set, or something is converting it from UTF-8 to a ...

View answer
1 answers
0 votes
199 views
How to disable gettext feature?
0 votes

You already have the answer, but perhaps you're not running your code early enough. Returning true from the override_load_textdomain filter will prevent all MO files from loading, but you'll have to ...

View answer
1 answers
1 votes
248 views
How to translate timestamp?
0 votes

The "%s" will be replaced by strings translated in the WordPress Core "default" text domain. e.g. "%s mins", "%s hours", etc.. Find these in your core translation files and translate them too.

View answer
1 answers
0 votes
269 views
I dont know why my localization is not working
Accepted answer
0 votes

Your error is here The path to your bundled translations resolve to a languages folder inside the includes folder, which is one level down from where it actually is. Try it with an extra dirname and ...

View answer
1 answers
0 votes
28 views
How to set different localization file for different users?
0 votes

By default WordPress only loads translations according to the user's language when they're viewing admin pages. You can see that in the code for the load_theme_textdomain function: $locale = ...

View answer
4 answers
0 votes
8k views
get_the_date() for translating date format
0 votes

Old question, but no answer accepted, so here goes.. You get weird output, because _e just prints "F j" literally and isn't passing it to the function. Hence you get the raw format followed by the ...

View answer