nativescript-community / nativescript-community/l
loadLocaleJSON overrides input parameters
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
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))
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the loadLocaleJSON entry point and checking whether its input objects are mutated while loading locale data. Done means switching between the shown en and pt locale objects leaves the original JSON data unchanged and preserves previously loaded locale data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- internationalization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100