m2mtech/weblate-translation-provider

Symfony Weblate Translation Provider Bridge

Installs: 14 673

Dependents: 0

Suggesters: 0

Security: 0

Stars: 17

Watchers: 4

Forks: 10

Open Issues: 3

Type:symfony-translation-bridge

v1.2.0 2022-09-23 19:33 UTC

This package is auto-updated.

Last update: 2024-10-26 17:40:30 UTC


README

Author Software License

This bundle provides a Weblate integration for Symfony Translation.

Installation

composer require m2mtech/weblate-translation-provider

If you are not using Flex enable the bundle:

// config/bundles.php

return [
    // ...
    M2MTech\WeblateTranslationProvider\WeblateTranslationProviderBundle::class => ['all' => true],
];

Enable the translation provider:

# config/packages/translation.yaml
framework:
    translator:
        providers:
            weblate:
                dsn: '%env(WEBLATE_DSN)%'
                locales: ['en', 'de']

and set the DSN in your .env file:

# .env
WEBLATE_DSN=weblate://PROJECT_NAME:API_TOKEN@WEBLATE_URL

If you are using a local weblate instance, you can disable the usage of https and/or the verification of the used certificate:

# config/packages/weblate.yaml
weblate_translation_provider:
    https: false
    verify_peer: false

Usage

bin/console translation:push [options] weblate
bin/console translation:pull [options] weblate

Testing

This package has been developed for php 7.4 with compatibility tested for php 7.2 to 8.2RC2.

composer test

For compatibility tests with Symfony 5.3 to 6.0 including a local weblate instance please use the symfony-weblate-tests package.

Changelog

Please see CHANGELOG for more information about recent changes.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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