0.2.0 • Published 1 year ago

axe-locales v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
1 year ago

axe-locales

axe locale selector

Setup

npm install -D axe-locales
# or
yarn add -D axe-locales

Useage

If you set a language that does not exist, an empty object will be returned.

// require module
const {axeLocale, getLocaleList} = require('axe-locales');

// locale selector
const locale = axeLocale("ja");   // Fix Language
const locale = axeLocale("auto"); // Auto Select(from browser setting)
const locale = axeLocale("zombie"); // ->  {}

// get locale list
const list = getLocaleList(); // -> ["da", "de", "es", "eu", "fr", "ja", "ko", "nl", "pl", "pt_BR"]

Register Axe plugins.

import Vue from 'vue'
import { axeLocale } from 'axe-locales'

const reportLang = "auto";
const axeConfig = { config:{} };

if (process.env.NODE_ENV === 'development') {
  const locale = axeLocale(reportLang);
  const VueAxe = require('vue-axe').default

  // Be careful not to overwrite the locale if the language does not exist
  if(Object.keys(locale).length){
    Object.assign(axeConfig, {
      config: {
        "locale": locale
      }
    });
  }
  Vue.use(VueAxe, axeConfig);
}
0.2.0

1 year ago

0.1.7

1 year ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.5

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago