2.2.4 • Published 4 years ago

@tiny-i18n/fs v2.2.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

@tiny-i18n/fs

NPM version NPM Downloads

The utilities about some actions dealing with i18n files.

API

new Fs(i18nRoot, options)

  • Example
const Fs = require('@tiny-i18n/fs')
new Fs(/* ... */)

Options

  • force boolean (default: true) Whether should insert an new record when the key is not found in dictionary.
  • quote enum('single', 'double') (default: 'single') The dictionary quote's rule.

Fs#getLanguages(): Promise<string[]>

Returns languages asynchronously.

In actual fact, The returned languages is readdir from i18nRoot.

  • Example
fs.getLanguages().then(console.log)

Fs::getWordSync(key: string, lang: string): any

Returns raw words in matched key and in exact environment.

Fs::getDictSync(lang: string): any

Returns dictionary in matched language.

Fs::update(key: string, value: string, lang: string, options: Options): boolean

Updates value of matched key.

Related

2.2.1

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.4

4 years ago

2.2.0

4 years ago

2.1.5

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago