From 9975864da273fb25d03e1d6b20421690d04eb3ec Mon Sep 17 00:00:00 2001 From: Mateusz Dworowy <mateusz.dworowy@wpdesk.eu> Date: Wed, 4 Dec 2024 13:22:32 +0100 Subject: [PATCH] feat: add PL translations --- .gitignore | 2 ++ composer.json | 7 +++++++ src/HelloWorld.php | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 485dee6..7fa5c30 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .idea +lang +!lang/*_*.po diff --git a/composer.json b/composer.json index 88e1725..2292b8d 100644 --- a/composer.json +++ b/composer.json @@ -15,5 +15,12 @@ "type" : "composer", "url" : "https://gitlab.wpdesk.dev/Dworowy/xxx-hello-world.git" } + }, + "extra": { + "text-domain": "mdworowy-hello-world", + "translations-folder": "lang", + "po-files": { + "pl_PL": "pl_PL.po" + } } } diff --git a/src/HelloWorld.php b/src/HelloWorld.php index 360f40b..e897ed7 100644 --- a/src/HelloWorld.php +++ b/src/HelloWorld.php @@ -4,6 +4,6 @@ namespace HelloWorld; final class HelloWorld { public static function printHello(): string { - return "Hello World!"; + return __("Hello World!", 'mdworowy-hello-world'); } } -- GitLab