Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return localization dictionaries back #28516

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import 'devextreme/localization/globalize/date';
import 'devextreme/localization/globalize/currency';
import 'devextreme/localization/globalize/message';

import deMessages from 'npm:devextreme/common/core/localization/messages/de.json!json';
import ruMessages from 'npm:devextreme/common/core/localization/messages/ru.json!json';
import deMessages from 'npm:devextreme/localization/messages/de.json!json';
import ruMessages from 'npm:devextreme/localization/messages/ru.json!json';

import deCldrData from 'npm:devextreme-cldr-data/de.json!json';
import ruCldrData from 'npm:devextreme-cldr-data/ru.json!json';
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingGlobalize/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import 'devextreme/localization/globalize/date';
import 'devextreme/localization/globalize/currency';
import 'devextreme/localization/globalize/message';

import deMessages from 'devextreme/common/core/localization/messages/de.json';
import ruMessages from 'devextreme/common/core/localization/messages/ru.json';
import deMessages from 'devextreme/localization/messages/de.json';
import ruMessages from 'devextreme/localization/messages/ru.json';

import deCldrData from 'devextreme-cldr-data/de.json';
import ruCldrData from 'devextreme-cldr-data/ru.json';
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingGlobalize/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'devextreme/localization/globalize/number';
import 'devextreme/localization/globalize/date';
import 'devextreme/localization/globalize/currency';
import 'devextreme/localization/globalize/message';
import deMessages from 'devextreme/common/core/localization/messages/de.json';
import ruMessages from 'devextreme/common/core/localization/messages/ru.json';
import deMessages from 'devextreme/localization/messages/de.json';
import ruMessages from 'devextreme/localization/messages/ru.json';
import deCldrData from 'devextreme-cldr-data/de.json';
import ruCldrData from 'devextreme-cldr-data/ru.json';
import supplementalCldrData from 'devextreme-cldr-data/supplemental.json';
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingGlobalize/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ import 'devextreme/localization/globalize/currency';
import 'devextreme/localization/globalize/message';
/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-webpack-loader-syntax */
import * as deMessages from 'npm:devextreme/common/core/localization/messages/de.json!json';
import * as ruMessages from 'npm:devextreme/common/core/localization/messages/ru.json!json';
import * as deMessages from 'npm:devextreme/localization/messages/de.json!json';
import * as ruMessages from 'npm:devextreme/localization/messages/ru.json!json';
import * as deCldrData from 'npm:devextreme-cldr-data/de.json!json';
import * as ruCldrData from 'npm:devextreme-cldr-data/ru.json!json';
import * as supplementalCldrData from 'npm:devextreme-cldr-data/supplemental.json!json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { DxSelectBoxModule, DxDataGridModule } from 'devextreme-angular';

import { locale, loadMessages, formatMessage } from 'devextreme/localization';

import deMessages from 'npm:devextreme/common/core/localization/messages/de.json!json';
import ruMessages from 'npm:devextreme/common/core/localization/messages/ru.json!json';
import deMessages from 'npm:devextreme/localization/messages/de.json!json';
import ruMessages from 'npm:devextreme/localization/messages/ru.json!json';
import { Locale, Payment, Service } from './app.service';

