mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 11:33:55 +09:00
Add client-side Rhymix.lang() to get or set lang codes
This commit is contained in:
parent
bb95f24617
commit
dbd46edcc2
2 changed files with 17 additions and 1 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
const Rhymix = {
|
const Rhymix = {
|
||||||
baseurl: null,
|
baseurl: null,
|
||||||
addedDocument: [],
|
addedDocument: [],
|
||||||
|
langCodes: {},
|
||||||
loadedPopupMenus: [],
|
loadedPopupMenus: [],
|
||||||
openWindowList: {},
|
openWindowList: {},
|
||||||
currentDebugData: null,
|
currentDebugData: null,
|
||||||
|
|
@ -783,6 +784,21 @@ Rhymix.filesizeFormat = function(size) {
|
||||||
return (size / 1099511627776).toFixed(2) + 'TB';
|
return (size / 1099511627776).toFixed(2) + 'TB';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get or set a lang code
|
||||||
|
*
|
||||||
|
* @param string key
|
||||||
|
* @param string val
|
||||||
|
* @return string|void
|
||||||
|
*/
|
||||||
|
Rhymix.lang = function(key, val) {
|
||||||
|
if (typeof val === 'undefined') {
|
||||||
|
return this.langCodes[key] || key;
|
||||||
|
} else {
|
||||||
|
return this.langCodes[key] = val;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Add aliases to loaded libraries
|
// Add aliases to loaded libraries
|
||||||
Rhymix.cookie = window.Cookies;
|
Rhymix.cookie = window.Cookies;
|
||||||
Rhymix.URI = window.URI;
|
Rhymix.URI = window.URI;
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
window.xe = $.extend(_app_base, _xe_base);
|
window.xe = $.extend(_app_base, _xe_base);
|
||||||
window.xe.lang = {}; // language repository
|
window.xe.lang = Rhymix.langCodes;
|
||||||
|
|
||||||
// domready event
|
// domready event
|
||||||
$(function(){ xe.broadcast('ONREADY'); });
|
$(function(){ xe.broadcast('ONREADY'); });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue