mirror of
https://github.com/genxium/DelayNoMore
synced 2025-11-13 09:39:09 +00:00
Initial commit.
This commit is contained in:
44
frontend/packages/i18n-master/main.js
Normal file
44
frontend/packages/i18n-master/main.js
Normal file
@@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
const Package = require('./utils/package');
|
||||
|
||||
const Fs = require('fire-fs');
|
||||
const Path = require('path');
|
||||
|
||||
module.exports = {
|
||||
load () {
|
||||
Package.mount();
|
||||
},
|
||||
|
||||
unload () {
|
||||
Package.unmount();
|
||||
},
|
||||
|
||||
// register your ipc messages here
|
||||
messages: {
|
||||
'open' () {
|
||||
// open entry panel registered in package.json
|
||||
Editor.Panel.open('i18n');
|
||||
Package.metrics();
|
||||
},
|
||||
'import-asset' (event, path) {
|
||||
Editor.assetdb.refresh(path, (err, results) => {
|
||||
if (err) {
|
||||
Editor.assetdb.error('Failed to reimport asset %s, %s', path, err.stack);
|
||||
return;
|
||||
}
|
||||
Editor.assetdb._handleRefreshResults(results);
|
||||
|
||||
let metaPath = path + '.meta';
|
||||
if (Fs.existsSync(Editor.url(metaPath))) {
|
||||
let meta = Fs.readJsonSync(Editor.url(metaPath));
|
||||
meta.isPlugin = true;
|
||||
Fs.outputJsonSync(Editor.url(metaPath), meta);
|
||||
} else {
|
||||
Editor.log('Failed to set language data file to plugin script');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user