babel-plugin-lingui-transform-js
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -51,3 +51,3 @@ 'use strict'; | ||
var name = t.isNumericLiteral(key) ? `=${key.value}` : key.name || key.value; | ||
var name = t.isNumericLiteral(key) ? '=' + key.value : key.name || key.value; | ||
@@ -67,3 +67,3 @@ if (name === 'value') { | ||
} | ||
offset = ` offset:${attr.value.value}`; | ||
offset = ' offset:' + attr.value.value; | ||
} else { | ||
@@ -106,5 +106,5 @@ var value = ''; | ||
if (!choicesKeys.length) { | ||
throw file.buildCodeFrameError(node.callee, `Missing ${choicesType} choices. At least fallback argument 'other' is required.`); | ||
throw file.buildCodeFrameError(node.callee, 'Missing ' + choicesType + ' choices. At least fallback argument \'other\' is required.'); | ||
} else if (!choicesKeys.includes('other')) { | ||
throw file.buildCodeFrameError(node.callee, `Missing fallback argument 'other'.`); | ||
throw file.buildCodeFrameError(node.callee, 'Missing fallback argument \'other\'.'); | ||
} | ||
@@ -115,3 +115,3 @@ | ||
if (!pluralRules.includes(rule) && !/=\d+/.test(rule)) { | ||
throw file.buildCodeFrameError(node.callee, `Invalid plural rule '${rule}'. Must be ${pluralRules.join(', ')} or exact number depending on your source language ('one' and 'other' for English).`); | ||
throw file.buildCodeFrameError(node.callee, 'Invalid plural rule \'' + rule + '\'. Must be ' + pluralRules.join(', ') + ' or exact number depending on your source language (\'one\' and \'other\' for English).'); | ||
} | ||
@@ -122,5 +122,5 @@ }); | ||
var argument = choicesKeys.map(function (form) { | ||
return `${form} {${choices[form]}}`; | ||
return form + ' {' + choices[form] + '}'; | ||
}).join(' '); | ||
props.text = `{${variable}, ${choicesType},${offset} ${argument}}`; | ||
props.text = '{' + variable + ', ' + choicesType + ',' + offset + ' ' + argument + '}'; | ||
} else if (isFormatMethod(node.callee)) { | ||
@@ -144,7 +144,7 @@ var _variable = node.arguments[0]; | ||
} else { | ||
var formatName = new RegExp(`^${type}\\d+$`); | ||
var formatName = new RegExp('^' + type + '\\d+$'); | ||
var existing = Object.keys(props.formats).filter(function (name) { | ||
return formatName.test(name); | ||
}); | ||
format = `${type}${existing.length || 0}`; | ||
format = '' + type + (existing.length || 0); | ||
} | ||
@@ -160,3 +160,3 @@ | ||
props.params[_variable.name] = t.objectProperty(_variable, _variable); | ||
props.text += `${parts.join(',')}`; | ||
props.text += '' + parts.join(','); | ||
} | ||
@@ -183,5 +183,5 @@ | ||
props.text += `{${text}}`; | ||
props.text += '{' + text + '}'; | ||
} else { | ||
props.text += `{${item.name}}`; | ||
props.text += '{' + item.name + '}'; | ||
props.params[item.name] = t.objectProperty(item, item); | ||
@@ -225,3 +225,3 @@ } | ||
visitor: { | ||
CallExpression, | ||
CallExpression: CallExpression, | ||
TaggedTemplateExpression: CallExpression | ||
@@ -228,0 +228,0 @@ } |
{ | ||
"name": "babel-plugin-lingui-transform-js", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Transform lingui-i18n methods to ICU message format", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18419