From 715f25dc26eff9af09fc72d01b82d5500551dcce Mon Sep 17 00:00:00 2001 From: Lewis Voncken Date: Wed, 2 May 2018 10:23:32 +0200 Subject: [PATCH] [DOCS] Updated the README.md with clear information --- README.md | 84 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 61 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3a6cd70..9044c48 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Mage2 Module Experius MissingTranslations ==================== -Add a CLI command to Collect missing translations in specified folder or the entire Magento 2 Root and add Admin Grid to display and update or add database/inline translations `(Stores > Translations > Database/Inline Translations)` +Add a CLI command to Collect missing translations in specified folder or the entire Magento 2 Root and add an Admin Grid to display and update or add database/inline translations `(Stores > Translations > Database/Inline Translations)` ``experius/module-missingtranslations`` @@ -15,12 +15,27 @@ Add a CLI command to Collect missing translations in specified folder or the ent # Main Functionalities - - CLI - - Functionality B - **v1.0.8** - - ~~Functionality C~~ - **v1.0.8** + - Recommended Minimum Usage + - Missing Translations + - Translations to database (Existing and Missing) +## Recommended Minimum Usage -## CLI + - Use the command to generate the CSV File with Missing Translations for your Locales + - **CSV File for Missing Translations** + - Use the command to manually collect and import Existing & Missing Translations for your Locales + - **Manually - Collect and Import** + - *Optional* Enable the Cronjobs in the configuration so the Database Translations will be up to date with New Modules + - **Cronjob - Collect and Import** and **Configuration** + + +## Missing Translations +### CSV File for Missing Translations + +It is possible to generate a CSV file which contains the original string and an empty string. + +#### Command +This CSV file can be generated through the following command: ``` php bin/magento experius_missingtranslations:collect [-m|--magento] [-l|--locale="..."] [-s|--store="..."] [directory] @@ -32,32 +47,50 @@ Use the command like this: php bin/magento experius_missingtranslations:collect --magento --locale nl_NL ``` -then edit the file, remove the suffig `missing` and eventually transform it to a language pack by adding a `language.xml` and a `registration.php` +#### Usage 1 - Transform Fully Translated File to Language Pack +This file can be used by a **Translation Agency** to complete the translations for the webshop. -## Missing Translations +After the **Translation Agency** has fully translated the csv file it is possible to transform it to a language pack. + +This can be done by removing the suffix `missing` and eventually transform it to a language pack by adding a `language.xml` and a `registration.php` + + +#### Usage 2 - Translate Missing Strings Through the Admin with the CSV File Besides transforming the file to a language pack it is possible to add new translations through the admin interface, which can be found under `Stores > Translations > Database / Inline` -**only if you generated it to a file with the following filename a file in app/i18n/Vendor/missing/locale_code.csv.** +**only if you generated it to a file with the following filename a file in app/i18n/Vendor/missing/locale_code.csv. (Example: app/i18n/Vendor/missing/nl_NL.csv.)** -For example generate missing nl_NL strings: -``` -php bin/magento experius_missingtranslations:collect --magento --locale nl_NL -``` +#### Usage 3 - Import the Missing Translations into the Database* +For this functionality see **Translations to database (Existing and Missing)** -## Translations to database -In addition to gathering missing translations this module also supports database translation (formerly known as inline translation) -This makes it possible for merchants to edit any translation in the adminpanel of Magento 2. +## Translations to database (Existing and Missing) -Gathering the translations happens nightly. -03:13 AM server time, all existing csv translations are added to the database. -03:23 AM server time, all missing translations found are added to the database. -This is done on global scope for all locales that are used in atleast one storeview. +In addition to gathering missing translations this module also supports database translation (formerly known as inline translate) +This makes it possible for merchants to edit any translation in the Magento Admin Panel. + +### Cronjob - Collect and Import +Collecting and importing the translations happens nightly when it is enabled **by default this functionality is disabled** +This is done on global scope for all locales that are used in at least one storeview (based on the configured locales). + +#### Existing CSV Translations +*03:13 AM server time, all existing csv translations are added to the database.* + +This functionality Imports the Existing CSV Translations into the Database then the Original String will differ from the Translated String. + + +#### Missing Translations +*03:23 AM server time, all missing translations found are added to the database.* + +This functionality Imports the Missing Translations into the Database then the Original String will be equal to the Translated String. + + +### Manually - Collect and Import Manually gathering the translations (and adding them to the database) is possible. This can be done by one of the following two Console commands: ``` @@ -76,11 +109,16 @@ Example: php bin/magento experius_missingtranslations:addtodatabase --store 1 --locale nl_NL ``` -# TODO +# Configuration -For missing translations -- Add --vendor parameter to missing translation Console command -- Add --module parameter to missing translation Console command + - Define Vendor which is used for generating the Missing Translations CSV Files + - `(Stores > Settings > Configuration > General > General > Locale Options > Language vendor for missing translations)` + - Enable the Collect and Import for Existing Translations + - `(Stores > Settings > Configuration > General > General > Locale Options > Existing translations cron enabled)` + - Enable the Collect and Import for Missing Translations + - `(Stores > Settings > Configuration > General > General > Locale Options > Missing translations cron enabled)` + +# TODO For database translations - Add flag to translation table database (user_defined); if user edit's a translation, user_defined is flagged as true.