Skip to content

Commit

Permalink
feat(i18n): loader accepts callback
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed May 15, 2018
1 parent d43eaa1 commit c9077b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/_helpers/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export interface RawLocales {
export default i18nLoader
export function i18nLoader (
locales: { [namespace: string]: RawLocales },
defaultNS?: string,
defaultNS: string,
cb?: i18n.Callback
): i18n.i18n {
const namespaces = Object.keys(locales)
const instance = i18n
Expand All @@ -41,7 +42,7 @@ export function i18nLoader (
return res
}, { zh_CN: {}, zh_TW: {}, en: {} }),

}, undefined)
}, cb)

createAppConfigStream().subscribe(config => {
if (instance.language !== config.langCode) {
Expand Down

0 comments on commit c9077b8

Please sign in to comment.