swiftyper/fbt-sync

Extension for automatic deployment of fbt framework translations for PHP

1.0.2 2024-11-03 17:28 UTC

This package is auto-updated.

Last update: 2024-11-03 17:28:52 UTC


README

FBT

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:

  1. Register your FBT project on Swiftyper Translations

  2. Create config file and adjust the values accordingly for file swiftyper_config.php:

    $ php ./vendor/bin/swiftyper fbt --config
  3. Init project settings:

    $ php ./vendor/bin/swiftyper fbt --init
  4. [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

πŸš€ Command

php ./vendor/bin/swiftyper

Options

πŸ“œ License

The MIT License (MIT). Please see LICENSE for more information.