Translation – loading text domain
-
Hi,
Most themes and plugins use function
load_theme_textdomain()
orload_plugin_textdomain()
.
And often with a path to a custom translation folder:load_theme_textdomain( 'my-theme', get_template_directory() . '/languages' );
In Theme Handbook and Plugin Handbook I read this:
As of version 4.6 WordPress automatically checks the language directory in wp-content for translations from translate.www.remarpro.com. This means that plugins that are translated via translate.www.remarpro.com do not require load_plugin_textdomain() anymore.
If you don’t want to add a load_plugin_textdomain() call to your plugin you should set the Requires at least: field in your readme.txt to 4.6.Who can explain me why themes such as TwentyTwenty load a text domain, but without a path:
load_theme_textdomain( 'twentytwenty' );
It’s my understanding that this function is nowadays only useful in case of loading your own custom translation? This means including a path to a custom translation folder.
Guido
- The topic ‘Translation – loading text domain’ is closed to new replies.