Improve getter/setter Locale & support Deno Deploy
TODO
- [x] 4fdda23ea94b7a02342c4b66cccacdf104973f78 Improve
getLocaleby movinglocaleNegotiator(a custom negotiator rule) tosetLocaleto avoid unnecessary calling. - [x] 9880b42e678489882f9676a7f149596024593224 Allow to get current language as property -> https://t.me/grammyjs/86458
- [ ] ~~Move
loadLocalesDirSyncto middleware and use the async version instead (waiting for idea feedback)~~ - [x] Create
initAsyncfor Deno Deploy case
Warning
The 2 commits are not fully tested yet.
About commit 4fdda23ea94b7a02342c4b66cccacdf104973f78, I think I still need to improve few more part before I can say it is done.
TODO:
- [ ] make sure language code is up to date to the
localeNegotiator. Maybe it should be set inuseLocale?
242879033c622e72d8f084ab64f6d28f88eaa8d1 commit offer simple way to deal with Deno Deploy. But I still need to deploy it to DD so I can improve error for sync case (use constructor).
Regard to updating language code , I'm still working on it. The most reasonable place is in useLocale as @Loskir also agree. It should be done tomorrow.
During the work, I can't stop myself from asking this question. Does declaring function in middleware is a good idea?
@ngdangtu-vn are you still interested in working on this?
@ngdangtu-vn are you still interested in working on this?
Of course, it's just I've been setting up my new Linux machine. So it will take a while before I could go back on this issue.
(Lot of my plans have been frozen since then :)) )
Awesome! No worries, there's no hurry. I was just curious :)
I understand, I want to finish this issue as well because the longer it takes, the worse merging battle I will have to deal with :))
(But I think it is better for my commits to follow #30)
Yeeee just need merge regularly and you'll be fine :D
First conflicts are starting to appear 🫠
First conflicts are starting to appear 🫠
Sorry, but I think I will abandon this PR and make a new branch base on the main one. Also, I'm back but feel like forgot almost everything :P glad to have some memo here :))
Alright, that's understandable. Looking forward to the next pull request then :)