forked from MapComplete/MapComplete
I18N: include 'usersettings' in zenlinks
This commit is contained in:
parent
45380ab9c8
commit
4a6d79cb65
2 changed files with 6 additions and 5 deletions
|
@ -24,7 +24,7 @@ import { MapProperties } from "../../Models/MapProperties"
|
||||||
* which layers they enabled, ...
|
* which layers they enabled, ...
|
||||||
*/
|
*/
|
||||||
export default class UserRelatedState {
|
export default class UserRelatedState {
|
||||||
public static readonly usersettingsConfig = UserRelatedState.initUserRelatedState()
|
public static readonly usersettingsConfig = UserRelatedState.initUserSettingsState()
|
||||||
public static readonly availableUserSettingsIds: string[] =
|
public static readonly availableUserSettingsIds: string[] =
|
||||||
UserRelatedState.usersettingsConfig?.tagRenderings?.map((tr) => tr.id) ?? []
|
UserRelatedState.usersettingsConfig?.tagRenderings?.map((tr) => tr.id) ?? []
|
||||||
public static readonly SHOW_TAGS_VALUES = ["always", "yes", "full"] as const
|
public static readonly SHOW_TAGS_VALUES = ["always", "yes", "full"] as const
|
||||||
|
@ -141,7 +141,7 @@ export default class UserRelatedState {
|
||||||
this.language.syncWith(Locale.language)
|
this.language.syncWith(Locale.language)
|
||||||
}
|
}
|
||||||
|
|
||||||
private static initUserRelatedState(): LayerConfig {
|
private static initUserSettingsState(): LayerConfig {
|
||||||
try {
|
try {
|
||||||
return new LayerConfig(<LayerConfigJson>usersettings, "userinformationpanel")
|
return new LayerConfig(<LayerConfigJson>usersettings, "userinformationpanel")
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -319,7 +319,8 @@ export default class UserRelatedState {
|
||||||
amendedPrefs.data["_language"] = language
|
amendedPrefs.data["_language"] = language
|
||||||
const trmode = translationMode.data
|
const trmode = translationMode.data
|
||||||
if ((trmode === "true" || trmode === "mobile") && layout !== undefined) {
|
if ((trmode === "true" || trmode === "mobile") && layout !== undefined) {
|
||||||
const missing = layout.missingTranslations()
|
const extraInspection = UserRelatedState.usersettingsConfig
|
||||||
|
const missing = layout.missingTranslations(extraInspection)
|
||||||
const total = missing.total
|
const total = missing.total
|
||||||
|
|
||||||
const untranslated = missing.untranslated.get(language) ?? []
|
const untranslated = missing.untranslated.get(language) ?? []
|
||||||
|
|
|
@ -245,7 +245,7 @@ export default class LayoutConfig implements LayoutInformation {
|
||||||
return this.layers.some((l) => l.isLeftRightSensitive())
|
return this.layers.some((l) => l.isLeftRightSensitive())
|
||||||
}
|
}
|
||||||
|
|
||||||
public missingTranslations(): {
|
public missingTranslations(extraInspection: any): {
|
||||||
untranslated: Map<string, string[]>
|
untranslated: Map<string, string[]>
|
||||||
total: number
|
total: number
|
||||||
} {
|
} {
|
||||||
|
@ -254,7 +254,7 @@ export default class LayoutConfig implements LayoutInformation {
|
||||||
const untranslated = new Map<string, string[]>()
|
const untranslated = new Map<string, string[]>()
|
||||||
|
|
||||||
Utils.WalkObject(
|
Utils.WalkObject(
|
||||||
layout,
|
[layout, extraInspection],
|
||||||
(o) => {
|
(o) => {
|
||||||
const translation = <Translation>(<any>o)
|
const translation = <Translation>(<any>o)
|
||||||
if (translation.translations["*"] !== undefined) {
|
if (translation.translations["*"] !== undefined) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue