Add client-side Rhymix.lang() to get or set lang codes

This commit is contained in:
Kijin Sung 2025-05-23 20:33:04 +09:00
parent bb95f24617
commit dbd46edcc2
2 changed files with 17 additions and 1 deletions

View file

@ -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;

View file

@ -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'); });