How to use y18n - 2 common examples

To help you get started, we’ve selected a few y18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lbryio / lbry-desktop / src / renderer / app.js View on Github external
import store from 'store';
import { remote } from 'electron';
import Path from 'path';
import y18n from 'y18n';
import isDev from 'electron-is-dev';

const env = process.env.NODE_ENV || 'production';
const i18n = y18n({
  directory: Path.join(remote.app.getAppPath(), '/../static/locales').replace(/\\/g, '\\\\'),
  updateFiles: false,
  locale: 'en',
});

const logs = [];
const app = {
  env,
  store,
  i18n,
  logs,
  log(message) {
    logs.push(message);
  },
};
github lbryio / lbry-desktop / src / renderer / app.js View on Github external
import store from 'store';
import { remote } from 'electron';
import Path from 'path';
import y18n from 'y18n';
import isDev from 'electron-is-dev';

const env = process.env.NODE_ENV || 'production';
const i18n = y18n({
  directory: Path.join(remote.app.getAppPath(), '/../static/locales').replace(/\\/g, '\\\\'),
  updateFiles: false,
  locale: 'en',
});

const logs = [];
const app = {
  env,
  store,
  i18n,
  logs,
  log(message) {
    logs.push(message);
  },
};

y18n

the bare-bones internationalization library used by yargs

ISC
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis

Popular y18n functions