Localization not working
-
Hi Community
I’m developing an extension for WordPress and WooCommerce.
The extension is working very fine, only the localization is not working.I included in the header of my main pluginfile this lines:
* Text Domain: myextension * Domain Path: /i18n/languages/In my code I used the __ and _e functions like this:
__( 'Example string', 'myextension' )And I moved my .po and .mo files in ‘myextension/i18n/languages/’.
My .po files look like this:
‘myextension-de_DE.po’:msgid "" msgstr "" "Project-Id-Version: My Extension 1.0\n" "POT-Creation-Date: 2016-09-07 11:08+0200\n" "PO-Revision-Date: 2016-09-07 11:51+0200\n" "Language-Team: Me <x@x.x\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.9\n" "X-Poedit-Basepath: ..\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-KeywordsList: __;_e\n" "Last-Translator: \n" "Language: de\n" "X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPath-1: classes\n" "X-Poedit-SearchPath-2: functions\n" "X-Poedit-SearchPathExcluded-0: i18n\n" #: classes/Example.php:128 msgid "Example string" msgstr "Beispiel String" ...... cuttedBut, if I change the language in Settings>general to German, everything is translated except everything from my plugin.
So, where did I failed?
I also tried to delete and reinstall my plugin. Also I tried to switch the language a few times.
FuFu
The topic ‘Localization not working’ is closed to new replies.