From 6d7150e2023f63fd6b34f851a87aa9ec994d829a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Thu, 14 Mar 2019 13:32:41 +0100 Subject: [PATCH] Added symfony translation bundle, and updated german translations. --- .idea/php.xml | 5 + composer.json | 1 + composer.lock | 257 ++++++++++- config/bundles.php | 1 + config/packages/dev/php_translation.yaml | 5 + config/packages/php_translation.yaml | 11 + config/routes/dev/php_translation.yaml | 6 + config/routes/php_translation.yaml | 3 + src/Form/PartType.php | 2 +- symfony.lock | 27 ++ templates/show_part_info.html.twig | 2 +- translations/messages.de.xlf | 549 ++++++++++++++++------- 12 files changed, 697 insertions(+), 172 deletions(-) create mode 100644 config/packages/dev/php_translation.yaml create mode 100644 config/packages/php_translation.yaml create mode 100644 config/routes/dev/php_translation.yaml create mode 100644 config/routes/php_translation.yaml diff --git a/.idea/php.xml b/.idea/php.xml index 07bc7d1c..3b3bc909 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -120,6 +120,11 @@ + + + + + diff --git a/composer.json b/composer.json index ea1b436b..ea8621f8 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "webmozart/assert": "^1.4" }, "require-dev": { + "php-translation/symfony-bundle": "^0.8.1", "symfony/debug-pack": "*", "symfony/maker-bundle": "^1.0", "symfony/profiler-pack": "*", diff --git a/composer.lock b/composer.lock index cf845876..ae3b4bd6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "af1eaecfa244525222a1a74e0a06a247", + "content-hash": "9e7ef444010b442d190867bd8a979f6e", "packages": [ { "name": "doctrine/annotations", @@ -6047,6 +6047,261 @@ ], "time": "2019-02-16T20:54:15+00:00" }, + { + "name": "nyholm/nsa", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/NSA.git", + "reference": "213a70dee2dd04433d31a187e24e92c8b59d1655" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/NSA/zipball/213a70dee2dd04433d31a187e24e92c8b59d1655", + "reference": "213a70dee2dd04433d31a187e24e92c8b59d1655", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0", + "webmozart/assert": "^1.1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nyholm\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "See everything and do whatever you want. No privacy rule will stop us. Used in tests, debugging and fixtures to access properties and methods.", + "homepage": "http://tnyholm.se", + "keywords": [ + "Fixture", + "debug", + "reflection", + "test" + ], + "time": "2017-04-13T17:21:01+00:00" + }, + { + "name": "php-translation/common", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-translation/common.git", + "reference": "ceac357a7ad0582d0a6be7b7f2db178c87f229fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-translation/common/zipball/ceac357a7ad0582d0a6be7b7f2db178c87f229fd", + "reference": "ceac357a7ad0582d0a6be7b7f2db178c87f229fd", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.4 || ^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Translation\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "Common translation stuff", + "time": "2018-06-14T16:18:37+00:00" + }, + { + "name": "php-translation/extractor", + "version": "1.7.1", + "source": { + "type": "git", + "url": "https://github.com/php-translation/extractor.git", + "reference": "82fc51a07fb626c0bfb31fb3f041baa88fee6acb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-translation/extractor/zipball/82fc51a07fb626c0bfb31fb3f041baa88fee6acb", + "reference": "82fc51a07fb626c0bfb31fb3f041baa88fee6acb", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.2", + "nikic/php-parser": "^3.0 || ^4.0", + "php": "^5.5 || ^7.0", + "symfony/finder": "^2.7 || ^3.0 || ^4.0", + "twig/twig": "^1.27 || ^2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.4 || ^4.0", + "symfony/translation": "^3.0 || ^4.0", + "symfony/twig-bridge": "^3.0 || ^4.0", + "symfony/validator": "^3.0 || ^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "Translation\\Extractor\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "Extract translations form the source code", + "time": "2018-07-09T17:05:17+00:00" + }, + { + "name": "php-translation/symfony-bundle", + "version": "0.8.1", + "source": { + "type": "git", + "url": "https://github.com/php-translation/symfony-bundle.git", + "reference": "fe29aeff419c311672c7d3dc72d9423eefc3ca5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-translation/symfony-bundle/zipball/fe29aeff419c311672c7d3dc72d9423eefc3ca5c", + "reference": "fe29aeff419c311672c7d3dc72d9423eefc3ca5c", + "shasum": "" + }, + "require": { + "nyholm/nsa": "^1.1", + "php": "^5.5 || ^7.0", + "php-translation/common": "^1.0", + "php-translation/extractor": "^1.3", + "php-translation/symfony-storage": "^1.0", + "symfony/finder": "^2.7 || ^3.0 || ^4.0", + "symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0", + "symfony/intl": "^2.7 || ^3.0 || ^4.0", + "symfony/translation": "^2.7 || ^3.0 || ^4.0", + "symfony/twig-bundle": "^2.7 || ^3.0 || ^4.0", + "symfony/validator": "^2.7 || ^3.0 || ^4.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.4", + "matthiasnoback/symfony-config-test": "^2.2 || ^3.1", + "matthiasnoback/symfony-dependency-injection-test": "^1.2 || ^2.3", + "nyholm/symfony-bundle-test": "^1.2.3", + "php-http/curl-client": "^1.7", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0.2", + "php-translation/translator": "^1.0", + "symfony/asset": "^2.7 || ^3.0 || ^4.0", + "symfony/console": "^2.7 || ^3.0 || ^4.0", + "symfony/dependency-injection": "^2.7 || ^3.0 || ^4.0", + "symfony/phpunit-bridge": "^3.4 || ^4.0", + "symfony/templating": "^2.7 || ^3.0 || ^4.0", + "symfony/twig-bridge": "^2.7 || ^3.0 || ^4.0", + "symfony/web-profiler-bundle": "^2.7 || ^3.0 || ^4.0" + }, + "suggest": { + "php-http/httplug-bundle": "To easier configure your httplug clients." + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "0.7-dev" + } + }, + "autoload": { + "psr-4": { + "Translation\\Bundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "time": "2018-10-02T10:05:24+00:00" + }, + { + "name": "php-translation/symfony-storage", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-translation/symfony-storage.git", + "reference": "8d7b1ea6bf22bee0c7dc9b228cf9437312373a27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-translation/symfony-storage/zipball/8d7b1ea6bf22bee0c7dc9b228cf9437312373a27", + "reference": "8d7b1ea6bf22bee0c7dc9b228cf9437312373a27", + "shasum": "" + }, + "require": { + "nyholm/nsa": "^1.1", + "php": "^5.5 || ^7.0", + "php-translation/common": "^1.0", + "symfony/translation": "^2.7 || ^3.0 || ^4.0" + }, + "require-dev": { + "symfony/framework-bundle": "^2.7.39 || ^3.0 || ^4.0", + "symfony/phpunit-bridge": "^3.4 || ^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.3-dev" + } + }, + "autoload": { + "psr-4": { + "Translation\\SymfonyStorage\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "A translation file storage using Symfony translation component.", + "time": "2018-07-10T10:32:01+00:00" + }, { "name": "symfony/browser-kit", "version": "v4.2.4", diff --git a/config/bundles.php b/config/bundles.php index 8b2eb20d..1b1310cc 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -18,4 +18,5 @@ return [ Omines\DataTablesBundle\DataTablesBundle::class => ['all' => true], Shivas\VersioningBundle\ShivasVersioningBundle::class => ['all' => true], FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], + Translation\Bundle\TranslationBundle::class => ['all' => true], ]; diff --git a/config/packages/dev/php_translation.yaml b/config/packages/dev/php_translation.yaml new file mode 100644 index 00000000..53398fbc --- /dev/null +++ b/config/packages/dev/php_translation.yaml @@ -0,0 +1,5 @@ +translation: + symfony_profiler: + enabled: true + webui: + enabled: true diff --git a/config/packages/php_translation.yaml b/config/packages/php_translation.yaml new file mode 100644 index 00000000..bc6cd978 --- /dev/null +++ b/config/packages/php_translation.yaml @@ -0,0 +1,11 @@ +translation: + locales: ["en"] + edit_in_place: + enabled: false + config_name: app + configs: + app: + dirs: ["%kernel.project_dir%/templates", "%kernel.project_dir%/src"] + output_dir: "%kernel.project_dir%/translations" + excluded_names: ["*TestCase.php", "*Test.php"] + excluded_dirs: [cache, data, logs] diff --git a/config/routes/dev/php_translation.yaml b/config/routes/dev/php_translation.yaml new file mode 100644 index 00000000..cde43b84 --- /dev/null +++ b/config/routes/dev/php_translation.yaml @@ -0,0 +1,6 @@ +_translation_webui: + resource: "@TranslationBundle/Resources/config/routing_webui.yml" + prefix: /admin + +_translation_profiler: + resource: '@TranslationBundle/Resources/config/routing_symfony_profiler.yml' diff --git a/config/routes/php_translation.yaml b/config/routes/php_translation.yaml new file mode 100644 index 00000000..142c4496 --- /dev/null +++ b/config/routes/php_translation.yaml @@ -0,0 +1,3 @@ +_translation_edit_in_place: + resource: '@TranslationBundle/Resources/config/routing_edit_in_place.yml' + prefix: /admin diff --git a/src/Form/PartType.php b/src/Form/PartType.php index 5debee07..81c519ad 100644 --- a/src/Form/PartType.php +++ b/src/Form/PartType.php @@ -62,7 +62,7 @@ class PartType extends AbstractType ->add('mininstock', IntegerType::class, ['attr' => ['min'=>0, 'placeholder' => 'part.mininstock.placeholder'], 'label'=> 'mininstock.label']) ->add('category', EntityType::class, ['class' => Category::class, 'choice_label' => 'full_path', - 'attr' => ['class' => 'selectpicker', 'data-live-search' => true, 'label'=> 'category.label']]) + 'attr' => ['class' => 'selectpicker', 'data-live-search' => true], 'label'=> 'category.label']) ->add('storelocation', EntityType::class, ['class' => Storelocation::class, 'choice_label' => 'full_path', 'attr' => ['class' => 'selectpicker', 'data-live-search' => true], 'required' => false, 'label'=> 'storelocation.label']) ->add('manufacturer', EntityType::class, ['class' => Manufacturer::class, 'choice_label' => 'full_path', diff --git a/symfony.lock b/symfony.lock index c489ebf1..53070147 100644 --- a/symfony.lock +++ b/symfony.lock @@ -123,6 +123,9 @@ "nikolaposa/version": { "version": "2.2.2" }, + "nyholm/nsa": { + "version": "1.1.0" + }, "ocramius/proxy-manager": { "version": "2.1.1" }, @@ -138,6 +141,30 @@ "./config/packages/datatables.yaml" ] }, + "php-translation/common": { + "version": "1.0.0" + }, + "php-translation/extractor": { + "version": "1.7.1" + }, + "php-translation/symfony-bundle": { + "version": "0.4", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "master", + "version": "0.4", + "ref": "ee15ad002114fba7b694a7fe429419b518d43bc4" + }, + "files": [ + "./config/packages/dev/php_translation.yaml", + "./config/packages/php_translation.yaml", + "./config/routes/dev/php_translation.yaml", + "./config/routes/php_translation.yaml" + ] + }, + "php-translation/symfony-storage": { + "version": "1.0.1" + }, "phpdocumentor/reflection-common": { "version": "1.0.1" }, diff --git a/templates/show_part_info.html.twig b/templates/show_part_info.html.twig index 5e8f991e..ed6df593 100644 --- a/templates/show_part_info.html.twig +++ b/templates/show_part_info.html.twig @@ -25,7 +25,7 @@
{{ part.manufacturer.name ?? ""}}

{{ part.name }}

{{ part.description|bbCode }}
-
+
{{ part.category.fullPath ?? "-"}}
diff --git a/translations/messages.de.xlf b/translations/messages.de.xlf index c73da159..1351d2f0 100644 --- a/translations/messages.de.xlf +++ b/translations/messages.de.xlf @@ -1,310 +1,521 @@ - - -
- -
- - + + + + sidebar.toggle Sidebar umschalten - - + + + + search.options.label Suchoptionen - - + + + + name.label Name - - + + + + category.label Kategorie - - + + + + description.label Beschreibung - - + + + + storelocation.label Lagerort - - + + + + comment.label Kommentar - - + + + + ordernumber.label.short Ordernr. - - + + + + supplier.label Lieferant - - + + + + manufacturer.label Hersteller - - + + + + footprint.label Footprint - - + + + + search.deactivateBarcode Deakt. Barcode - - + + + + search.regexmatching Reg.Ex. Matching - - + + + + search.placeholder Suche - - + + + + go.exclamation Los! - - + + + + barcode.scan Scanne Barcode - - + + + + user.loggedin.label Eingeloggt als - - + + + + user.settings.label Benutzereinstellungen - - + + + + user.info.label Benutzerinformationen - - + + + + user.logout Ausloggen - - + + + + user.login Einloggen - - + + + + category.labelp Kategorien - - + + + + actions Aktionen - - + + + + expandAll Alle ausklappen - - + + + + reduceAll Alle einklappen - - + + + + datasource Datenquelle - - + + + + storelocation.labelp Lagerorte - - + + + + footprint.labelp Footprints - - + + + + manufacturer.labelp Hersteller - - + + + + supplier.labelp Anbieter - - + + + + device.labelp Baugruppen - - + + + + tools.label Tools - - + + + + vendor.base.javascript_hint Aktivieren Sie Javascript um alle Features zu nutzen! - - + + + + part.info.title Detailinfo für - - + + + + id.label ID - - + + + + instock.label Im Lager - - + + + + mininstock.label Mindestbestand - - + + + + part.avg_price.label Durchschnittspreis - - + + + + attachment.labelp Dateianhänge - - + + + + vendor.partinfo.shopping_infos Einkaufsinformationen - - + + + + vendor.partinfo.history Historie - - + + + + part.delete.caption Bauteil löschen - - + + + + part.delete.btn Bauteil löschen - - + + + + part.withdraw.caption: Bauteile entnehmen: - - + + + + part.withdraw.btn Entnehmen - - + + + + part.withdraw.comment: Kommentar/Zweck - - + + + + part.add.caption Bauteil hinzufügen - - + + + + part.add.btn Hinzufügen - - + + + + part.add.comment Kommentar/Zweck - - + + + + createdAt Erstellt am - - + + + + lastModified Zuletzt bearbeitet - - + + + + instock.label_short Bestand - - + + + + mininstock.label_short Mindest-Bestand - - + + + + user.language_select Sprache - - + + + + language.english Englisch - - + + + + language.german Deutsch - - + + + + version.caption Version - - + + + + homepage.license Lizenzinformation - - + + + + homepage.github.caption Projektseite - - + + + + homepage.github.text - Downloads, Bugreports, ToDo-Liste usw. gibts auf der <a class="link-external" target="_blank" href="%href%">GitHub Projektseite</a> - - + GitHub Projektseite]]> + + + + homepage.help.caption Hilfe - - + + + + homepage.help.text - Hilfe und Tipps finden sie im <a class="link-external" rel="noopener" target="_blank" href="%href%">Wiki</a> der GitHub Seite. - - + Wiki der GitHub Seite. ]]> + + + + homepage.forum.caption Forum - - + + + + homepage.forum.text - Für Fragen rund um die Part-DB gibt es einen Thread auf <a class="link-external" rel="noopener" target="_blank" href="%href%">mikrocontroller.net</a> - - + mikrocontroller.net]]> + + + + homepage.wiki.caption Wiki - - + + + + homepage.wiki.text - Weitere Informationen gibt es im <a class="link-external" rel="noopener" target="_blank" href="%href%">mikrocontroller.net Artikel</a> - - + mikrocontroller.net Artikel]]> + + + + homepage.basedOn Basierend auf den ursprünglichen Version von Part-DB von - - + + + + homepage.others und anderen. - - + + + + part_list.loading.caption Lade - - + + + + part_list.loading.message Dies kann einen Moment dauern. Wenn diese Nachricht längere Zeit bestehen bleibt, versuchen sie die Seite erneut zu laden. - - + + + + flash.success Erfolg - - - flash.error - Fehler - - - flash.warning - Warnung - - - flash.notice - Hinweis - - - flash.info - Info - - + + + + + flash.error + Fehler + + + + + flash.warning + Warnung + + + + + flash.notice + Hinweis + + + + + flash.info + Info + + + + + part.edit.title + Bearbeite Bauteil %name% + + + + + part.edit.card_title + Bearbeite Bauteileinformationen von + + + + + part.name.placeholder + z.B. BC547 + + + + + part.description.placeholder + z.B. NPN 45V 0,1A 0,5W + + + + + bbcode.hint + Hinweis: Hier kann BBCode verwendet werden um den Text besonders auszuzeichnen (z.B. [b]Fett[/b]). + + + + + part.instock.placeholder + z.B. 12 + + + + + part.mininstock.placeholder + z.B. 10 + + + + + manufacturer_url.label + Herstellerlink + + + + + part.edit.save + Änderungen übernehmen + + + + + part.edit.reset + Änderungen verwerfen + + + + + part.new.card_title + Neues Bauteil erstellen + +