This library allows you to import native phrases and automatically deploy reviewed translations.
Get started with Swiftyper Translations
- PHP 7.0 or higher
$ composer require swiftyper/fbt-sync
These steps are required:
-
Register your FBT project on Swiftyper Translations
-
Create config file and adjust the values accordingly for file
swiftyper_config.php
:$ php ./vendor/bin/swiftyper fbt --config
-
Init project settings:
$ php ./vendor/bin/swiftyper fbt --init
-
[OPTIONAL] If you want to use automatic import & deploy:
-
Create this 3 POST endpoints:
$swiftyper = new \Swiftyper\fbt\SwiftyperIntlRouter(); // yourdomain.com/intl/sync: $swiftyper->sync(); // yourdomain.com/intl/deploy: $swiftyper->deploy(); // yourdomain.com/intl/upload: $swiftyper->upload();
-
A swiftyper_config.php
file will be stored in your project root. Edit the contents of this file and adjust the values accordingly.
You need to provide a valid Swiftyper api_token value:
- api_key
string
: Project API key (required) - verify_signature
bool
: Verify signature from response- fbt:
- path
string
: Cache storage path for generated translations & source strings - hash_module
string
: Hash module - md5_digest
string
: MD5 digest
- path
- fbt:
php ./vendor/bin/swiftyper
Option | Description |
---|---|
--deploy | Deploy reviewed app translations |
--upload=[path] | Upload phrases/translations to swiftyper |
--init | Connect fbt project with swiftyper |
--config | Creates swiftyper_config.php in your project root |
--pretty | Pretty print output |
The MIT License (MIT). Please see LICENSE for more information.