Download the PHP package phiil/googlesheets-translation-bundle without Composer
On this page you can find all versions of the php package phiil/googlesheets-translation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phiil/googlesheets-translation-bundle
More information about phiil/googlesheets-translation-bundle
Files in phiil/googlesheets-translation-bundle
Package googlesheets-translation-bundle
Short Description This bundle enables you to deploy your translation within seconds and the best part: Manage them in Googlesheets, probably the easiest way.
License MIT
Informations about the package googlesheets-translation-bundle
SymfonyGoogleSheetsTranslationBundle
Introduction
Translation management can be rather... pesky. This bundle allows you to use a single Googlesheet and push your translations to your symfony site within seconds.
Features:
- Use as many languages as you want: this bundle sets you no limits, from just one locale (use case: you just want to keep texts out of your lovely source code) to even thirteen locales (because you just learned them on Dualingo)
- Decide which sheet page you want to use for your translations: Only the first sheet page of your GoogleSheet should be used for translations? No problem, you need one more setting. Although this is possible, we recommend to use the default mode which automatically includes all the sheets and merges them into one (translations-wise - this bundle does not edit your GoogleSheet).
- One command to push it all...: This bundle also provides you with one command which enables you to reload & push your translations in all available languages within seconds.
Requirements
- Symfony ^5.2 (an older version for Symfony Version 4.4 is also available)
- PHP ^7.4|^8.0
Installation
Run composer require phiil/googlesheets-translation-bundle
Usage
Video Guide
Want to watch a video instead of reading the guide? Today you're lucky! Watch the video on YouTube:
Text Guide
The first thing you need is a Googlesheet, go ahead and create on sheets.google.com. My demo translations sheet is available at this link. I'd suggest that you just duplicate that one into your account / apply this structure - feel free to change the head => add as many locales as you want!
Better customization & configuration possibilities for the GoogleSheet are in the works - for now, just try to stick as close as possible to the structure.
Now, you need to publish it to the web. What first sounded very weird to me (should I really publish my translations publicly to the web?!), isn't really that dangerous. The chances of someone finding your translations is really low and on top of that no one can use it to attack you / do harm to your site.
Step-by-step tutorial:
- Go to File > Publish to the web:
- A window should pop up, just press 'Publish' (assuming that you want to publish the whole sheet):
- Now, you need to extract the ID of your sheet. Back to the URL window (CMD + L / CTRL + L for hot key lovers), copy the part which is marked in the following image: .
- Finally we can hop back in Symfony. In config/services.yaml insert it like the following:
I went ahead and already pasted in the ID from above.
- (Optional) Configure which sheet pages you want to add. If you want to only push a single sheet page, you have to add the following parameter:
My final config (config/services.yaml):
- Push your translations with the built-in command:
phiil:translation:reload
(in my case, I have to executephp bin/console phiil:translation:reload
). Have a look at the output of my console:
Congratulations, you're all set!
Problems? Issues?
Just post them here on Github or contact me via email: [email protected]. Feel free to contribute!
All versions of googlesheets-translation-bundle with dependencies
symfony/framework-bundle Version ^5.4
symfony/translation Version ^5.4
symfony/cache Version ^5.4