Skip to content

loadLocaleJSON overrides input parameters #8

@PixsaOJ

Description

@PixsaOJ

Heads up!

use clone() with loadLocaleJSON to pass the JSON data in, or it will modify that variable. and next time you try to switch back to language you had previously, it will be overwritten with new one.

Examples:

const locales: Record<string, any> = {
  en: require('~/i18n/en.default.json'),
  pt: require('~/i18n/pt.json')
}

// User chose "EN"
loadLocaleJSON(clone(locales.en), {})

// User chose "PT"
loadLocaleJSON(clone(locales.pt || {}), clone(locales.en))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions