tada: Initial commit
This commit is contained in:
parent
7c28c3b198
commit
99d65d546d
18 changed files with 5143 additions and 3 deletions
18
packages/plugin-i18n/src/index.js
Normal file
18
packages/plugin-i18n/src/index.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { version, name } from "../package.json";
|
||||
import locales from "../locales";
|
||||
|
||||
export default {
|
||||
name: name,
|
||||
version: version,
|
||||
hooks: {
|
||||
preRender: function(next) {
|
||||
this.attributes.add("freesewing:plugin-i18n", version);
|
||||
next();
|
||||
},
|
||||
insertText: function(next) {
|
||||
if(typeof locales[this.pattern.settings.locale][this.text] === 'string')
|
||||
this.text = locales[this.pattern.settings.locale][this.text];
|
||||
next();
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue