forked from MapComplete/MapComplete
Fix: setting the language does not overwrite the user setting anymore
This commit is contained in:
parent
4606df7d2b
commit
c6283ac720
6 changed files with 22 additions and 16 deletions
|
@ -36,6 +36,7 @@ export default class UserRelatedState {
|
|||
public readonly showAllQuestionsAtOnce: UIEventSource<boolean>
|
||||
public readonly showTags: UIEventSource<"no" | undefined | "always" | "yes">;
|
||||
public readonly homeLocation: FeatureSource
|
||||
public readonly language: UIEventSource<string>
|
||||
/**
|
||||
* The number of seconds that the GPS-locations are stored in memory.
|
||||
* Time in seconds
|
||||
|
@ -83,6 +84,7 @@ export default class UserRelatedState {
|
|||
"Either 'true' or 'false'. If set, all questions will be shown all at once",
|
||||
})
|
||||
)
|
||||
this.language = this.osmConnection.GetPreference("language")
|
||||
this.showTags = <UIEventSource<any>>this.osmConnection.GetPreference("show_tags")
|
||||
|
||||
this.mangroveIdentity = new MangroveIdentity(
|
||||
|
@ -181,7 +183,7 @@ export default class UserRelatedState {
|
|||
}
|
||||
|
||||
private InitializeLanguage(availableLanguages?: string[]) {
|
||||
Locale.language.syncWith(this.osmConnection.GetPreference("language"))
|
||||
this.language.addCallbackAndRunD(language => Locale.language.setData(language))
|
||||
Locale.language.addCallback((currentLanguage) => {
|
||||
if (Locale.showLinkToWeblate.data) {
|
||||
return true // Disable auto switching as we are in translators mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue