From f7b2bdd5d8e7becdd08b6049debcc95a99ceedfa Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@suma-ev.de>
Date: Wed, 14 Sep 2022 16:57:28 +0200
Subject: [PATCH] added translation.io

---
 metager/composer.json          |  11 +-
 metager/composer.lock          | 224 ++++++++++++++++++++++++++++++++-
 metager/config/translation.php |  13 ++
 3 files changed, 242 insertions(+), 6 deletions(-)
 create mode 100644 metager/config/translation.php

diff --git a/metager/composer.json b/metager/composer.json
index 5356cbf2c..7645fa407 100644
--- a/metager/composer.json
+++ b/metager/composer.json
@@ -9,16 +9,17 @@
     "license": "MIT",
     "require": {
         "php": "^8.0.2",
+        "globalcitizen/php-iban": "^4.1.0",
+        "guzzlehttp/guzzle": "^7.2",
+        "jenssegers/agent": "^2.6.4",
         "laravel/framework": "^9.11",
         "laravel/sanctum": "^2.14.1",
         "laravel/tinker": "^2.7",
-        "guzzlehttp/guzzle": "^7.2",
-        "globalcitizen/php-iban": "^4.1.0",
-        "jenssegers/agent": "^2.6.4",
         "mcamara/laravel-localization": "1.7.0",
         "mews/captcha": "^3.2.7",
         "promphp/prometheus_client_php": "^2.6.0",
-        "symfony/dom-crawler": "^6.0"
+        "symfony/dom-crawler": "^6.0",
+        "tio/laravel": "^1.20"
     },
     "require-dev": {
         "barryvdh/laravel-ide-helper": "^2.12",
@@ -70,4 +71,4 @@
     },
     "minimum-stability": "dev",
     "prefer-stable": true
-}
\ No newline at end of file
+}
diff --git a/metager/composer.lock b/metager/composer.lock
index d4b34f25c..b39915536 100644
--- a/metager/composer.lock
+++ b/metager/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "01e1fc19a614c8f08338d54b8a4a8296",
+    "content-hash": "bef46997991684e2585a33612e100f13",
     "packages": [
         {
             "name": "brick/math",
@@ -508,6 +508,152 @@
             ],
             "time": "2022-02-20T15:07:15+00:00"
         },
+        {
+            "name": "gettext/gettext",
+            "version": "v4.8.7",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-gettext/Gettext.git",
+                "reference": "3f7bc5ef23302a9059e64934f3d59e454516bec0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/3f7bc5ef23302a9059e64934f3d59e454516bec0",
+                "reference": "3f7bc5ef23302a9059e64934f3d59e454516bec0",
+                "shasum": ""
+            },
+            "require": {
+                "gettext/languages": "^2.3",
+                "php": ">=5.4.0"
+            },
+            "require-dev": {
+                "illuminate/view": "^5.0.x-dev",
+                "phpunit/phpunit": "^4.8|^5.7|^6.5",
+                "squizlabs/php_codesniffer": "^3.0",
+                "symfony/yaml": "~2",
+                "twig/extensions": "*",
+                "twig/twig": "^1.31|^2.0"
+            },
+            "suggest": {
+                "illuminate/view": "Is necessary if you want to use the Blade extractor",
+                "symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator",
+                "twig/extensions": "Is necessary if you want to use the Twig extractor",
+                "twig/twig": "Is necessary if you want to use the Twig extractor"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Gettext\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Oscar Otero",
+                    "email": "oom@oscarotero.com",
+                    "homepage": "http://oscarotero.com",
+                    "role": "Developer"
+                }
+            ],
+            "description": "PHP gettext manager",
+            "homepage": "https://github.com/oscarotero/Gettext",
+            "keywords": [
+                "JS",
+                "gettext",
+                "i18n",
+                "mo",
+                "po",
+                "translation"
+            ],
+            "support": {
+                "email": "oom@oscarotero.com",
+                "issues": "https://github.com/oscarotero/Gettext/issues",
+                "source": "https://github.com/php-gettext/Gettext/tree/v4.8.7"
+            },
+            "funding": [
+                {
+                    "url": "https://paypal.me/oscarotero",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/oscarotero",
+                    "type": "github"
+                },
+                {
+                    "url": "https://www.patreon.com/misteroom",
+                    "type": "patreon"
+                }
+            ],
+            "time": "2022-08-02T09:42:10+00:00"
+        },
+        {
+            "name": "gettext/languages",
+            "version": "2.6.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-gettext/Languages.git",
+                "reference": "38ea0482f649e0802e475f0ed19fa993bcb7a618"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-gettext/Languages/zipball/38ea0482f649e0802e475f0ed19fa993bcb7a618",
+                "reference": "38ea0482f649e0802e475f0ed19fa993bcb7a618",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "^2.16.0",
+                "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4"
+            },
+            "bin": [
+                "bin/export-plural-rules"
+            ],
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Gettext\\Languages\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michele Locati",
+                    "email": "mlocati@gmail.com",
+                    "role": "Developer"
+                }
+            ],
+            "description": "gettext languages with plural rules",
+            "homepage": "https://github.com/php-gettext/Languages",
+            "keywords": [
+                "cldr",
+                "i18n",
+                "internationalization",
+                "l10n",
+                "language",
+                "languages",
+                "localization",
+                "php",
+                "plural",
+                "plural rules",
+                "plurals",
+                "translate",
+                "translations",
+                "unicode"
+            ],
+            "support": {
+                "issues": "https://github.com/php-gettext/Languages/issues",
+                "source": "https://github.com/php-gettext/Languages/tree/2.6.0"
+            },
+            "time": "2019-11-13T10:30:21+00:00"
+        },
         {
             "name": "globalcitizen/php-iban",
             "version": "v4.1.0",
@@ -5468,6 +5614,82 @@
             },
             "time": "2021-12-08T09:12:39+00:00"
         },
+        {
+            "name": "tio/laravel",
+            "version": "v1.20",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/translation/laravel.git",
+                "reference": "41213ecf8f70270df6dd7e4dd18c090bdca58df1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/translation/laravel/zipball/41213ecf8f70270df6dd7e4dd18c090bdca58df1",
+                "reference": "41213ecf8f70270df6dd7e4dd18c090bdca58df1",
+                "shasum": ""
+            },
+            "require": {
+                "gettext/gettext": "^4.8.4",
+                "gettext/languages": "<=2.6.0",
+                "guzzlehttp/guzzle": ">=6.3",
+                "illuminate/config": ">=5.5",
+                "illuminate/console": ">=5.5",
+                "illuminate/filesystem": ">=5.5",
+                "illuminate/support": ">=5.5",
+                "illuminate/translation": ">=5.5",
+                "php": ">=7.0"
+            },
+            "require-dev": {
+                "orchestra/testbench": ">=3.1",
+                "php-vcr/php-vcr": "^1.3",
+                "phpunit/phpunit": ">=5.7.27",
+                "squizlabs/php_codesniffer": "~3.0"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "Tio\\Laravel\\ServiceProvider"
+                    ]
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/Helpers/translator_functions.php"
+                ],
+                "psr-4": {
+                    "Tio\\Laravel\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Armands Leinieks",
+                    "email": "armands.leinieks@gmail.com"
+                },
+                {
+                    "name": "Michaël Hoste",
+                    "email": "michael.hoste@gmail.com"
+                }
+            ],
+            "description": "Add this package to localize your Laravel application (PHP, JSON or GetText).",
+            "homepage": "https://github.com/translation/laravel",
+            "keywords": [
+                "gettext",
+                "laravel",
+                "localization",
+                "translation",
+                "translation.io"
+            ],
+            "support": {
+                "issues": "https://github.com/translation/laravel/issues",
+                "source": "https://github.com/translation/laravel/tree/v1.20"
+            },
+            "time": "2022-06-16T14:31:10+00:00"
+        },
         {
             "name": "vlucas/phpdotenv",
             "version": "v5.4.1",
diff --git a/metager/config/translation.php b/metager/config/translation.php
new file mode 100644
index 000000000..e0017039e
--- /dev/null
+++ b/metager/config/translation.php
@@ -0,0 +1,13 @@
+<?php
+
+return [
+    'key' => env("TRANSLATION_KEY", ""),
+    'source_locale' => 'de',
+    'target_locales' => ['en', 'es'],
+
+    /* Directories to scan for Gettext strings */
+    'gettext_parse_paths' => ['app', 'resources'],
+
+    /* Where the Gettext translations are stored */
+    'gettext_locales_path' => 'resources/lang/gettext'
+];
-- 
GitLab