open-index/open-npm huggingface dataset:
npm package: @just-web/browser-i18n
Description: just-web i18n plugin module for browser
Author: Homa Wong
Latest version: 4.0.2

# @just-web/browser-i18n

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]

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

The setting is persisted in local storage.

## Install

```sh
# 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

```ts
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.

```ts
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')
```

[@just-web/browser-i18n]: https://github.com/justland/just-web/tree/main/plugins/browser-i18n
[downloads-image]: https://img.shields.io/npm/dm/@just-web/preferences.svg?style=flat
[downloads-url]: https://npmjs.org/package/@just-web/preferences
[npm-image]: https://img.shields.io/npm/v/@just-web/preferences.svg?style=flat
[npm-url]: https://npmjs.org/package/@just-web/preferences
npm package: @just-web/browser-keyboard
Description: browser implementation for @just-web/keyboard
Author: Homa Wong
Latest version: 9.1.0

# @just-web/browser-keyboard

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]

[@just-web/browser-keyboard] provides browser specific implementation for [@just-web/keyboard].

## Install

```sh
# npm
npm install @just-web/browser-keyboard

# yarn
yarn add @just-web/browser-keyboard

# pnpm
pnpm install @just-web/browser-keyboard

#rush
rush add -p @just-web/browser-keyboard
```

## Usage

```ts
import { justApp } from '@just-web/app'
import { commandsGizmoFn } from '@just-web/commands'
import { keyboardGizmoFn } from '@just-web/keyboard'
import { osGizmo } from '@just-web/os'
import { browserKeyboardGizmo } from '@just-web/browser-keyboard'

const app = await justApp({ name: 'your-awesome-app' })
  .with(commandsGizmoFn())
  .with(keyboardGizmoFn())
  .with(osGizmo)
  .with(browserKeyboardGizmo)
  .create()
```

## To-do

- Listen to key bindings change and add new key bindings

[@just-web/browser-keyboard]: https://github.com/justland/just-web/tree/main/plugins/browser-keyboard
[@just-web/keyboard]: https://github.com/justland/just-web/tree/main/plugins/keyboard
[downloads-image]: https://img.shields.io/npm/dm/@just-web/browser-keyboard.svg?style=flat
[downloads-url]: https://npmjs.org/package/@just-web/browser-keyboard
[npm-image]: https://img.shields.io/npm/v/@just-web/browser-keyboard.svg?style=flat
[npm-url]: https://npmjs.org/package/@just-web/browser-keyboard
npm package: @just-web/browser-preferences
Description: browser implementation for @just-web/preferences
Author: Homa Wong
Latest version: 9.1.0

# @just-web/browser-preferences

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]

[@just-web/browser-preferences] provides the implementation of [@just-web/preferences] on the browser.

## Install

```sh
# npm
npm install @just-web/browser-preferences

# yarn
yarn add @just-web/browser-preferences

# pnpm
pnpm install @just-web/browser-preferences

#rush
rush add -p @just-web/browser-preferences
```

## Depends on

- [@just-web/keyboard]
- [@just-web/commands]
- [@just-web/browser]

## Usage

```ts
import { justApp } from '@just-web/app'
import { browserGizmoFn } from '@just-web/browser'
import { commandsGizmoFn } from '@just-web/commands'
import { keyboardGizmoFn } from '@just-web/keyboard' // optional
import { browserPreferencesGizmo } from '@just-web/browser-preferences'

const app = await justApp({name: 'your-awesome-app'})
  .with(commandsGizmoFn())
  .with(keyboardGizmoFn())
  .with(browserGizmoFn())
  .with(browserPreferencesGizmo)
  .create()

// using the `preferences` API.
app.preferences.get(...)
app.preferences.set(...)
app.preferences.clear(...)
app.preferences.clearAll()
```

[@just-web/browser-preferences]: https://github.com/justland/just-web/tree/main/plugins/browser-preferences
[@just-web/browser]: https://github.com/justland/just-web/tree/main/plugins/browser
[@just-web/commands]: https://github.com/justland/just-web/tree/main/plugins/commands
[@just-web/keyboard]: https://github.com/justland/just-web/tree/main/plugins/keyboard
[@just-web/preferences]: https://github.com/justland/just-web/tree/main/plugins/preferences
[downloads-image]: https://img.shields.io/npm/dm/@just-web/browser-preferences.svg?style=flat
[downloads-url]: https://npmjs.org/package/@just-web/browser-preferences
[npm-image]: https://img.shields.io/npm/v/@just-web/browser-preferences.svg?style=flat
[npm-url]: https://npmjs.org/package/@just-web/browser-preferences