Laravel-Lang / lang

List of 126 languages for Laravel Framework, Laravel Jetstream, Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova, Laravel Spark and Laravel UI.
https://laravel-lang.com/packages-lang.html
MIT License
7.49k stars 3.04k forks source link

Parser deletes some existing tags for Laravel Jetstream #1848

Closed luisprmat closed 3 years ago

luisprmat commented 3 years ago

Description:

In previous pull requests we add translations for all tags of laravel jetstream up to that moment. Among them (PR #1393 and #1394) were the following that correspond to the file JetstreamWithTeamsServiceProvider

When installing a new project these tags remain untranslated although within Jetstream they still have translation support.

Bug-llang

But if I add these keys to the es.json they get translated automatically without doing anything else.

The main reasons for this behavior are:

Steps To Reproduce:

andrey-helldar commented 3 years ago

This is problem. Dynamic keys can be absolutely anything, so the 100% regex will not work correctly.

I suggest a solution: add a new file, for example, jetstream-ext.json and save such keys to it.

luisprmat commented 3 years ago

Or modify the parser for not deleting the existing keys but merge with new found keys! More difficult? is there any disadvantage?

andrey-helldar commented 3 years ago

This is easy, but unnecessary.

We made automatic deletion on purpose to get rid of old keys.

luisprmat commented 3 years ago

The important issue is to provide a solution that allows adding and keeping those keys that do not match to any regular expression and that they can be merged with all [locale].json to be translated.

andrey-helldar commented 3 years ago

If I understand you correctly, then I propose to save the current structure with the addition of new files:

image

luisprmat commented 3 years ago

It seems perfect, and leave open the possibility of whether in the future there are extras also for other packages to be able to add them. Remember that for the base files of the framework (although I think we are not doing automatic searches for it) there are also keys that do not match regular expressions such as those corresponding to the new password rule.

andrey-helldar commented 3 years ago

@luisprmat, see my #1859 PR 😎

luisprmat commented 3 years ago

Reviewed and approved!