This repository has been archived by the owner on Apr 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(i18n): set up i18n plus baseline en.json locale
- Loading branch information
Showing
8 changed files
with
104 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"Execute binaries from npm packages.\n%s": "Execute binaries from npm packages.\n%s", | ||
"Package to be installed.": "Package to be installed.", | ||
"Location of the npm cache.": "Location of the npm cache.", | ||
"Skip installation if a package is missing.": "Skip installation if a package is missing.", | ||
"Path to user npmrc.": "Path to user npmrc.", | ||
"Execute string as if inside `npm run-script`.": "Execute string as if inside `npm run-script`.", | ||
"Shell to execute the command with, if any.": "Shell to execute the command with, if any.", | ||
"Generate shell code to use npx as the \"command not found\" fallback.": "Generate shell code to use npx as the \"command not found\" fallback.", | ||
"Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.", | ||
"npm binary to use for internal operations.": "npm binary to use for internal operations.", | ||
"For the full documentation, see the manual page for npx(1).": "For the full documentation, see the manual page for npx(1).", | ||
"Unable to guess a binary name from . Please use --package.": "Unable to guess a binary name from . Please use --package.", | ||
"\nERROR: You must supply a command.\n": "\nERROR: You must supply a command.\n", | ||
"Command failed: %s %s": "Command failed: %s %s", | ||
"Install for %s failed with code %s": "Install for %s failed with code %s", | ||
"Command failed: %s ": "Command failed: %s ", | ||
"%s not found. Trying with npx...": "%s not found. Trying with npx...", | ||
"command not found: %s": "command not found: %s" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
|
||
const path = require('path') | ||
const yargs = require('yargs') | ||
const y18n = require('y18n')({ | ||
directory: path.join(__dirname, 'locales'), | ||
locale: yargs.locale(), | ||
updateFiles: process.env.NPX_UPDATE_LOCALE_FILES === 'true' | ||
}) | ||
|
||
module.exports = yTag | ||
function yTag (parts) { | ||
let str = '' | ||
parts.forEach((part, i) => { | ||
const arg = arguments[i + 1] | ||
str += part | ||
if (arg) { | ||
str += '%s' | ||
} | ||
}) | ||
return y18n.__.apply(null, [str].concat([].slice.call(arguments, 1))) | ||
} |