qwc2 2026.2.16 → 2026.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/LayerTree.js +1 -1
- package/plugins/Settings.js +6 -4
- package/utils/LocaleUtils.js +6 -1
package/package.json
CHANGED
package/plugins/LayerTree.js
CHANGED
|
@@ -966,7 +966,7 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
|
|
|
966
966
|
_defineProperty(_this, "getLayerStyles", function (layer) {
|
|
967
967
|
var _layer$sublayers;
|
|
968
968
|
return layer === null || layer === void 0 || (_layer$sublayers = layer.sublayers) === null || _layer$sublayers === void 0 ? void 0 : _layer$sublayers.reduce(function (styleList, sublayer) {
|
|
969
|
-
Object.assign(styleList, _this.getLayerStyles(sublayer
|
|
969
|
+
Object.assign(styleList, _this.getLayerStyles(sublayer));
|
|
970
970
|
return Object.assign(styleList, sublayer.styles);
|
|
971
971
|
}, {});
|
|
972
972
|
});
|
package/plugins/Settings.js
CHANGED
|
@@ -79,7 +79,9 @@ var Settings = /*#__PURE__*/function (_React$Component) {
|
|
|
79
79
|
}, /*#__PURE__*/React.createElement("tbody", null, _this.renderLanguageSelector(), _this.renderColorSchemeSelector(), _this.renderDefaultThemeSelector())));
|
|
80
80
|
});
|
|
81
81
|
_defineProperty(_this, "renderLanguageSelector", function () {
|
|
82
|
-
|
|
82
|
+
var _this$props$languages;
|
|
83
|
+
var languages = (_this$props$languages = _this.props.languages) !== null && _this$props$languages !== void 0 ? _this$props$languages : ConfigUtils.getConfigProp("availableLocales");
|
|
84
|
+
if (isEmpty(languages)) {
|
|
83
85
|
return null;
|
|
84
86
|
}
|
|
85
87
|
var lang = LocaleUtils.lang();
|
|
@@ -89,7 +91,7 @@ var Settings = /*#__PURE__*/function (_React$Component) {
|
|
|
89
91
|
}, /*#__PURE__*/React.createElement("option", {
|
|
90
92
|
key: "syslang",
|
|
91
93
|
value: ""
|
|
92
|
-
}, LocaleUtils.tr("settings.systemlang")),
|
|
94
|
+
}, LocaleUtils.tr("settings.systemlang")), languages.map(function (entry) {
|
|
93
95
|
var _entry$title;
|
|
94
96
|
return /*#__PURE__*/React.createElement("option", {
|
|
95
97
|
key: entry.value,
|
|
@@ -216,7 +218,7 @@ _defineProperty(Settings, "propTypes", {
|
|
|
216
218
|
value: PropTypes.string
|
|
217
219
|
})),
|
|
218
220
|
defaultUrlParams: PropTypes.string,
|
|
219
|
-
/** List of available languages. Value is the lang code, title/titleMsgId the display name. */
|
|
221
|
+
/** List of available languages. Value is the lang code, title/titleMsgId the display name. Falls back to the toplevel `availableLocales` `config.json` setting if not set. */
|
|
220
222
|
languages: PropTypes.arrayOf(PropTypes.shape({
|
|
221
223
|
title: PropTypes.string,
|
|
222
224
|
titleMsgId: PropTypes.string,
|
|
@@ -232,7 +234,7 @@ _defineProperty(Settings, "propTypes", {
|
|
|
232
234
|
});
|
|
233
235
|
_defineProperty(Settings, "defaultProps", {
|
|
234
236
|
colorSchemes: [],
|
|
235
|
-
languages:
|
|
237
|
+
languages: null,
|
|
236
238
|
side: 'right',
|
|
237
239
|
showDefaultThemeSelector: true
|
|
238
240
|
});
|
package/utils/LocaleUtils.js
CHANGED
|
@@ -15,7 +15,12 @@ var LocaleUtils = {
|
|
|
15
15
|
loadLocale: function loadLocale(lang, fallbackLangData) {
|
|
16
16
|
return new Promise(function (resolve) {
|
|
17
17
|
var loadLang = null;
|
|
18
|
-
var availableLanguages =
|
|
18
|
+
var availableLanguages = ConfigUtils.getConfigProp("availableLocales");
|
|
19
|
+
if (availableLanguages) {
|
|
20
|
+
availableLanguages = Object.keys(availableLanguages);
|
|
21
|
+
} else {
|
|
22
|
+
availableLanguages = process.env.AvailableLanguages;
|
|
23
|
+
}
|
|
19
24
|
if (availableLanguages.indexOf(lang) !== -1) {
|
|
20
25
|
// Exact match: lang-REGION
|
|
21
26
|
loadLang = lang;
|