This repository has been archived by the owner on Jul 3, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(i18n): Add Spanish translation and i18n setup (#91)
* deps: added y18n * docs: a few readme tweaks + documenting setLocale * docs: translate README to Spanish * deps: add cross-env devDep * feat(i18n): add Spanish localisation for messages * fixup for docs
- Loading branch information
Showing
12 changed files
with
709 additions
and
25 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,25 @@ | ||
'use strict' | ||
|
||
const path = require('path') | ||
const y18n = require('y18n')({ | ||
directory: path.join(__dirname, '../../locales'), | ||
locale: 'en', | ||
updateFiles: process.env.CACACHE_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))) | ||
} | ||
|
||
module.exports.setLocale = locale => { | ||
y18n.setLocale(locale) | ||
} |
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,6 @@ | ||
{ | ||
"No cache entry for `%s` found in `%s`": "No cache entry for %s found in %s", | ||
"Integrity verification failed for %s (%s)": "Integrity verification failed for %s (%s)", | ||
"Bad data size: expected inserted data to be %s bytes, but got %s instead": "Bad data size: expected inserted data to be %s bytes, but got %s instead", | ||
"Cache input stream was empty": "Cache input stream was empty" | ||
} |
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,6 @@ | ||
{ | ||
"No cache entry for `%s` found in `%s`": "No existe ninguna entrada para «%s» en «%s»", | ||
"Integrity verification failed for %s (%s)": "Verificación de integridad falló para «%s» (%s)", | ||
"Bad data size: expected inserted data to be %s bytes, but got %s instead": "Tamaño incorrecto de datos: los datos insertados debieron haber sido %s octetos, pero fueron %s", | ||
"Cache input stream was empty": "El stream de entrada al caché estaba vacío" | ||
} |
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