happyr / auto-fallback-translation-bundle
Make sure to use a translation service like Bing or Google to translate your missing messages
Installs: 98
Dependents: 0
Suggesters: 1
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^5.5 || ^7.0
- php-http/client-implementation: ^1.0
- php-http/httplug: ^1.0
- php-http/plugins: ^1.0
- psr/log: ~1.0
- symfony/framework-bundle: ^2.7 || ^3.0
Requires (Dev)
- matthiasnoback/symfony-dependency-injection-test: ^1.0
- php-http/guzzle6-adapter: ^1.0
- phpunit/phpunit: ^4.5 || ^5.4
- symfony/symfony: ^2.3 || ^3.0
Suggests
- php-http/httplug-bundle: To easier configure your httplug clients.
README
DEPRECATED: Use php-translation/symfony-bundle
This bundle uses Google to translate messages that you have not translated yet. So instead of using a fallback language you get a Google translated string. Sure, Google translate is not optimal but it is way better then using a different language. With this feature you can deploy a new version even before your translators have done their work.
To Install
Run the following in your project root, assuming you have composer set up for your project
composer require happyr/auto-fallback-translation-bundle
Add the bundle to app/AppKernel.php
class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Happyr\AutoFallbackTranslationBundle\HappyrAutoFallbackTranslationBundle(), } } }
Configuration
// app/config/config.yml happyr_auto_fallback_translation: enabled: false default_locale: en translation_service: "google" google_key: "%google_server_api_key%" http_client: httplug.client.auto_translation message_factory: httplug.message_factory # default // app/config/config_prod.yml happyr_auto_fallback_translation: enabled: true # Only enabled in production
To easier configure the HTTP client and message factory, have a look at HttplugBundle.