Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mergeLocaleMessage. add changes notification when target obj is empty #752

Merged
merged 1 commit into from
Dec 18, 2019

Conversation

jekill
Copy link
Contributor

@jekill jekill commented Dec 17, 2019

add changes notification on merging with an empty target object

@codecov-io
Copy link

Codecov Report

Merging #752 into dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #752   +/-   ##
=======================================
  Coverage   96.26%   96.26%           
=======================================
  Files          10       10           
  Lines         803      803           
=======================================
  Hits          773      773           
  Misses         30       30
Impacted Files Coverage Δ
src/index.js 97.81% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc110cd...2db16ac. Read the comment docs.

@kazupon
Copy link
Owner

kazupon commented Dec 18, 2019

@jekill
Thank you for your PR!
Could you tell us the use-cases, please? 🙏

@jekill
Copy link
Contributor Author

jekill commented Dec 18, 2019

Yes, of course.
We have a situation like this.
When a file with translations for some locale is loaded asynchronously, at this time the i18n instance may or not may have translations for the locale. We always use merge i18n.mergeLocaleMessage but it doesn't always work the way we suggested.
For example:
In the case when we don't have i18n._vm.messages.ru
After i18n.mergeLocaleMessage('ru', loadedLocales), the field
i18n._vm.messages.ru becomes to contain loadedLocales,
but UI interface outs translation keys, not values because it doesn't get a notification that locales are changed

Here is a working example of this case
https://jsfiddle.net/ViktorK/o36vwcd5/20/

@kazupon
Copy link
Owner

kazupon commented Dec 18, 2019

OK, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants