Can't get localization to work in own plugin
-
I have a plugin I wrote in
/wp/wp-content/plugins/survey-generator
The main file is called
survey-generator.php
.In this file’s header, I have included
Text Domain: survey-generator
Domain Path: /languagesI’ve used the double-underscore function with strings and included the text domain. For example:
defined('ABSPATH') or exit(__('This is a WordPress plugin.', 'survey-generator'));
In the languages directory, I have generated
survey-generator.pot
withmakepot.php
and have used PoEdit to createsurvey-generator-it_IT.po
andsurvey-generator-it_IT.mo
files.When I change the language to Italian in the WordPress admin panel, WordPress itself changes to Italian, but the messages generated by my plugin still appear in English.
In the header of the main file
survey-generator.php
, I have also usedText Domain: survey-generator
Domain Path: /wp/wp-content/plugins/survey-generator/languagesbut it made no difference.
I don’t know what I’m missing. Can anyone suggest anything?
- The topic ‘Can't get localization to work in own plugin’ is closed to new replies.