Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bigcommerce/stencil-paper

Package Overview
Dependencies
Maintainers
15
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bigcommerce/stencil-paper - npm Package Compare versions

Comparing version 3.0.0-rc.25 to 3.0.0-rc.26

.idea/codeStyles/codeStyleConfig.xml

3

CHANGELOG.md
# Changelog
## 3.0.0-rc.26 (2019-10-16)
- Fix Stencil language translation in Safari[#186](https://github.com/bigcommerce/paper/pull/186)
## 3.0.0-rc.25 (2019-10-15)

@@ -4,0 +7,0 @@ - Bump paper-handlebars version to 4.2.3 [#183](https://github.com/bigcommerce/paper/pull/183)

@@ -40,7 +40,14 @@ 'use strict';

return _.map(localeObjects, localeObject => {
const locales = _.map(localeObjects, localeObject => {
return _.isString(localeObject.region) ? `${localeObject.code}-${localeObject.region}` : localeObject.code;
});
}
// Safari sends only one language code, this is to have a default fallback in case we don't have that language
// As an example we may not have fr-FR so add fr to the header
if (locales.length === 1 && locales[0].split('-').length === 2) {
locales.push(locales[0].split('-')[0]);
}
return locales;
}
/**

@@ -47,0 +54,0 @@ * Normalize locale

4

package.json
{
"name": "@bigcommerce/stencil-paper",
"version": "3.0.0-rc.25",
"version": "3.0.0-rc.26",
"description": "A Stencil plugin to load template files and render pages using backend renderer plugins.",

@@ -10,3 +10,3 @@ "main": "index.js",

"linter": "eslint .",
"test": "npm run linter && lab -v -t 94 --ignore i18n,WebAssembly,SharedArrayBuffer,Atomics,BigUint64Array,BigInt64Array,BigInt,URL,URLSearchParams spec",
"test": "npm run linter && lab -v -t 94 --ignore i18n,WebAssembly,SharedArrayBuffer,Atomics,BigUint64Array,BigInt64Array,BigInt,URL,URLSearchParams,TextEncoder,TextDecoder,queueMicrotask spec",
"coverage": "lab -c -r console -o stdout -r html -o coverage.html spec"

@@ -13,0 +13,0 @@ },

@@ -65,2 +65,12 @@ 'use strict';

it('should return translated strings in default language if it cannot find a translation file for a specified language', done => {
const translator = Translator.create('fr-FR', translations);
expect(translator.translate('bye')).to.equal('au revoir');
expect(translator.translate('hello', { name: 'Joe' })).to.equal('Bonjour Joe');
expect(translator.translate('level1.level2')).to.equal('nous sommes dans le deuxième niveau');
done();
});
it('should return translated strings in English if cannot locate the preferred translation file', done => {

@@ -67,0 +77,0 @@ const translator = Translator.create('es', translations);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc