potsky / laravel-localization-helpers

🎌 Artisan commands to generate and update lang files automatically
GNU General Public License v3.0
187 stars 38 forks source link

Clean obselete, keep existing, add new with default + questions #45

Open mtx-z opened 7 years ago

mtx-z commented 7 years ago

Hey there,

thanks for the cool package. Seems really helpful, and i cant wait to get it working. This is not an issue, but i would like some advices on the way to make what i need.

What i need to do is so :

What i was thinking to do :

php artisan localization:missing -o -l "TODO: %LEMMA" To find new translated string and set a default value + delete obselete ones (no more in templates) Does it will also set null/empty translated string to the default value ?

As i see php artisan localization:missing -l 'Please translate this !'

set all lemma values to "Please translate this !"

And use the ":missing" parameter so maybe...

Thanks a lot :)

mtx-z commented 7 years ago

UPDATE :

Ty !

potsky commented 7 years ago

Hello,

You should delete manually all lemma with "TODO: ..." values. It cannot be automated by the package but an easy regex find with your favorite editor will do the job.

Then use the following command to set all lemma values to null to provide fallback translations to all missing values :

php artisan localization:missing -l null
mtx-z commented 7 years ago

Hello, thanks for you answer. Ok I got, it. I need to manually delete all lemmas that has been generated with the "TODO: ..." in lang files, then run command with null param to get empty values as default value for new added strings.

Perfect, thanks :)