From c0a89f2e423be01bf2a8c0f81ba4d7605e4c4172 Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Tue, 6 Sep 2022 20:10:04 +0200 Subject: [PATCH] [DOC] Add readme --- Readme.md | 126 ++++++++++++------------------------------ ext_conf_template.txt | 4 +- 2 files changed, 38 insertions(+), 92 deletions(-) diff --git a/Readme.md b/Readme.md index 448ded2..75a535b 100644 --- a/Readme.md +++ b/Readme.md @@ -1,113 +1,59 @@ # TYPO3 Extension `crowdin` -Integration of crowdin into TYPO3 with the following features: - -- Inplace editing -- Fill Crowdin with all translation provided by the translation server -- Package translations to follow the structure required by TYPO3 sites - -## Install - -Install this extension + `akeneo/crowdin-api` (dev-master) - -## Usage - -### Crowdin In-Context Localization +This extensions integrates the inplace editing of Crowdin into TYPO3. +Using this features makes it fast and simple to add translations of XLF files used in the backend. ![In-Context Localization](Resources/Public/Screenshots/crowdin-inline-localization.png) -To enable in-context localization: Switch your user to Language *Crowdin In-Context Localization* - -## API-Reference / Commands - -### Convert XML to XLF - -``` -# Arguments: file name -./bin/typo3 crowdin:convertXml2Xlf ./path-to-a-xml-file.xml -``` - -### Set API Key - -The API key is added to the registry, so it must only be set once. - -``` -# Arguments: project-identifier api-key -./bin/typo3 crowdin:setApiCredentials typo3-cms 123456 -``` - -By using the following command you can switch between projects without readding the API key again +**Important:** This extensions can **not** be used to translate content but "static" translations saved in `xlf` files. -``` -# Arguments: project-identifier -./bin/typo3 crowdin:switchApiCredentials another-project -``` +## 1. Install -### Extract core translations + upload to Crowdin +### Using composer -This command will download translations from translation server and upload those to Crowdin +1. `composer req georgringer/crowdin`. +2. `./typo3cms crowdin:enable` -Instead of a single extension name, also `'*'` can be used! +### Non composer -``` -# Arguments: extension-key language version -./bin/typo3 crowdin:downloadPootleCoreTranslation about de 9 -``` +1. Download the extension from TER +2. `./typo3/sysext/core/bin/typo3 crowdin:enable` -### Extract extension translations + upload to Crowdin +### Additional information -This command will download translations from translation server and upload those to Crowdin +The enable command writes the following information to `LocalConfiguration.php`: +```php +$GLOBALS['TYPO3_CONF_VARS'] + ['SYS']['localization']['locales']['user']['t3'] = 'Crowdin In-Context Localization'; + ['SYS']['fluid']['namespaces'] => [ + 'f' => [ + 'TYPO3\\CMS\\Fluid\\ViewHelpers', + 'TYPO3Fluid\\Fluid\\ViewHelpers', + 'GeorgRinger\\Crowdin\\ViewHelpers\\Override', + ], + ], + ]; ``` -# Arguments: extension-key language -./bin/typo3 crowdin:downloadPootleExtTranslation news de -``` - -### Download languages from Crowdin -Download language packs from Crowdin and create single zip packages - -``` -# Arguments: language branch copyToL10n -./bin/typo3 crowdin:downloadCrowdinTranslations de master 0 -``` +## Usage -### Status +Follow the next steps to be able to use Crowdin in the backend: -Get translation status +1. Switch to *Install Tool* => *Maintenance* => **Manage Language Packs** +2. Click **+ Add language** and select **Crowdin In-Context Localization [t3]**, click **Update all**. +3. Switch to the **User settings** +3. Select *Crowdin In-Context Localization*. +4. Click save button. -```bash -./bin/typo3 crowdin:status -``` +After the automatic reload, a Crowdin will be shown to login with your Crowdin account and to select the language you want to translate to. -Result -``` - ------------------------------- -------------- - name Progress (%) - ------------------------------- -------------- - Croatian - hr 69 - Czech - cs 22 - Danish - da 94 - Dutch - nl 82 - French - fr 50 / 49 - German - de 92 - Greek - el 5 - Hindi - hi 50 - Italian - it 46 - Japanese - ja 8 - Khmer - km 40 - Portuguese, Brazilian - pt-BR 0 - Russian - ru 75 - Spanish - es-ES 0 - Thai - th 43 - ------------------------------- -------------- -``` +To enable in-context localization: Switch your user to Language *Crowdin In-Context Localization* -### Cleanup +## Extension Configuration -Cleanup the temporary files +This extensions can be configured in the Install Tool using *Settings* => *Extension Configuration* => *Crowdin*. -``` -./bin/typo3 crowdin:clean -``` +- `Enable to translate TYPO3 core`: Enable this checkbox to translate TYPO3 and its system extensions. +- `Extension key`: If the checkbox above is **NOT** set, an extension key can be provided which can be translated. A full list of available extensions on Crowdin is available at [localize.typo3.org/xliff/status.html](https://localize.typo3.org/xliff/status.html). e.g. `news`. diff --git a/ext_conf_template.txt b/ext_conf_template.txt index 82cf8c1..b68bd36 100644 --- a/ext_conf_template.txt +++ b/ext_conf_template.txt @@ -1,5 +1,5 @@ -# cat=basic/enable/100; type=boolean; label=Inline translation project identifier +# cat=basic/enable/100; type=boolean; label=Enable to translate TYPO3 core core = 1 -# cat=basic/enable/101; type=input; label=Alternative extension key +# cat=basic/enable/101; type=input; label=Extension key:If above setting is NOT set, provide an extension key supported by Crowdin: See https://localize.typo3.org/xliff/status.html for a full list. extensionKey = news