1
0
Fork 0

🎨 Updated prettier config

This commit is contained in:
Joost De Cock 2019-08-03 15:03:33 +02:00
parent b8e632998b
commit 6710d76b08
401 changed files with 13193 additions and 15620 deletions

View file

@ -1,22 +1,24 @@
import { version, name } from "../package.json";
import { version, name } from '../package.json'
export default {
name: name,
version: version,
hooks: {
preRender: function(svg) {
if(svg.attributes.get('freesewing:plugin-i18n') === false) {
svg.attributes.set('freesewing:plugin-i18n', version);
if (svg.attributes.get('freesewing:plugin-i18n') === false) {
svg.attributes.set('freesewing:plugin-i18n', version)
}
},
insertText: function(locale, text, data) {
if(data === false) {
console.log("No data was passed to the i18n plugin. This plugin won't do much without injecting data into it");
return text;
if (data === false) {
console.log(
"No data was passed to the i18n plugin. This plugin won't do much without injecting data into it"
)
return text
}
let prefix = data.prefix || "";
if(typeof data.strings[locale][prefix+text] === "undefined") return text;
else return data.strings[locale][prefix+text];
let prefix = data.prefix || ''
if (typeof data.strings[locale][prefix + text] === 'undefined') return text
else return data.strings[locale][prefix + text]
}
}
};
}