From b22dc17ded5b3becc28c56a503f745e26ff46bd9 Mon Sep 17 00:00:00 2001 From: pissang Date: Thu, 30 Jul 2020 23:16:16 +0800 Subject: [PATCH] refact(i18n): change built output --- .eslintignore | 2 +- build/build-i18n.js | 51 ++++-- i18n/langEN-obj.js | 221 +++++++++++++++---------- i18n/langEN.js | 217 ++++++++++++++---------- i18n/langES-obj.js | 104 +++++++----- i18n/langES.js | 100 ++++++----- i18n/langFI-obj.js | 104 +++++++----- i18n/langFI.js | 100 ++++++----- i18n/langTH-obj.js | 104 +++++++----- i18n/langTH.js | 100 ++++++----- i18n/langZH-obj.js | 217 ++++++++++++++---------- i18n/langZH.js | 213 ++++++++++++++---------- src/component/toolbox/ToolboxModel.ts | 5 +- src/component/toolbox/feature/Brush.ts | 2 +- src/locale.ts | 2 +- src/model/Model.ts | 5 - test/lang.html | 112 ++++++++++--- 17 files changed, 1016 insertions(+), 643 deletions(-) diff --git a/.eslintignore b/.eslintignore index c089061188..9e14bd7877 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,7 +1,7 @@ /dist /node_modules /build -/src/i18n +/i18n /extension-esm /extension /lib diff --git a/build/build-i18n.js b/build/build-i18n.js index f0054c607d..57c2f56215 100644 --- a/build/build-i18n.js +++ b/build/build-i18n.js @@ -1,7 +1,13 @@ const fs = require('fs'); +const preamble = require('./preamble'); +const ts = require('typescript'); +const path = require('path'); -const outFilePath = './i18n'; const umdWrapperHead = ` +${preamble.js} +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -17,9 +23,13 @@ const umdWrapperHead = ` factory({}); } })(this, function(exports) { -var lang =`; +`; const umdWrapperHeadWithEcharts = ` +${preamble.js} +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -35,28 +45,41 @@ const umdWrapperHeadWithEcharts = ` factory({}, root.echarts); } })(this, function(exports, echarts) { -var lang =`; +`; const umdWrapperTail = ` });`; async function buildI18nWrap() { - const targetDir = './src/i18n'; - const files = fs.readdirSync(targetDir); + const targetDir = path.join(__dirname, '../i18n'); + const sourceDir = path.join(__dirname, '../src/i18n'); + const files = fs.readdirSync(sourceDir); files.forEach(t => { - if(!t.startsWith('lang') || !t.endsWith('json')) return; - const fileName = t.substring(0, t.length - 5); - const type = t.substr(-7, 2); + if(!t.startsWith('lang')) { + return; + } + const fileName = t.replace(/\.ts$/, ''); + const type = fileName.replace(/^lang/, ''); const echartsRegister = ` - echarts.registerLocale('${type}', lang); + echarts.registerLocale('${type}', localeObj); `; const pureExports = ` - exports.lang = lang; + for (var key in localeObj) { + if (localeObj.hasOwnProperty(key)) { + exports[key] = localeObj[key]; + } + } `; - const code = fs.readFileSync(targetDir + '/' + t, 'utf-8'); - fs.writeFileSync(outFilePath + '/' + fileName + '.js', umdWrapperHeadWithEcharts + code + echartsRegister + umdWrapperTail, 'utf-8'); - fs.writeFileSync(outFilePath + '/' + fileName + '-obj.js', umdWrapperHead + code + pureExports + umdWrapperTail, 'utf-8'); - fs.writeFileSync(targetDir + '/' + fileName + '.ts', 'export default ' + code, 'utf-8'); + const code = fs.readFileSync(path.join(sourceDir, t), 'utf-8'); + // const outputText = ts.transpileModule(code, { + // module: ts.ModuleKind.CommonJS, + // }).outputText; + // Simple regexp replace is enough + const outputCode = code.replace(/export\s+?default/, 'var localeObj =') + .replace(/\/\*([\w\W]*?)\*\//, ''); + + fs.writeFileSync(path.join(targetDir, fileName + '.js'), umdWrapperHeadWithEcharts + outputCode + echartsRegister + umdWrapperTail, 'utf-8'); + fs.writeFileSync(path.join(targetDir, fileName + '-obj.js'), umdWrapperHead + outputCode + pureExports + umdWrapperTail, 'utf-8'); }) console.log('i18n build completed'); } diff --git a/i18n/langEN-obj.js b/i18n/langEN-obj.js index 2198d57c39..fe6824e5e0 100644 --- a/i18n/langEN-obj.js +++ b/i18n/langEN-obj.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,116 +38,135 @@ factory({}); } })(this, function(exports) { -var lang ={ - "legend": { - "selector": { - "all": "All", - "inverse": "Inv" + + +/** + * Language: English. + */ + +var localeObj = { + time: { + month: [ + 'January', 'February', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', 'December' + ], + monthAbbr: [ + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' + ], + dayOfWeek: [ + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + ], + dayOfWeekAbbr: [ + 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' + ] + }, + legend: { + selector: { + all: 'All', + inverse: 'Inv' } }, - "toolbox": { - "brush": { - "title": { - "rect": "Box Select", - "polygon": "Lasso Select", - "lineX": "Horizontally Select", - "lineY": "Vertically Select", - "keep": "Keep Selections", - "clear": "Clear Selections" + toolbox: { + brush: { + title: { + rect: 'Box Select', + polygon: 'Lasso Select', + lineX: 'Horizontally Select', + lineY: 'Vertically Select', + keep: 'Keep Selections', + clear: 'Clear Selections' } }, - "dataView": { - "title": "Data View", - "lang": [ - "Data View", - "Close", - "Refresh" - ] + dataView: { + title: 'Data View', + lang: ['Data View', 'Close', 'Refresh'] }, - "dataZoom": { - "title": { - "zoom": "Zoom", - "back": "Zoom Reset" + dataZoom: { + title: { + zoom: 'Zoom', + back: 'Zoom Reset' } }, - "magicType": { - "title": { - "line": "Switch to Line Chart", - "bar": "Switch to Bar Chart", - "stack": "Stack", - "tiled": "Tile" + magicType: { + title: { + line: 'Switch to Line Chart', + bar: 'Switch to Bar Chart', + stack: 'Stack', + tiled: 'Tile' } }, - "restore": { - "title": "Restore" + restore: { + title: 'Restore' }, - "saveAsImage": { - "title": "Save as Image", - "lang": [ - "Right Click to Save Image" - ] + saveAsImage: { + title: 'Save as Image', + lang: ['Right Click to Save Image'] } }, - "series": { - "typeNames": { - "pie": "Pie chart", - "bar": "Bar chart", - "line": "Line chart", - "scatter": "Scatter plot", - "effectScatter": "Ripple scatter plot", - "radar": "Radar chart", - "tree": "Tree", - "treemap": "Treemap", - "boxplot": "Boxplot", - "candlestick": "Candlestick", - "k": "K line chart", - "heatmap": "Heat map", - "map": "Map", - "parallel": "Parallel coordinate map", - "lines": "Line graph", - "graph": "Relationship graph", - "sankey": "Sankey diagram", - "funnel": "Funnel chart", - "gauge": "Guage", - "pictorialBar": "Pictorial bar", - "themeRiver": "Theme River Map", - "sunburst": "Sunburst" + series: { + typeNames: { + pie: 'Pie chart', + bar: 'Bar chart', + line: 'Line chart', + scatter: 'Scatter plot', + effectScatter: 'Ripple scatter plot', + radar: 'Radar chart', + tree: 'Tree', + treemap: 'Treemap', + boxplot: 'Boxplot', + candlestick: 'Candlestick', + k: 'K line chart', + heatmap: 'Heat map', + map: 'Map', + parallel: 'Parallel coordinate map', + lines: 'Line graph', + graph: 'Relationship graph', + sankey: 'Sankey diagram', + funnel: 'Funnel chart', + gauge: 'Guage', + pictorialBar: 'Pictorial bar', + themeRiver: 'Theme River Map', + sunburst: 'Sunburst' } }, - "aria": { - "general": { - "withTitle": "This is a chart about \"{title}\"", - "withoutTitle": "This is a chart" + aria: { + general: { + withTitle: 'This is a chart about "{title}"', + withoutTitle: 'This is a chart' }, - "series": { - "single": { - "prefix": "", - "withName": " with type {seriesType} named {seriesName}.", - "withoutName": " with type {seriesType}." + series: { + single: { + prefix: '', + withName: ' with type {seriesType} named {seriesName}.', + withoutName: ' with type {seriesType}.' }, - "multiple": { - "prefix": ". It consists of {seriesCount} series count.", - "withName": " The {seriesId} series is a {seriesType} representing {seriesName}.", - "withoutName": " The {seriesId} series is a {seriesType}.", - "separator": { - "middle": "", - "end": "" + multiple: { + prefix: '. It consists of {seriesCount} series count.', + withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.', + withoutName: ' The {seriesId} series is a {seriesType}.', + separator: { + middle: '', + end: '' } } }, - "data": { - "allData": "The data is as follows: ", - "partialData": "The first {displayCnt} items are: ", - "withName": "the data for {name} is {value}", - "withoutName": "{value}", - "separator": { - "middle": ",", - "end": "." + data: { + allData: 'The data is as follows: ', + partialData: 'The first {displayCnt} items are: ', + withName: 'the data for {name} is {value}', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ' } } } -} - - exports.lang = lang; +}; + for (var key in localeObj) { + if (localeObj.hasOwnProperty(key)) { + exports[key] = localeObj[key]; + } + } }); \ No newline at end of file diff --git a/i18n/langEN.js b/i18n/langEN.js index c40ea9bca2..37e347263a 100644 --- a/i18n/langEN.js +++ b/i18n/langEN.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,116 +38,131 @@ factory({}, root.echarts); } })(this, function(exports, echarts) { -var lang ={ - "legend": { - "selector": { - "all": "All", - "inverse": "Inv" + + +/** + * Language: English. + */ + +var localeObj = { + time: { + month: [ + 'January', 'February', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', 'December' + ], + monthAbbr: [ + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' + ], + dayOfWeek: [ + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + ], + dayOfWeekAbbr: [ + 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' + ] + }, + legend: { + selector: { + all: 'All', + inverse: 'Inv' } }, - "toolbox": { - "brush": { - "title": { - "rect": "Box Select", - "polygon": "Lasso Select", - "lineX": "Horizontally Select", - "lineY": "Vertically Select", - "keep": "Keep Selections", - "clear": "Clear Selections" + toolbox: { + brush: { + title: { + rect: 'Box Select', + polygon: 'Lasso Select', + lineX: 'Horizontally Select', + lineY: 'Vertically Select', + keep: 'Keep Selections', + clear: 'Clear Selections' } }, - "dataView": { - "title": "Data View", - "lang": [ - "Data View", - "Close", - "Refresh" - ] + dataView: { + title: 'Data View', + lang: ['Data View', 'Close', 'Refresh'] }, - "dataZoom": { - "title": { - "zoom": "Zoom", - "back": "Zoom Reset" + dataZoom: { + title: { + zoom: 'Zoom', + back: 'Zoom Reset' } }, - "magicType": { - "title": { - "line": "Switch to Line Chart", - "bar": "Switch to Bar Chart", - "stack": "Stack", - "tiled": "Tile" + magicType: { + title: { + line: 'Switch to Line Chart', + bar: 'Switch to Bar Chart', + stack: 'Stack', + tiled: 'Tile' } }, - "restore": { - "title": "Restore" + restore: { + title: 'Restore' }, - "saveAsImage": { - "title": "Save as Image", - "lang": [ - "Right Click to Save Image" - ] + saveAsImage: { + title: 'Save as Image', + lang: ['Right Click to Save Image'] } }, - "series": { - "typeNames": { - "pie": "Pie chart", - "bar": "Bar chart", - "line": "Line chart", - "scatter": "Scatter plot", - "effectScatter": "Ripple scatter plot", - "radar": "Radar chart", - "tree": "Tree", - "treemap": "Treemap", - "boxplot": "Boxplot", - "candlestick": "Candlestick", - "k": "K line chart", - "heatmap": "Heat map", - "map": "Map", - "parallel": "Parallel coordinate map", - "lines": "Line graph", - "graph": "Relationship graph", - "sankey": "Sankey diagram", - "funnel": "Funnel chart", - "gauge": "Guage", - "pictorialBar": "Pictorial bar", - "themeRiver": "Theme River Map", - "sunburst": "Sunburst" + series: { + typeNames: { + pie: 'Pie chart', + bar: 'Bar chart', + line: 'Line chart', + scatter: 'Scatter plot', + effectScatter: 'Ripple scatter plot', + radar: 'Radar chart', + tree: 'Tree', + treemap: 'Treemap', + boxplot: 'Boxplot', + candlestick: 'Candlestick', + k: 'K line chart', + heatmap: 'Heat map', + map: 'Map', + parallel: 'Parallel coordinate map', + lines: 'Line graph', + graph: 'Relationship graph', + sankey: 'Sankey diagram', + funnel: 'Funnel chart', + gauge: 'Guage', + pictorialBar: 'Pictorial bar', + themeRiver: 'Theme River Map', + sunburst: 'Sunburst' } }, - "aria": { - "general": { - "withTitle": "This is a chart about \"{title}\"", - "withoutTitle": "This is a chart" + aria: { + general: { + withTitle: 'This is a chart about "{title}"', + withoutTitle: 'This is a chart' }, - "series": { - "single": { - "prefix": "", - "withName": " with type {seriesType} named {seriesName}.", - "withoutName": " with type {seriesType}." + series: { + single: { + prefix: '', + withName: ' with type {seriesType} named {seriesName}.', + withoutName: ' with type {seriesType}.' }, - "multiple": { - "prefix": ". It consists of {seriesCount} series count.", - "withName": " The {seriesId} series is a {seriesType} representing {seriesName}.", - "withoutName": " The {seriesId} series is a {seriesType}.", - "separator": { - "middle": "", - "end": "" + multiple: { + prefix: '. It consists of {seriesCount} series count.', + withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.', + withoutName: ' The {seriesId} series is a {seriesType}.', + separator: { + middle: '', + end: '' } } }, - "data": { - "allData": "The data is as follows: ", - "partialData": "The first {displayCnt} items are: ", - "withName": "the data for {name} is {value}", - "withoutName": "{value}", - "separator": { - "middle": ",", - "end": "." + data: { + allData: 'The data is as follows: ', + partialData: 'The first {displayCnt} items are: ', + withName: 'the data for {name} is {value}', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ' } } } -} - - echarts.registerLocale('EN', lang); +}; + echarts.registerLocale('EN', localeObj); }); \ No newline at end of file diff --git a/i18n/langES-obj.js b/i18n/langES-obj.js index 2e1288b0c7..1744746fc2 100644 --- a/i18n/langES-obj.js +++ b/i18n/langES-obj.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,58 +38,58 @@ factory({}); } })(this, function(exports) { -var lang ={ - "legend": { - "selector": { - "all": "Todas", - "inverse": "Inversa" + + +var localeObj = { + legend: { + selector: { + all: "Todas", + inverse: "Inversa" } }, - "toolbox": { - "brush": { - "title": { - "rect": "Selección de cuadro", - "polygon": "Selección de lazo", - "lineX": "Seleccionar horizontalmente", - "lineY": "Seleccionar verticalmente", - "keep": "Mantener selección", - "clear": "Despejar selecciones" + toolbox: { + brush: { + title: { + rect: "Selección de cuadro", + polygon: "Selección de lazo", + lineX: "Seleccionar horizontalmente", + lineY: "Seleccionar verticalmente", + keep: "Mantener selección", + clear: "Despejar selecciones" } }, - "dataView": { - "title": "Ver datos", - "lang": [ - "Ver datos", - "Cerrar", - "Actualizar" - ] + dataView: { + title: "Ver datos", + lang: ["Ver datos", "Cerrar", "Actualizar"] }, - "dataZoom": { - "title": { - "zoom": "Zoom", - "back": "Restablecer zoom" + dataZoom: { + title: { + zoom: "Zoom", + back: "Restablecer zoom" } }, - "magicType": { - "title": { - "line": "Cambiar a gráfico de líneas", - "bar": "Cambiar a gráfico de barras", - "stack": "Pila", - "tiled": "Teja" + magicType: { + title: { + line: "Cambiar a gráfico de líneas", + bar: "Cambiar a gráfico de barras", + stack: "Pila", + tiled: "Teja" } }, - "restore": { - "title": "Restaurar" + restore: { + title: "Restaurar" }, - "saveAsImage": { - "title": "Guardar como imagen", - "lang": [ - "Clic derecho para guardar imagen" - ] + saveAsImage: { + title: "Guardar como imagen", + lang: ["Clic derecho para guardar imagen"] } } -} +}; - exports.lang = lang; + for (var key in localeObj) { + if (localeObj.hasOwnProperty(key)) { + exports[key] = localeObj[key]; + } + } }); \ No newline at end of file diff --git a/i18n/langES.js b/i18n/langES.js index 236716b5f8..6edce52078 100644 --- a/i18n/langES.js +++ b/i18n/langES.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,58 +38,54 @@ factory({}, root.echarts); } })(this, function(exports, echarts) { -var lang ={ - "legend": { - "selector": { - "all": "Todas", - "inverse": "Inversa" + + +var localeObj = { + legend: { + selector: { + all: "Todas", + inverse: "Inversa" } }, - "toolbox": { - "brush": { - "title": { - "rect": "Selección de cuadro", - "polygon": "Selección de lazo", - "lineX": "Seleccionar horizontalmente", - "lineY": "Seleccionar verticalmente", - "keep": "Mantener selección", - "clear": "Despejar selecciones" + toolbox: { + brush: { + title: { + rect: "Selección de cuadro", + polygon: "Selección de lazo", + lineX: "Seleccionar horizontalmente", + lineY: "Seleccionar verticalmente", + keep: "Mantener selección", + clear: "Despejar selecciones" } }, - "dataView": { - "title": "Ver datos", - "lang": [ - "Ver datos", - "Cerrar", - "Actualizar" - ] + dataView: { + title: "Ver datos", + lang: ["Ver datos", "Cerrar", "Actualizar"] }, - "dataZoom": { - "title": { - "zoom": "Zoom", - "back": "Restablecer zoom" + dataZoom: { + title: { + zoom: "Zoom", + back: "Restablecer zoom" } }, - "magicType": { - "title": { - "line": "Cambiar a gráfico de líneas", - "bar": "Cambiar a gráfico de barras", - "stack": "Pila", - "tiled": "Teja" + magicType: { + title: { + line: "Cambiar a gráfico de líneas", + bar: "Cambiar a gráfico de barras", + stack: "Pila", + tiled: "Teja" } }, - "restore": { - "title": "Restaurar" + restore: { + title: "Restaurar" }, - "saveAsImage": { - "title": "Guardar como imagen", - "lang": [ - "Clic derecho para guardar imagen" - ] + saveAsImage: { + title: "Guardar como imagen", + lang: ["Clic derecho para guardar imagen"] } } -} +}; - echarts.registerLocale('ES', lang); + echarts.registerLocale('ES', localeObj); }); \ No newline at end of file diff --git a/i18n/langFI-obj.js b/i18n/langFI-obj.js index 637c10be1b..42e53b5a4e 100644 --- a/i18n/langFI-obj.js +++ b/i18n/langFI-obj.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,58 +38,58 @@ factory({}); } })(this, function(exports) { -var lang ={ - "legend": { - "selector": { - "all": "Kaikki", - "inverse": "Käänteinen" + + +var localeObj = { + legend: { + selector: { + all: "Kaikki", + inverse: "Käänteinen" } }, - "toolbox": { - "brush": { - "title": { - "rect": "Laatikko valinta", - "polygon": "Lasso valinta", - "lineX": "Vaakataso valinta", - "lineY": "Pysty valinta", - "keep": "Pidä valinta", - "clear": "Poista valinta" + toolbox: { + brush: { + title: { + rect: "Laatikko valinta", + polygon: "Lasso valinta", + lineX: "Vaakataso valinta", + lineY: "Pysty valinta", + keep: "Pidä valinta", + clear: "Poista valinta" } }, - "dataView": { - "title": "Data näkymä", - "lang": [ - "Data näkymä", - "Sulje", - "Päivitä" - ] + dataView: { + title: "Data näkymä", + lang: ["Data näkymä", "Sulje", "Päivitä"] }, - "dataZoom": { - "title": { - "zoom": "Zoomaa", - "back": "Zoomin nollaus" + dataZoom: { + title: { + zoom: "Zoomaa", + back: "Zoomin nollaus" } }, - "magicType": { - "title": { - "line": "Vaihda Viivakaavioon", - "bar": "Vaihda palkkikaavioon", - "stack": "Pinoa", - "tiled": "Erottele" + magicType: { + title: { + line: "Vaihda Viivakaavioon", + bar: "Vaihda palkkikaavioon", + stack: "Pinoa", + tiled: "Erottele" } }, - "restore": { - "title": "Palauta" + restore: { + title: "Palauta" }, - "saveAsImage": { - "title": "Tallenna kuvana", - "lang": [ - "Paina oikeaa hiirennappia tallentaaksesi kuva" - ] + saveAsImage: { + title: "Tallenna kuvana", + lang: ["Paina oikeaa hiirennappia tallentaaksesi kuva"] } } -} +}; - exports.lang = lang; + for (var key in localeObj) { + if (localeObj.hasOwnProperty(key)) { + exports[key] = localeObj[key]; + } + } }); \ No newline at end of file diff --git a/i18n/langFI.js b/i18n/langFI.js index 8ec5105650..435be693be 100644 --- a/i18n/langFI.js +++ b/i18n/langFI.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,58 +38,54 @@ factory({}, root.echarts); } })(this, function(exports, echarts) { -var lang ={ - "legend": { - "selector": { - "all": "Kaikki", - "inverse": "Käänteinen" + + +var localeObj = { + legend: { + selector: { + all: "Kaikki", + inverse: "Käänteinen" } }, - "toolbox": { - "brush": { - "title": { - "rect": "Laatikko valinta", - "polygon": "Lasso valinta", - "lineX": "Vaakataso valinta", - "lineY": "Pysty valinta", - "keep": "Pidä valinta", - "clear": "Poista valinta" + toolbox: { + brush: { + title: { + rect: "Laatikko valinta", + polygon: "Lasso valinta", + lineX: "Vaakataso valinta", + lineY: "Pysty valinta", + keep: "Pidä valinta", + clear: "Poista valinta" } }, - "dataView": { - "title": "Data näkymä", - "lang": [ - "Data näkymä", - "Sulje", - "Päivitä" - ] + dataView: { + title: "Data näkymä", + lang: ["Data näkymä", "Sulje", "Päivitä"] }, - "dataZoom": { - "title": { - "zoom": "Zoomaa", - "back": "Zoomin nollaus" + dataZoom: { + title: { + zoom: "Zoomaa", + back: "Zoomin nollaus" } }, - "magicType": { - "title": { - "line": "Vaihda Viivakaavioon", - "bar": "Vaihda palkkikaavioon", - "stack": "Pinoa", - "tiled": "Erottele" + magicType: { + title: { + line: "Vaihda Viivakaavioon", + bar: "Vaihda palkkikaavioon", + stack: "Pinoa", + tiled: "Erottele" } }, - "restore": { - "title": "Palauta" + restore: { + title: "Palauta" }, - "saveAsImage": { - "title": "Tallenna kuvana", - "lang": [ - "Paina oikeaa hiirennappia tallentaaksesi kuva" - ] + saveAsImage: { + title: "Tallenna kuvana", + lang: ["Paina oikeaa hiirennappia tallentaaksesi kuva"] } } -} +}; - echarts.registerLocale('FI', lang); + echarts.registerLocale('FI', localeObj); }); \ No newline at end of file diff --git a/i18n/langTH-obj.js b/i18n/langTH-obj.js index e6f615061e..46f4ee9385 100644 --- a/i18n/langTH-obj.js +++ b/i18n/langTH-obj.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,58 +38,58 @@ factory({}); } })(this, function(exports) { -var lang ={ - "legend": { - "selector": { - "all": "ทั้งหมด", - "inverse": "ผกผัน" + + +var localeObj = { + legend: { + selector: { + all: "ทั้งหมด", + inverse: "ผกผัน" } }, - "toolbox": { - "brush": { - "title": { - "rect": "ตัวเลือกแบบกล่อง", - "polygon": "ตัวเลือกแบบบ่วงบาศ", - "lineX": "ตัวเลือกแบบแนวนอน", - "lineY": "ตัวเลือกแบบแนวตั้ง", - "keep": "บันทึกตัวเลือก", - "clear": "ล้างตัวเลือก" + toolbox: { + brush: { + title: { + rect: "ตัวเลือกแบบกล่อง", + polygon: "ตัวเลือกแบบบ่วงบาศ", + lineX: "ตัวเลือกแบบแนวนอน", + lineY: "ตัวเลือกแบบแนวตั้ง", + keep: "บันทึกตัวเลือก", + clear: "ล้างตัวเลือก" } }, - "dataView": { - "title": "มุมมองข้อมูล", - "lang": [ - "มุมมองข้อมูล", - "ปิด", - "รีเฟรช" - ] + dataView: { + title: "มุมมองข้อมูล", + lang: ["มุมมองข้อมูล", "ปิด", "รีเฟรช"] }, - "dataZoom": { - "title": { - "zoom": "ซูม", - "back": "ตั้งซูมใหม่" + dataZoom: { + title: { + zoom: "ซูม", + back: "ตั้งซูมใหม่" } }, - "magicType": { - "title": { - "line": "สวิตซ์แบบแผนภาพเส้น", - "bar": "สวิตซ์แบบแผนภาพแท่ง", - "stack": "กองไว้", - "tiled": "แยกไว้" + magicType: { + title: { + line: "สวิตซ์แบบแผนภาพเส้น", + bar: "สวิตซ์แบบแผนภาพแท่ง", + stack: "กองไว้", + tiled: "แยกไว้" } }, - "restore": { - "title": "ตั้งค่าใหม่" + restore: { + title: "ตั้งค่าใหม่" }, - "saveAsImage": { - "title": "บันทึกไปยังรูปภาพ", - "lang": [ - "คลิกขวาเพื่อบันทึกรูปภาพ" - ] + saveAsImage: { + title: "บันทึกไปยังรูปภาพ", + lang: ["คลิกขวาเพื่อบันทึกรูปภาพ"] } } -} +}; - exports.lang = lang; + for (var key in localeObj) { + if (localeObj.hasOwnProperty(key)) { + exports[key] = localeObj[key]; + } + } }); \ No newline at end of file diff --git a/i18n/langTH.js b/i18n/langTH.js index c82a24e187..db7ecce3b4 100644 --- a/i18n/langTH.js +++ b/i18n/langTH.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,58 +38,54 @@ factory({}, root.echarts); } })(this, function(exports, echarts) { -var lang ={ - "legend": { - "selector": { - "all": "ทั้งหมด", - "inverse": "ผกผัน" + + +var localeObj = { + legend: { + selector: { + all: "ทั้งหมด", + inverse: "ผกผัน" } }, - "toolbox": { - "brush": { - "title": { - "rect": "ตัวเลือกแบบกล่อง", - "polygon": "ตัวเลือกแบบบ่วงบาศ", - "lineX": "ตัวเลือกแบบแนวนอน", - "lineY": "ตัวเลือกแบบแนวตั้ง", - "keep": "บันทึกตัวเลือก", - "clear": "ล้างตัวเลือก" + toolbox: { + brush: { + title: { + rect: "ตัวเลือกแบบกล่อง", + polygon: "ตัวเลือกแบบบ่วงบาศ", + lineX: "ตัวเลือกแบบแนวนอน", + lineY: "ตัวเลือกแบบแนวตั้ง", + keep: "บันทึกตัวเลือก", + clear: "ล้างตัวเลือก" } }, - "dataView": { - "title": "มุมมองข้อมูล", - "lang": [ - "มุมมองข้อมูล", - "ปิด", - "รีเฟรช" - ] + dataView: { + title: "มุมมองข้อมูล", + lang: ["มุมมองข้อมูล", "ปิด", "รีเฟรช"] }, - "dataZoom": { - "title": { - "zoom": "ซูม", - "back": "ตั้งซูมใหม่" + dataZoom: { + title: { + zoom: "ซูม", + back: "ตั้งซูมใหม่" } }, - "magicType": { - "title": { - "line": "สวิตซ์แบบแผนภาพเส้น", - "bar": "สวิตซ์แบบแผนภาพแท่ง", - "stack": "กองไว้", - "tiled": "แยกไว้" + magicType: { + title: { + line: "สวิตซ์แบบแผนภาพเส้น", + bar: "สวิตซ์แบบแผนภาพแท่ง", + stack: "กองไว้", + tiled: "แยกไว้" } }, - "restore": { - "title": "ตั้งค่าใหม่" + restore: { + title: "ตั้งค่าใหม่" }, - "saveAsImage": { - "title": "บันทึกไปยังรูปภาพ", - "lang": [ - "คลิกขวาเพื่อบันทึกรูปภาพ" - ] + saveAsImage: { + title: "บันทึกไปยังรูปภาพ", + lang: ["คลิกขวาเพื่อบันทึกรูปภาพ"] } } -} +}; - echarts.registerLocale('TH', lang); + echarts.registerLocale('TH', localeObj); }); \ No newline at end of file diff --git a/i18n/langZH-obj.js b/i18n/langZH-obj.js index 085a226286..8807ba483b 100644 --- a/i18n/langZH-obj.js +++ b/i18n/langZH-obj.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,116 +38,131 @@ factory({}); } })(this, function(exports) { -var lang ={ - "legend": { - "selector": { - "all": "全选", - "inverse": "反选" + + +var localeObj = { + time: { + month: [ + '一月', '二月', '三月', '四月', '五月', '六月', + '七月', '八月', '九月', '十月', '十一月', '十二月' + ], + monthAbbr: [ + '1月', '2月', '3月', '4月', '5月', '6月', + '7月', '8月', '9月', '10月', '11月', '12月' + ], + dayOfWeek: [ + '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六' + ], + dayOfWeekAbbr: [ + '日', '一', '二', '三', '四', '五', '六' + ] + }, + legend: { + selector: { + all: '全选', + inverse: '反选' } }, - "toolbox": { - "brush": { - "title": { - "rect": "矩形选择", - "polygon": "圈选", - "lineX": "横向选择", - "lineY": "纵向选择", - "keep": "保持选择", - "clear": "清除选择" + toolbox: { + brush: { + title: { + rect: '矩形选择', + polygon: '圈选', + lineX: '横向选择', + lineY: '纵向选择', + keep: '保持选择', + clear: '清除选择' } }, - "dataView": { - "title": "数据视图", - "lang": [ - "数据视图", - "关闭", - "刷新" - ] + dataView: { + title: '数据视图', + lang: ['数据视图', '关闭', '刷新'] }, - "dataZoom": { - "title": { - "zoom": "区域缩放", - "back": "区域缩放还原" + dataZoom: { + title: { + zoom: '区域缩放', + back: '区域缩放还原' } }, - "magicType": { - "title": { - "line": "切换为折线图", - "bar": "切换为柱状图", - "stack": "切换为堆叠", - "tiled": "切换为平铺" + magicType: { + title: { + line: '切换为折线图', + bar: '切换为柱状图', + stack: '切换为堆叠', + tiled: '切换为平铺' } }, - "restore": { - "title": "还原" + restore: { + title: '还原' }, - "saveAsImage": { - "title": "保存为图片", - "lang": [ - "右键另存为图片" - ] + saveAsImage: { + title: '保存为图片', + lang: ['右键另存为图片'] } }, - "series": { - "typeNames": { - "pie": "饼图", - "bar": "柱状图", - "line": "折线图", - "scatter": "散点图", - "effectScatter": "涟漪散点图", - "radar": "雷达图", - "tree": "树图", - "treemap": "矩形树图", - "boxplot": "箱型图", - "candlestick": "K线图", - "k": "K线图", - "heatmap": "热力图", - "map": "地图", - "parallel": "平行坐标图", - "lines": "线图", - "graph": "关系图", - "sankey": "桑基图", - "funnel": "漏斗图", - "gauge": "仪表盘图", - "pictorialBar": "象形柱图", - "themeRiver": "主题河流图", - "sunburst": "旭日图" + series: { + typeNames: { + pie: '饼图', + bar: '柱状图', + line: '折线图', + scatter: '散点图', + effectScatter: '涟漪散点图', + radar: '雷达图', + tree: '树图', + treemap: '矩形树图', + boxplot: '箱型图', + candlestick: 'K线图', + k: 'K线图', + heatmap: '热力图', + map: '地图', + parallel: '平行坐标图', + lines: '线图', + graph: '关系图', + sankey: '桑基图', + funnel: '漏斗图', + gauge: '仪表盘图', + pictorialBar: '象形柱图', + themeRiver: '主题河流图', + sunburst: '旭日图' } }, - "aria": { - "general": { - "withTitle": "这是一个关于“{title}”的图表。", - "withoutTitle": "这是一个图表," + aria: { + general: { + withTitle: '这是一个关于“{title}”的图表。', + withoutTitle: '这是一个图表,' }, - "series": { - "single": { - "prefix": "", - "withName": "图表类型是{seriesType},表示{seriesName}。", - "withoutName": "图表类型是{seriesType}。" + series: { + single: { + prefix: '', + withName: '图表类型是{seriesType},表示{seriesName}。', + withoutName: '图表类型是{seriesType}。' }, - "multiple": { - "prefix": "它由{seriesCount}个图表系列组成。", - "withName": "第{seriesId}个系列是一个表示{seriesName}的{seriesType},", - "withoutName": "第{seriesId}个系列是一个{seriesType},", - "separator": { - "middle": ";", - "end": "。" + multiple: { + prefix: '它由{seriesCount}个图表系列组成。', + withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},', + withoutName: '第{seriesId}个系列是一个{seriesType},', + separator: { + middle: ';', + end: '。' } } }, - "data": { - "allData": "其数据是——", - "partialData": "其中,前{displayCnt}项是——", - "withName": "{name}的数据是{value}", - "withoutName": "{value}", - "separator": { - "middle": ",", - "end": "" + data: { + allData: '其数据是——', + partialData: '其中,前{displayCnt}项是——', + withName: '{name}的数据是{value}', + withoutName: '{value}', + separator: { + middle: ',', + end: '' } } } -} - - exports.lang = lang; +}; + for (var key in localeObj) { + if (localeObj.hasOwnProperty(key)) { + exports[key] = localeObj[key]; + } + } }); \ No newline at end of file diff --git a/i18n/langZH.js b/i18n/langZH.js index 7bd84b3372..022d01fa35 100644 --- a/i18n/langZH.js +++ b/i18n/langZH.js @@ -1,4 +1,28 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -14,116 +38,127 @@ factory({}, root.echarts); } })(this, function(exports, echarts) { -var lang ={ - "legend": { - "selector": { - "all": "全选", - "inverse": "反选" + + +var localeObj = { + time: { + month: [ + '一月', '二月', '三月', '四月', '五月', '六月', + '七月', '八月', '九月', '十月', '十一月', '十二月' + ], + monthAbbr: [ + '1月', '2月', '3月', '4月', '5月', '6月', + '7月', '8月', '9月', '10月', '11月', '12月' + ], + dayOfWeek: [ + '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六' + ], + dayOfWeekAbbr: [ + '日', '一', '二', '三', '四', '五', '六' + ] + }, + legend: { + selector: { + all: '全选', + inverse: '反选' } }, - "toolbox": { - "brush": { - "title": { - "rect": "矩形选择", - "polygon": "圈选", - "lineX": "横向选择", - "lineY": "纵向选择", - "keep": "保持选择", - "clear": "清除选择" + toolbox: { + brush: { + title: { + rect: '矩形选择', + polygon: '圈选', + lineX: '横向选择', + lineY: '纵向选择', + keep: '保持选择', + clear: '清除选择' } }, - "dataView": { - "title": "数据视图", - "lang": [ - "数据视图", - "关闭", - "刷新" - ] + dataView: { + title: '数据视图', + lang: ['数据视图', '关闭', '刷新'] }, - "dataZoom": { - "title": { - "zoom": "区域缩放", - "back": "区域缩放还原" + dataZoom: { + title: { + zoom: '区域缩放', + back: '区域缩放还原' } }, - "magicType": { - "title": { - "line": "切换为折线图", - "bar": "切换为柱状图", - "stack": "切换为堆叠", - "tiled": "切换为平铺" + magicType: { + title: { + line: '切换为折线图', + bar: '切换为柱状图', + stack: '切换为堆叠', + tiled: '切换为平铺' } }, - "restore": { - "title": "还原" + restore: { + title: '还原' }, - "saveAsImage": { - "title": "保存为图片", - "lang": [ - "右键另存为图片" - ] + saveAsImage: { + title: '保存为图片', + lang: ['右键另存为图片'] } }, - "series": { - "typeNames": { - "pie": "饼图", - "bar": "柱状图", - "line": "折线图", - "scatter": "散点图", - "effectScatter": "涟漪散点图", - "radar": "雷达图", - "tree": "树图", - "treemap": "矩形树图", - "boxplot": "箱型图", - "candlestick": "K线图", - "k": "K线图", - "heatmap": "热力图", - "map": "地图", - "parallel": "平行坐标图", - "lines": "线图", - "graph": "关系图", - "sankey": "桑基图", - "funnel": "漏斗图", - "gauge": "仪表盘图", - "pictorialBar": "象形柱图", - "themeRiver": "主题河流图", - "sunburst": "旭日图" + series: { + typeNames: { + pie: '饼图', + bar: '柱状图', + line: '折线图', + scatter: '散点图', + effectScatter: '涟漪散点图', + radar: '雷达图', + tree: '树图', + treemap: '矩形树图', + boxplot: '箱型图', + candlestick: 'K线图', + k: 'K线图', + heatmap: '热力图', + map: '地图', + parallel: '平行坐标图', + lines: '线图', + graph: '关系图', + sankey: '桑基图', + funnel: '漏斗图', + gauge: '仪表盘图', + pictorialBar: '象形柱图', + themeRiver: '主题河流图', + sunburst: '旭日图' } }, - "aria": { - "general": { - "withTitle": "这是一个关于“{title}”的图表。", - "withoutTitle": "这是一个图表," + aria: { + general: { + withTitle: '这是一个关于“{title}”的图表。', + withoutTitle: '这是一个图表,' }, - "series": { - "single": { - "prefix": "", - "withName": "图表类型是{seriesType},表示{seriesName}。", - "withoutName": "图表类型是{seriesType}。" + series: { + single: { + prefix: '', + withName: '图表类型是{seriesType},表示{seriesName}。', + withoutName: '图表类型是{seriesType}。' }, - "multiple": { - "prefix": "它由{seriesCount}个图表系列组成。", - "withName": "第{seriesId}个系列是一个表示{seriesName}的{seriesType},", - "withoutName": "第{seriesId}个系列是一个{seriesType},", - "separator": { - "middle": ";", - "end": "。" + multiple: { + prefix: '它由{seriesCount}个图表系列组成。', + withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},', + withoutName: '第{seriesId}个系列是一个{seriesType},', + separator: { + middle: ';', + end: '。' } } }, - "data": { - "allData": "其数据是——", - "partialData": "其中,前{displayCnt}项是——", - "withName": "{name}的数据是{value}", - "withoutName": "{value}", - "separator": { - "middle": ",", - "end": "" + data: { + allData: '其数据是——', + partialData: '其中,前{displayCnt}项是——', + withName: '{name}的数据是{value}', + withoutName: '{value}', + separator: { + middle: ',', + end: '' } } } -} - - echarts.registerLocale('ZH', lang); +}; + echarts.registerLocale('ZH', localeObj); }); \ No newline at end of file diff --git a/src/component/toolbox/ToolboxModel.ts b/src/component/toolbox/ToolboxModel.ts index 6c71ec709d..10712e5ffb 100644 --- a/src/component/toolbox/ToolboxModel.ts +++ b/src/component/toolbox/ToolboxModel.ts @@ -31,7 +31,6 @@ import { CommonTooltipOption, Dictionary } from '../../util/types'; -import GlobalModel from "../../model/Global"; export interface ToolboxTooltipFormatterParams { @@ -91,8 +90,8 @@ class ToolboxModel extends ComponentModel { zrUtil.each(this.option.feature, function (featureOpt, featureName) { const Feature = featureManager.getFeature(featureName); - if(Feature.getDefaultOption) { - Feature.defaultOption = Feature.getDefaultOption(ecModel) + if (Feature.getDefaultOption) { + Feature.defaultOption = Feature.getDefaultOption(ecModel); } Feature && zrUtil.merge(featureOpt, Feature.defaultOption); }); diff --git a/src/component/toolbox/feature/Brush.ts b/src/component/toolbox/feature/Brush.ts index 815c6d3115..c935d69f4f 100644 --- a/src/component/toolbox/feature/Brush.ts +++ b/src/component/toolbox/feature/Brush.ts @@ -145,7 +145,7 @@ class BrushFeature extends ToolboxFeature { }, // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear` title: ecModel.getLocale(['toolbox', 'brush', 'title']) - } + }; return defaultOption; } diff --git a/src/locale.ts b/src/locale.ts index 7b0f5ec5ee..becfc45a49 100644 --- a/src/locale.ts +++ b/src/locale.ts @@ -29,7 +29,7 @@ export type LocaleOption = typeof langEN; const LOCALE_ZH = 'ZH'; const LOCALE_EN = 'EN'; -const DEFAULT_LOCALE = LOCALE_ZH; +const DEFAULT_LOCALE = LOCALE_EN; const localeStorage: Dictionary = {}; const localeModels: Dictionary = {}; diff --git a/src/model/Model.ts b/src/model/Model.ts index 8a0e0bf214..bfeac1c508 100644 --- a/src/model/Model.ts +++ b/src/model/Model.ts @@ -114,11 +114,6 @@ class Model { // TODO: TYPE use unkown ); } - getWithLocale(localePosition: Parameters['get']>[0]): any { - const locale = this.getLocale(); - return locale.get(localePosition); - } - getShallow( key: R, ignoreParent?: boolean ): Opt[R] { diff --git a/test/lang.html b/test/lang.html index c06c4749b9..e8f516928a 100644 --- a/test/lang.html +++ b/test/lang.html @@ -33,26 +33,56 @@ -
-
-
-
+
+
+
+
+
+
+
+ +