if (!/localhost/.test(document.location.host)) {
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingIntl/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import React, { useState } from 'react';
import DataGrid, { Column, Editing, FilterRow } from 'devextreme-react/data-grid';
import SelectBox, { SelectBoxTypes } from 'devextreme-react/select-box';

import deMessages from 'devextreme/common/core/localization/messages/de.json';
import ruMessages from 'devextreme/common/core/localization/messages/ru.json';
import deMessages from 'devextreme/localization/messages/de.json';
import ruMessages from 'devextreme/localization/messages/ru.json';
import { locale, loadMessages, formatMessage } from 'devextreme/localization';

import service from './data.ts';
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingIntl/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import React, { useState } from 'react';
import DataGrid, { Column, Editing, FilterRow } from 'devextreme-react/data-grid';
import SelectBox from 'devextreme-react/select-box';
import deMessages from 'devextreme/common/core/localization/messages/de.json';
import ruMessages from 'devextreme/common/core/localization/messages/ru.json';
import deMessages from 'devextreme/localization/messages/de.json';
import ruMessages from 'devextreme/localization/messages/ru.json';
import { locale, loadMessages, formatMessage } from 'devextreme/localization';
import service from './data.js';

Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingIntl/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ import {
import DxSelectBox, { DxSelectBoxTypes } from 'devextreme-vue/select-box';
/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-webpack-loader-syntax */
import * as deMessages from 'npm:devextreme/common/core/localization/messages/de.json!json';
import * as ruMessages from 'npm:devextreme/common/core/localization/messages/ru.json!json';
import * as deMessages from 'npm:devextreme/localization/messages/de.json!json';
import * as ruMessages from 'npm:devextreme/localization/messages/ru.json!json';
import { locale as dxLocale, loadMessages, formatMessage as dxFormatMessage } from 'devextreme/localization';
import service from './data.ts';

Expand Down
2 changes: 1 addition & 1 deletion apps/demos/configs/React/config.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const bundleConfig = {
},
map: {
'devextreme.react.systemjs.js': '../../../../bundles/devextreme.react.systemjs.js',
'devextreme/common/core/localization/messages': 'npm:devextreme/common/core/localization/messages',
'devextreme/localization/messages': 'npm:devextreme/localization/messages',
},
packages: {
'react': {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/configs/React/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ window.config = {
'devextreme/events/utils': {
main: 'index',
},
'devextreme/common/core/localization/messages': {
'devextreme/localization/messages': {
format: 'json',
defaultExtension: 'json',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/configs/ReactJs/config.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const bundleConfig = {
},
map: {
'devextreme.react.systemjs.js': '../../../../../bundles/devextreme.react.systemjs.js',
'devextreme/common/core/localization/messages': 'npm:devextreme/common/core/localization/messages',
'devextreme/localization/messages': 'npm:devextreme/localization/messages',
},
packages: {
'react': {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/configs/ReactJs/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ window.config = {
'devextreme/events/utils': {
main: 'index',
},
'devextreme/common/core/localization/messages': {
'devextreme/localization/messages': {
format: 'json',
defaultExtension: '',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/utils/bundle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const prepareConfigs = (framework)=> {
}];

additionPaths = {
'devextreme/common/core/localization/messages/*': 'node_modules/devextreme/common/core/localization/messages/*',
'devextreme/localization/messages/*': 'node_modules/devextreme/localization/messages/*',
};

packages = [
Expand Down
8 changes: 4 additions & 4 deletions packages/devextreme/build/gulp/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const accountingFormats = function() {
};

const RESULT_PATH = path.join(context.RESULT_JS_PATH, 'localization');
const DICTIONARY_SOURCE_FOLDER = 'js/common/core/localization/messages';
const DICTIONARY_SOURCE_FOLDER = 'js/localization/messages';

const getLocales = function(directory) {
return fs.readdirSync(directory).map(file => {
Expand Down Expand Up @@ -119,8 +119,8 @@ gulp.task('generate-community-locales', () => {

return gulp
.src([
'js/common/core/localization/messages/*.json',
'!js/common/core/localization/messages/en.json'
'js/localization/messages/*.json',
'!js/localization/messages/en.json'
])
.pipe(through.obj(function(file, encoding, callback) {
const parsedFile = JSON.parse(file.contents.toString(encoding));
Expand Down Expand Up @@ -169,7 +169,7 @@ gulp.task('localization-messages', gulp.parallel(getLocales(DICTIONARY_SOURCE_FO

gulp.task('localization-generated-sources', gulp.parallel([
{
data: require('../../js/common/core/localization/messages/en.json'),
data: require('../../js/localization/messages/en.json'),
filename: 'default_messages.js',
exportName: 'defaultMessages',
destination: 'js/common/core/localization'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { setHeight } from 'core/utils/size';
import $ from 'core/renderer';
import localization from 'localization';
import ja from 'common/core/localization/messages/ja.json!';
import ja from 'localization/messages/ja.json!';
import messageLocalization from 'common/core/localization/message';
import { getWindow, setWindow } from 'core/utils/window';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ const messageLocalization = require('common/core/localization/message');
const localization = require('localization');

const dictionaries = {};
dictionaries['ar'] = require('common/core/localization/messages/ar.json!');
dictionaries['ca'] = require('common/core/localization/messages/ca.json!');
dictionaries['cs'] = require('common/core/localization/messages/cs.json!');
dictionaries['de'] = require('common/core/localization/messages/de.json!');
dictionaries['el'] = require('common/core/localization/messages/el.json!');
dictionaries['en'] = require('common/core/localization/messages/en.json!');
dictionaries['es'] = require('common/core/localization/messages/es.json!');
dictionaries['fi'] = require('common/core/localization/messages/fi.json!');
dictionaries['fr'] = require('common/core/localization/messages/fr.json!');
dictionaries['hu'] = require('common/core/localization/messages/hu.json!');
dictionaries['it'] = require('common/core/localization/messages/it.json!');
dictionaries['ja'] = require('common/core/localization/messages/ja.json!');
dictionaries['lt'] = require('common/core/localization/messages/lt.json!');
dictionaries['lv'] = require('common/core/localization/messages/lv.json!');
dictionaries['nb'] = require('common/core/localization/messages/nb.json!');
dictionaries['nl'] = require('common/core/localization/messages/nl.json!');
dictionaries['pt'] = require('common/core/localization/messages/pt.json!');
dictionaries['ro'] = require('common/core/localization/messages/ro.json!');
dictionaries['ru'] = require('common/core/localization/messages/ru.json!');
dictionaries['sl'] = require('common/core/localization/messages/sl.json!');
dictionaries['sv'] = require('common/core/localization/messages/sv.json!');
dictionaries['tr'] = require('common/core/localization/messages/tr.json!');
dictionaries['vi'] = require('common/core/localization/messages/vi.json!');
dictionaries['zh-tw'] = require('common/core/localization/messages/zh-tw.json!');
dictionaries['zh'] = require('common/core/localization/messages/zh.json!');
dictionaries['fa'] = require('common/core/localization/messages/fa.json!');
dictionaries['ar'] = require('localization/messages/ar.json!');
dictionaries['ca'] = require('localization/messages/ca.json!');
dictionaries['cs'] = require('localization/messages/cs.json!');
dictionaries['de'] = require('localization/messages/de.json!');
dictionaries['el'] = require('localization/messages/el.json!');
dictionaries['en'] = require('localization/messages/en.json!');
dictionaries['es'] = require('localization/messages/es.json!');
dictionaries['fi'] = require('localization/messages/fi.json!');
dictionaries['fr'] = require('localization/messages/fr.json!');
dictionaries['hu'] = require('localization/messages/hu.json!');
dictionaries['it'] = require('localization/messages/it.json!');
dictionaries['ja'] = require('localization/messages/ja.json!');
dictionaries['lt'] = require('localization/messages/lt.json!');
dictionaries['lv'] = require('localization/messages/lv.json!');
dictionaries['nb'] = require('localization/messages/nb.json!');
dictionaries['nl'] = require('localization/messages/nl.json!');
dictionaries['pt'] = require('localization/messages/pt.json!');
dictionaries['ro'] = require('localization/messages/ro.json!');
dictionaries['ru'] = require('localization/messages/ru.json!');
dictionaries['sl'] = require('localization/messages/sl.json!');
dictionaries['sv'] = require('localization/messages/sv.json!');
dictionaries['tr'] = require('localization/messages/tr.json!');
dictionaries['vi'] = require('localization/messages/vi.json!');
dictionaries['zh-tw'] = require('localization/messages/zh-tw.json!');
dictionaries['zh'] = require('localization/messages/zh.json!');
dictionaries['fa'] = require('localization/messages/fa.json!');

const LOCALES = [
'ar', 'ca', 'cs', 'de', 'el',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const localization = require('localization');
const dictionaries = {};

dictionaries['zh-tw'] = require('common/core/localization/messages/zh-tw.json!');
dictionaries['zh-tw'] = require('localization/messages/zh-tw.json!');

QUnit.module('Locale messages of DevExtreme', {
}, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const cldrData = [
const ValidationEngine = require('ui/validation_engine');
const Globalize = require('globalize');
const localization = require('localization');
const fr = require('common/core/localization/messages/fr.json!');
const fr = require('localization/messages/fr.json!');

cldrData.forEach(localeCldrData => {
Globalize.load(localeCldrData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import keyboardMock from '../../helpers/keyboardMock.js';
import { getActiveElement } from '../../helpers/shadowDom.js';
import messageLocalization from 'common/core/localization/message';
import localization from 'localization';
import ja from 'common/core/localization/messages/ja.json!';
import ja from 'localization/messages/ja.json!';
import pointerMock from '../../helpers/pointerMock.js';
import support from '__internal/core/utils/m_support';
import typeUtils from 'core/utils/type';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import keyboardMock from '../../helpers/keyboardMock.js';
import pointerMock from '../../helpers/pointerMock.js';
import * as checkStyleHelper from '../../helpers/checkStyleHelper.js';
import localization from 'localization';
import ja from 'common/core/localization/messages/ja.json!';
import ja from 'localization/messages/ja.json!';
import { Deferred } from 'core/utils/deferred';
import dxButton from 'ui/button';
import { isRenderer } from 'core/utils/type';
Expand Down
Loading