• Resolved hallsey

    (@hallsey)


    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: /languages

    I’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 with makepot.php and have used PoEdit to create survey-generator-it_IT.po and survey-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 used

    Text Domain: survey-generator
    Domain Path: /wp/wp-content/plugins/survey-generator/languages

    but it made no difference.

    I don’t know what I’m missing. Can anyone suggest anything?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can't get localization to work in own plugin’ is closed to new replies.