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

Laravel 5.4 JSON support? #56

Closed subotkevic closed 4 years ago

subotkevic commented 7 years ago

Hi,

I'm just wondering will this package support Laravel's JSON translation system?

Thanks.

potsky commented 7 years ago

Hi @subotkevic,

yes I need to support the new JSON lang format. But I don't know yet how to do this. I think I will change the current behaviour. When a lemma is not prefixed by a family, it throws an error. Now it will put this lemma in the JSON file instead.

But the problem is how to detect supported langs. Now I take a look on the sub-folders in the lang folder. Given that this structure is not mandatory now, I think I will let user define target langs in the configuration file for json lemma.

Is it sound correct for your use ?

vesper8 commented 7 years ago

looking forward to this! when do you think the beta will be available?

potsky commented 7 years ago

Absolutely no idea! I need to rewrite a big part of the extension to manage several types of langage files.

potsky commented 7 years ago

Perhaps in several weeks...

subotkevic commented 7 years ago

Or we could create new package for that. Because we need to:

Scan all the files and get all the __('Strings') and put them in-to lang files langs/{locale}.json to allow developers translate them without putting each string in-to the file.

potsky commented 7 years ago

I prefer to keep it the same package, 99% of the code is in common. I just need time to develop this! Next week is busy, both next are French holidays and I am with my children so dev will begin before April 18th.

riyuk commented 7 years ago

Great work! Is there an ETA for JSON support?

scottybo commented 6 years ago

Any news on this?

potsky commented 6 years ago

No ETA, never finished and I don’t work with PHP for the moment.

subotkevic commented 6 years ago

I think I'll take care of this feature by creating new package for that specifically.

mtx-z commented 4 years ago

Hi. Any update on this? It would be great to have a command parameter --tojson to output json instead of php. Or, it may be easier to generate PHP (like actually), then read it (load it with PHP as an array), convert and save to a Json from here? @subotkevic did you work on

Thanks.

EDIT: oh, I see https://github.com/subotkevic/laravel-json-translation-helper - is it production-ready?

subotkevic commented 4 years ago

@mtx-z I’m personally using it on few projects in production.