mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +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 = {
|
||||
baseurl: null,
|
||||
addedDocument: [],
|
||||
langCodes: {},
|
||||
loadedPopupMenus: [],
|
||||
openWindowList: {},
|
||||
currentDebugData: null,
|
||||
|
|
@ -783,6 +784,21 @@ Rhymix.filesizeFormat = function(size) {
|
|||
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
|
||||
Rhymix.cookie = window.Cookies;
|
||||
Rhymix.URI = window.URI;
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@
|
|||
}
|
||||
|
||||
window.xe = $.extend(_app_base, _xe_base);
|
||||
window.xe.lang = {}; // language repository
|
||||
window.xe.lang = Rhymix.langCodes;
|
||||
|
||||
// domready event
|
||||
$(function(){ xe.broadcast('ONREADY'); });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue