nagandev / symfony-google-translate-bundle
Symfony Translator using google
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.2.0
- ext-curl: *
- google/cloud-translate: 1.17.*
- symfony/console: ^7.1
- symfony/finder: ^7.1
- symfony/http-kernel: ^7.1
- symfony/translation: 7.1.*
- symfony/twig-bundle: ^7.1
- twig/twig: ^3.0
Requires (Dev)
- phpunit/phpunit: ^11.2
- symfony/dependency-injection: ~6.4|~7.0
Conflicts
- symfony/dependency-injection: <6.4
- symfony/event-dispatcher: <6.4
- symfony/var-dumper: <6.4
This package is auto-updated.
Last update: 2024-10-11 08:39:12 UTC
README
5000 words maximum
This bundle will allow you to translate your symfony application instantly and with a single command line in all languages supported by google.
Installing / Getting started
To use this bundle you would need two symfony4 components.
Twig & Translations.
Cause the bundle will looking for {{'the string to translate'|trans}}
in the /Templates
directory by fetching all files with the .twig
extension.
Installation with composer
Using symfony/flex.
1 - Install Twig
php composer require twig
2 - Install Translations
php composer require translations
Finaly - Install Google Translator Bundle
php composer require sabrihamda/google-translator-bundle
Initial Configuration
Templates
To safly start with this bundle, be sure that all the words to be translated are passed to the Translations component like this:
{{ 'string to translate'|trans }}
Config
Go to ./config/packages/translation.yaml
and add your target languages.
That's it :)
Run the command
Go to your command line and run the command:
php bin/console google:translate
All the messages files will be generated in the ./translation
directory.
Licensing
The code in this project is licensed under MIT license.
Copyright (c) 2024 Jonathan Kashongwe
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.