Closed luisprmat closed 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.
Or modify the parser for not deleting the existing keys but merge with new found keys! More difficult? is there any disadvantage?
This is easy, but unnecessary.
We made automatic deletion on purpose to get rid of old keys.
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.
If I understand you correctly, then I propose to save the current structure with the addition of new files:
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.
@luisprmat, see my #1859 PR 😎
Reviewed and approved!
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.
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:
'__('
,'trans('
,'@lang('
,'Lang::get('
for select keys to translate and apply regular expressions deleting keys that do not match any package.__( )
, but recently in laravel jetstream these keys was taken out of this operator (PR #837) in favour of a new methodjsonSerialize()
so they were removed from json files with their translations.I would like to find a way that these tags are not excluded from the file
source/packages/jetstream.json
Steps To Reproduce:
livewire
stack with teams..env
file (database, etc) and run migrations, install and run node dependencies