3.0.14 • Published 2 years ago

@just-web/browser-i18n v3.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@just-web/browser-i18n

NPM version NPM downloads

@just-web/browser-i18n provides basic i18n support for browser.

The setting is persisted in local storage.

Install

# npm
npm install @just-web/i18n

# yarn
yarn add @just-web/i18n

# pnpm
pnpm install @just-web/i18n

#rush
rush add -p @just-web/i18n

Usage

import { justApp } from '@just-web/app'
import { i18nGizmoFn } from '@just-web/i18n'

const app = await justApp({ name: 'your-app' })
  .with(i18nGizmoFn(navigator))
  .create()

app.i18n.getLanguage() // 'en'

Commands

It provides a setLanguageCommand, which allows you to set language using command.

import { justApp } from '@just-web/app'
import { commandsGizmoFn } from '@just-web/commands' // optional
import { keyboardGizmoFn } from '@just-web/keyboard' // optional
import { i18nGizmoFn } from '@just-web/i18n'

const app = await justApp({ name: 'your-app' })
  .with(commandsGizmoFn())
  .with(keyboardGizmoFn())
  .with(i18nGizmoFn(navigator))
  .create()

setLanguageCommand('fr')
3.0.12

2 years ago

3.0.13

2 years ago

3.0.11

2 years ago

3.0.14

2 years ago

3.0.10

2 years ago

3.0.9

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago