laravel-translation-manager icon indicating copy to clipboard operation
laravel-translation-manager copied to clipboard

[Question] How do you deploy translations?

Open niels-numbers opened this issue 5 years ago • 1 comments

Hi, thanks for this awesome translation-manager.

How is it thought to use this translation-manager in production? Is there any idea how it can be used by developers and non-developer site users?

When a developer adds a key, he usually changes the key:value pair in resoures/lang/en/some_group.php so far. In my scenario, the language groups are tracked by git, so they get deployed. However, with this setup, if people make changes in my-domain.org/tranlsations in production the changes won't take effect, because they are only stored in the database. I was thinking of calling translation:export on deploy to overwrite the language files with the info from the database. However, this would have the downside that the developer needs to add his new keys on production at my-domain.org/tranlsations.

Am I missing anything? Or is this package not recommended to be use in production?

We are thin

niels-numbers avatar Jul 26 '20 10:07 niels-numbers

There are many ways you can use this

As a developer doing all the translations, then you do them on your dev environment, export and then commit/deploy the updated translation files

If you want translations to be manageable in real-time, on production, then it gets more complicated and you could potentially end up with bad translations being released live. But you would basically allow translations to be managed on your production environment, and then you would use one of the events to trigger the export process. Or you could schedule a job every X minute and check if there are any new modifications to the translations by checking the created_at/updated_at fields and tracking when was the last time you ran an export.. or simply run an export every minute if you want since it's a low cost operation

vesper8 avatar Nov 18 '20 11:11 vesper8