With this package you'll be able to send a Google Sheets link to your customer (or translation team!) and they will be able to translate your app into a Google sheet. You can then import the translations back into your app.
It will look something like this:
If you look at the GitHub page - you'll notice that the installation process is quite complex. But don't worry, It's not that hard!
Installing package via composer:
composer require nikaia/translation-sheet --dev
We are installing this as --dev because it should not be used in production! It's better to set up a process like GitHub Actions to do the sync
Publishing the config file:
php artisan vendor:publish --provider="Nikaia\TranslationSheet\TranslationSheetServiceProvider"
And now for the big part - creating a service account in the Google Cloud Platform. The full well-written guide can be found on the GitHub page.
The usage of this package is quite simple. You just need to run the following command:
php artisan translation_sheet:setup
This will prepare the setup of the sheet (nothing will be pushed yet!). Next, we need to run the following command:
php artisan translation_sheet:prepare
Once again, it will not produce anything in the sheet yet, but it will scan your language files. To push the translations you need to run:
php artisan translation_sheet:push
And now if you open your sheet - you'll see that it has been populated with the translations from your language files.
To pull the translations from the sheet you need to run:
php artisan translation_sheet:lock
To lock the file (so no one can edit it):
And pull the translations:
php artisan translation_sheet:pull
This will sync the translations from the sheet to your language files.
And finally, you can unlock the sheet:
php artisan translation_sheet:unlock
That's it! You can now use this package to manage your translations in a Google Sheet.
This package works really well as a manager for your translations. It handles both JSON and PHP translation files and gives a nice overview to the end translator. There are not many optimizations needed, but you can always improve this process by using GitHub Actions (or any similar tool) to automate the sync.
Repository: https://github.com/LaravelDaily/laravel11-localization-course/tree/lesson/packages/nikaia-translation-sheet