question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing "beforeChange"-event

See original GitHub issue

I just want to start to dynamically load my translations. I thought I could simply hook into the “change” event and import my message-catalog from there. I was missing that this event is propagated after the locale is set. Therefor the messages are missing while setting the new locale in i18n and my plan failed miserably… 😉

Describe proposed solution I would love to have an event which fires on i18n.activate(locale), but before the locale is internally actually set. This would enable dynamic message-loading inside the i18n-context without the need for custom methods or similar.

PS: Thanks for the work on linguijs - love it! ❤️

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
JSteunoucommented, Jan 24, 2022

I’m no maintainer of linguijs so I was just trying to help you in case you were stuck, that’s all 😃 And because I was also like @semoal quite sure you do not need this event. (You can go with an event oriented solution, but I’m pretty sure you can do without and with better and more readable code)

Feel free to post a PR with your solution and your use case, I’m very curious about this solution. If I’m wrong I would be the 1st to support it and use it because I think I have a similar use case (That I solved by doing the less copy / paste I could do, code quoted just above, and it’s fine by me)

0reactions
stale[bot]commented, Mar 26, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is BeforeChange event listener missing in CM6? - discuss.CodeMirror
This seems to be missing in CM6. The only way to listen for changes I found was to use EditorView.updateListener.of(update => ...) However...
Read more >
Getting value of select (dropdown) before change
I am using 1.3.2 version of jQuery and using on change event but the value I am getting over there is after change....
Read more >
Tabbar deficiency: No beforeChange event ... looking for help ...
My programming skills may not be that strong so maybe I am missing something but how – if the change event fires AFTER...
Read more >
Observables - Knockout.js
If you want to be notified of the value of an observable before it is about to be changed, you can subscribe to...
Read more >
Change Streams — MongoDB Manual
To retrieve the data change event from the cursor, iterate the change stream cursor. For information on the change stream event, see Change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found