How to use the @freesewing/i18n.languages function in @freesewing/i18n

To help you get started, we’ve selected a few @freesewing/i18n 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 freesewing / freesewing / packages / create-freesewing-pattern / lib / prompt-library-params.js View on Github external
"use strict";

const inquirer = require("inquirer");
const validateNpmName = require("validate-npm-package-name");
const languages = require("@freesewing/i18n").languages;
const strings = require("@freesewing/i18n").strings;
const config = require("./config");

let languageChoices = [];
for (let l of Object.keys(languages)) {
  languageChoices.push({
    name: languages[l],
    value: l,
    short: languages[l]
  });
}

module.exports = async opts => {
  if (opts.name && !validateNpmName(opts.name).validForNewPackages) {
    throw new Error(`invalid package name "${opts.name}"`);
  }

  if (opts.skipPrompts) {
    if (!opts.name) {
      throw new Error(
        "invalid input; you must pass a package name with --skip-prompts"

@freesewing/i18n

Translations for the FreeSewing project

MIT
Latest version published 2 years ago

Package Health Score

64 / 100
Full package analysis