Index: backoffice/html/languageConfig/content-container.html =================================================================== diff -u -rf54cd4c5661c7dc5e89f2f54325b127824a20df3 -rdba42265f491251f140cc2db2a3c2eb5a800872e --- backoffice/html/languageConfig/content-container.html (.../content-container.html) (revision f54cd4c5661c7dc5e89f2f54325b127824a20df3) +++ backoffice/html/languageConfig/content-container.html (.../content-container.html) (revision dba42265f491251f140cc2db2a3c2eb5a800872e) @@ -61,6 +61,49 @@ +
+
+
+ + +
+
+
+
Index: backoffice/js/languageConfig.js =================================================================== diff -u -rbeb508c5db0978deb4a03a790ae5d8f8c7c5b410 -rdba42265f491251f140cc2db2a3c2eb5a800872e --- backoffice/js/languageConfig.js (.../languageConfig.js) (revision beb508c5db0978deb4a03a790ae5d8f8c7c5b410) +++ backoffice/js/languageConfig.js (.../languageConfig.js) (revision dba42265f491251f140cc2db2a3c2eb5a800872e) @@ -49,8 +49,7 @@ "../reference/jquery-plugins/jspreadsheet-ce-4.13.1/dist/jspreadsheet.css", "../reference/jquery-plugins/jspreadsheet-ce-4.13.1/dist/jspreadsheet.datatables.css", "../reference/jquery-plugins/jspreadsheet-ce-4.13.1/dist/jspreadsheet.theme.css", - "/arms/js/common/jspreadsheet/spreadsheet.js", - "/arms/css/jspreadsheet/custom_sheet.css" + "/arms/js/common/jspreadsheet/spreadsheet.js" ], [ @@ -80,7 +79,6 @@ setSideMenu("sidebar_menu_config", "sidebar_menu_config_language"); drawExcel("modal_excel"); - }) .catch(function (error) { console.error("플러그인 로드 중 오류 발생"); @@ -280,4 +278,63 @@ startObserver, drawExcel }; -})(); \ No newline at end of file +})(); + +/////////////////////////////////////////////////// +// 엑셀데이터 JSON 변경 및 JSON 파일로 다운로드 +///////////////////////////////////////////////// +function jsonLocaleExport() { + let excelData = SpreadsheetFunctions.getExcelData(); + const koJson = convertToLocaleJson(excelData, 2); + const enJson = convertToLocaleJson(excelData, 3); + const jpJson = convertToLocaleJson(excelData, 4); + + // JSON 파일로 다운로드 + downloadJSON('ko.json', koJson); + downloadJSON('en.json', enJson); + downloadJSON('jp.json', jpJson); +} + +/////////////////////////////////////////////////// +// JSON 파일 다운로드 +///////////////////////////////////////////////// +function downloadJSON(filename, jsonObject) { + const jsonData = JSON.stringify(jsonObject, null, 2); + const blob = new Blob([jsonData], { type: 'application/json' }); + const link = document.createElement('a'); + link.href = URL.createObjectURL(blob); + link.download = filename; + link.click(); + URL.revokeObjectURL(link.href); +} + +/////////////////////////////////////////////////// +// language_config.json 엑셀형식 데이터 - JSON 변환 +///////////////////////////////////////////////// +function convertToLocaleJson(dataArray, langIndex) { + const result = {}; + + dataArray.forEach(row => { + const keys = row[1].split('.'); // "Dashboard.Header.title" => ["Dashboard", "Header", "title"] + const value = row[langIndex]; // 해당 언어의 값 + + let current = result; + + keys.forEach((key, index) => { + if (index === keys.length - 1) { + current[key] = value; + } else { + if (!current[key]) { + current[key] = {}; + } + current = current[key]; + } + }); + }); + + return result; +} + +function csvExport() { + $(".jexcel_toolbar_item.material-icons.fa.fa-save").click(); +} \ No newline at end of file Index: backoffice/mock/language_config.json =================================================================== diff -u -rb931ef02b95c27c61d598768ef2c6f1e752dcd73 -rdba42265f491251f140cc2db2a3c2eb5a800872e --- backoffice/mock/language_config.json (.../language_config.json) (revision b931ef02b95c27c61d598768ef2c6f1e752dcd73) +++ backoffice/mock/language_config.json (.../language_config.json) (revision dba42265f491251f140cc2db2a3c2eb5a800872e) @@ -1,6 +1,6 @@ [ [ "Dashboard", - "Dashboard.Header", + "Dashboard.Header.title", "대시 보드", "Dashboard", "ダッシュボード",