- Notifications
You must be signed in to change notification settings - Fork4
mautic/language-packer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Mautic Language Packager
====================
This is a command line utility to build installable language packages for Mautic.
Execute acomposer install
to install the app dependencies.
Thepackages
andtranslations
directories are gitignored since these are directories our remote resources and installable packages are stored in.
The default application configuration is stored at.env
and can be overridden by creating a.env.local
file.
###> symfony/framework-bundle ###APP_ENV=prod# change below to your desired secret for Symfony app to workAPP_SECRET=c85b90b0d096eb714652f175409489bb###< symfony/framework-bundle ###
###> mautic/transifex #### Generate a Transifex API token from https://app.transifex.com/user/settings/api/TRANSIFEX_API_TOKEN=not-a-real-api-tokenTRANSIFEX_ORGANISATION=not-a-real-organisationTRANSIFEX_PROJECT=not-a-real-projectTRANSIFEX_DOWNLOAD_MAX_ATTEMPTS=3TRANSIFEX_COMPLETION=40###< mautic/transifex ###
The simplest manner to build packages is to executebin/console mautic:language:packer
from your command line interface.
By default, the command checks for a minimum completion level of a resource before downloading it. This behavior is similar to Mautic'smautic:transifex:pull
behavior, except that the completion percentage may be customized via theTRANSIFEX_COMPLETION
.env or bypassed completely via the--bypass-completion
or-b
option, e.g.bin/console mautic:language:packer -b
.
https://developers.transifex.com/reference/get_resource-language-stats response is below:
{...,"data": [ {"id":"o:some-organisation:p:some-project:r:corebundle-flashes:l:af","type":"resource_language_stats","attributes": {"untranslated_words":296,"translated_words":0,"reviewed_words":0,"proofread_words":0,"total_words":296,"untranslated_strings":28,"translated_strings":0,"reviewed_strings":0,"proofread_strings":0,"total_strings":28,"last_update":"2015-05-21T08:06:10Z","last_translation_update":null,"last_review_update":null,"last_proofread_update":null },... }, {... } ]}
Considering above JSON response, we calculate the completion percent using(translated_words/total_words) * 100
formula. By default the we are expecting the translations to be 40% complete and skip resources which do not meet this criteria. This value is configurable in .env usingTRANSIFEX_COMPLETION
.
You may filter some unwanted languages by passing the--skip-languages
or-s
option, e.g.bin/console mautic:language:packer -s es -s en
.
You may process only some languages by passing the--languages
or-l
option, e.g.bin/console mautic:language:packer -l af -l hi
.
If some file fails sanity validation (checks to make sure ini file is valid) its entire language will be pulled from processing to make sure we do not overwrite older bundles with incomplete translations.
To run testscomposer test
To run unit testscomposer test -- --testsuite=Unit
To run functional testscomposer test -- --testsuite=Functional
To run fixes by friendsofphp/php-cs-fixercomposer fixcs
To run phpstancomposer phpstan
Inhttps://github.com/<username>/language-packer/settings/secrets/actions/new
, add following action secrets:
TRANSIFEX_API_TOKEN
// Generate a Transifex API token fromhttps://app.transifex.com/user/settings/api/TRANSIFEX_ORGANISATION
TRANSIFEX_PROJECT
NEW_GITHUB_TOKEN
// details below
- Create a Github token for pushing packages to language-packs repo
- Copy this token and create a new secret with
NEW_GITHUB_TOKEN
name inhttps://github.com/<username>/language-packer/settings/secrets/actions/new
Thanks goes to these wonderful people (emoji key):
Martin Vooremäe 💻 |
This project follows theall-contributors specification. Contributions of any kind welcome!
About
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors9
Uh oh!
There was an error while loading.Please reload this page.