-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
31 lines (26 loc) · 916 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const locales = ['en', 'de', 'ja', 'en-GB'];
const shorten = l => l.replace(/-.*$/, '');
// Setting locale depending on browser settings, taking into account
// available locales.
const requestedLocale = navigator.language || navigator.browserLanguage;
const setLocale =
locales.find(i => i === requestedLocale) ||
locales.find(i => i === shorten(requestedLocale)) ||
'en';
DevExpress.localization.locale(setLocale);
// Alternatively, set a specific locale:
// DevExpress.localization.locale('de');
// Now we can set up some widgets:
$('#button').dxButton({
width: '200px',
text: "Say 'Hello world'",
onClick: function() {
DevExpress.ui.dialog.alert('Hello world!', '', false);
}
});
// For date parsing when using Intl localization, please read
// https://github.com/DevExpress/DevExtreme-Intl#restrictions
$('#datebox').dxDateBox({
width: '200px',
placeholder: 'Please enter a date'
});