0.4.8 • Published 6 years ago

mi18n v0.4.8

Weekly downloads
50
License
MIT
Repository
github
Last release
6 years ago

mi18n Build Status npm version Gitter chat

Add multi-lingual support to any JavaScript app or module with this light-weight package.

Features:

  • Isomorphic/Universal
  • easy translation of static text files
    • benefits: anyone can translate, no more xliff
    • reduced margin of error.
  • Variable support
  • Dependency free
  • Fast

Usage

import { I18n } from 'mi18n'

const i18nOptions = {
  extension: '.lang', // extnsion used by your language files, defaults to ".lang"
  location: 'https://location.of/language/files/', // absolute or relative url to language files
  langs: [
    // locales you would like to be active
    'en-US',
    'pt-BR',
    'de-DE', // will attempt to load `https://location.of/language/files/de-DE.lang` with current config
  ],
  locale: 'en-US', // default locale
  override: {
    'en-US': {
      autocomplete: 'Autofinish', // override individual keys or provide entire language definition
    },
  },
}
const i18n = new I18n(i18nOptions)

... later

<label>{i18n.get('addOption')}</label>

Example .lang file

de-DE = Deutsch
en-US = German

addOption = Option hinzufügen
allFieldsRemoved = Alle Felder wurden entfernt.
allowMultipleFiles = Upload mehrerer Dateien erlauben
autocomplete = Autovervollständigung
0.4.8

6 years ago

0.4.7

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.3.6

6 years ago

0.4.1

6 years ago

0.4.0-beta.5

6 years ago

0.4.0-beta.4

6 years ago

0.4.0-beta.3

6 years ago

0.4.0-beta.2

6 years ago

0.4.0-beta.1

6 years ago

0.3.5

6 years ago

0.3.4-beta.1

6 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago