els-intl-addon
Advanced tools
Comparing version 1.0.4 to 1.0.5
22
index.js
@@ -108,7 +108,23 @@ const flat = require("flat"); | ||
const items = getTranslations(_); | ||
const val = focusPath.node.value.indexOf("ELSCompletionDummy"); | ||
const key = focusPath.node.value.slice(0, val); | ||
const PLACEHOLDER = 'ELSCompletionDummy'; | ||
let indexOfPlaceholder = focusPath.node.value.indexOf(PLACEHOLDER); | ||
if ( | ||
indexOfPlaceholder === -1 && | ||
focusPath.parent && | ||
focusPath.parent.callee && | ||
focusPath.parent.callee.property | ||
) { | ||
// in js call | ||
indexOfPlaceholder = | ||
position.character - | ||
focusPath.parent.callee.property.loc.start.column - | ||
3; // column start of `t` call + `t("` (3 symbols) | ||
} | ||
const key = focusPath.node.value.slice(0, indexOfPlaceholder); | ||
const startPosition = { | ||
character: position.character - key.length, | ||
line: position.line | ||
line: position.line, | ||
}; | ||
@@ -115,0 +131,0 @@ Object.keys(items).forEach(tr => { |
{ | ||
"name": "els-intl-addon", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Ember Language Server intl extension", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
{ | ||
"subFolderTranslation": { | ||
"subTranslation": "text 2" | ||
"subTranslation": "text 2", | ||
"anotherTranslation": "another text" | ||
} | ||
} |
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
8220
177