Skip to content

Commit

Permalink
fix: update localization files and remove unused test-auto-load-i18n …
Browse files Browse the repository at this point in the history
…plugin
  • Loading branch information
lgersman committed Nov 4, 2024
1 parent 46ddc63 commit 7834cb8
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 153 deletions.
2 changes: 1 addition & 1 deletion packages/wp-plugin/essentials/languages/essentials.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-11-04T13:08:17+00:00\n"
"POT-Creation-Date: 2024-11-04T13:49:12+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.10.0\n"
"X-Domain: essentials\n"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions packages/wp-plugin/test-auto-load-i18n/package.json

This file was deleted.

27 changes: 0 additions & 27 deletions packages/wp-plugin/test-auto-load-i18n/test-auto-load-i18n.php

This file was deleted.

4 changes: 4 additions & 0 deletions packages/wp-plugin/test-plugin/languages/test-plugin-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ msgstr ""
#: test-plugin.php
msgid "https://www.ionos-group.com/brands.html"
msgstr ""

#: test-plugin.php:31
msgid "hello.world"
msgstr "Hallo Welt !"
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ msgstr ""

#: build/index.js:1
msgid "hello from packages/wp-plugin/test-plugin/src/index.js"
msgstr "hello from usa"
msgstr "hello from the U.S."

#. Author of the plugin
#: test-plugin.php
Expand All @@ -45,3 +45,7 @@ msgstr ""
#: test-plugin.php
msgid "https://www.ionos-group.com/brands.html"
msgstr ""

#: test-plugin.php:31
msgid "hello.world"
msgstr "Hello world !"
6 changes: 5 additions & 1 deletion packages/wp-plugin/test-plugin/languages/test-plugin.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-11-04T13:08:26+00:00\n"
"POT-Creation-Date: 2024-11-04T13:49:17+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.10.0\n"
"X-Domain: test-plugin\n"
Expand All @@ -34,6 +34,10 @@ msgstr ""
msgid "https://www.ionos-group.com/brands.html"
msgstr ""

#: test-plugin.php:31
msgid "hello.world"
msgstr ""

#: build/feature-1/blocks/block-1/index.js:1
msgid "Example Static – hello from the editor!"
msgstr ""
Expand Down
10 changes: 10 additions & 0 deletions packages/wp-plugin/test-plugin/test-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
error_log("foo=$foo");
});

\add_action('plugins_loaded', function() : void {
\load_plugin_textdomain(
domain : 'test-plugin',
plugin_rel_path: basename( __DIR__ ) . '/languages/'
);

$translatedText = \__('hello.world', 'test-plugin');
error_log($translatedText);
});

\add_action('admin_enqueue_scripts', function() : void {
$assets = include_once __DIR__ . '/build/index.asset.php';
\wp_enqueue_script(
Expand Down

0 comments on commit 7834cb8

Please sign in to comment.