i18n icon indicating copy to clipboard operation
i18n copied to clipboard

Improve getter/setter Locale & support Deno Deploy

Open ngdangtu-vn opened this issue 3 years ago • 2 comments

TODO

  • [x] 4fdda23ea94b7a02342c4b66cccacdf104973f78 Improve getLocale by moving localeNegotiator (a custom negotiator rule) to setLocale to avoid unnecessary calling.
  • [x] 9880b42e678489882f9676a7f149596024593224 Allow to get current language as property -> https://t.me/grammyjs/86458
  • [ ] ~~Move loadLocalesDirSync to middleware and use the async version instead (waiting for idea feedback)~~
  • [x] Create initAsync for Deno Deploy case

Warning

The 2 commits are not fully tested yet.

ngdangtu-vn avatar Oct 16 '22 17:10 ngdangtu-vn

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 in useLocale?

ngdangtu-vn avatar Oct 17 '22 03:10 ngdangtu-vn

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 avatar Oct 23 '22 18:10 ngdangtu-vn

@ngdangtu-vn are you still interested in working on this?

KnorpelSenf avatar Dec 29 '22 12:12 KnorpelSenf

@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 :)) )

ngdangtu-vn avatar Dec 29 '22 16:12 ngdangtu-vn

Awesome! No worries, there's no hurry. I was just curious :)

KnorpelSenf avatar Dec 29 '22 16:12 KnorpelSenf

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)

ngdangtu-vn avatar Dec 29 '22 16:12 ngdangtu-vn

Yeeee just need merge regularly and you'll be fine :D

KnorpelSenf avatar Dec 29 '22 16:12 KnorpelSenf

First conflicts are starting to appear 🫠

KnorpelSenf avatar Mar 10 '23 22:03 KnorpelSenf

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 :))

ngdangtu-vn avatar Mar 11 '23 14:03 ngdangtu-vn

Alright, that's understandable. Looking forward to the next pull request then :)

KnorpelSenf avatar Mar 11 '23 15:03 KnorpelSenf