swiftyper / fbt-sync
Extension for automatic deployment of fbt framework translations for PHP
Installs: 192
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/swiftyper/fbt-sync
Requires
- php: ^7.0 || ^8.0
- ext-json: *
- minicli/minicli: 1.0.4|^2.0
- richarddobron/fbt: ^3.0|^4.0
- swiftyper/swiftyper-php: ^v1.0.1
README
FBT sync
This library allows you to import native phrases and automatically deploy reviewed translations.
Get started with Swiftyper Translations
Requirements
- PHP 7.0 or higher
π¦ Installing
$ composer require swiftyper/fbt-sync
π§ Configuration
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(); 
 
- 
Options
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:
π Command
php ./vendor/bin/swiftyper
Options
| Option | Description | 
|---|---|
| --deploy | Deploy reviewed app translations | 
| --upload=[path] | Upload phrases/translations to swiftyper | 
| --init | Connect fbt project with swiftyper | 
| --config | Creates swiftyper_config.phpin your project root | 
| --pretty | Pretty print output | 
π License
The MIT License (MIT). Please see LICENSE for more information.
