laravel-localization-helpers
laravel-localization-helpers copied to clipboard
Clean obselete, keep existing, add new with default + questions
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.
- I already have translation file with some good (not obselte) value translated, some good value not translated (empty/null), some obselete value (strings no more in blade templates)
- I updated my templates with new
trans('the.string.code')string
What i need to do is so :
- Delete obselete string from translation file (no more in template) (only obselete to keep non-obselete already translated strings)
- Add new template string to file (from template update) with default value
- Update empty/null string in file with default value
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 :)
UPDATE :
- my method worked :) it made exactly what i wanted.
- but havent found a way to update string with empty/null values in string with value like "todo: %LEMA"
Ty !
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
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 :)