amiranagram/localizator

Write default php translations to json

Opened this issue · 0 comments

I am not sure if this is something others would want to make use of:

Scenario:
To simplify the translation task I want to be able to send a single file to my translator in json format.

  • I have strings throughout the code - these are successfully scanned and added to lang/xx.json (xx is the short code for the target language)
  • I have strings in lang/en/auth.php, lang/en/validation.php etc. - these get exported for translation to lang/xx/auth.php, lang/xx/validation.php etc. - I would like these added to lang/xx.json

Current solution:
I can see from the source code that by overriding the binding of localizator.writers.default in my AppServiceProvider I am able to achieve this

        $this->app->bind('localizator.writers.default', JsonWriter::class);

I have put the above solution in place, but it would be nice to have this as an option in the configuration?