From 1557aef2e6300d361b2cbad97bc6be9bc8d5228e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=BDdila?= Date: Wed, 6 Nov 2024 12:49:21 +0100 Subject: [PATCH] GO-733 fixed Czech language geocoding flag --- CHANGELOG.md | 4 ++++ src/language.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd8d9af..4a2cb82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # MapTiler Client Changelog +## 2.0.1 +### Bug Fixes +- Fixed Czech language geocoding flag + ## 2.0.0 ### New Features - Added `matching_text` and `matching_place_name` properties to geocoding feature response diff --git a/src/language.ts b/src/language.ts index d5461db..21c8d9b 100644 --- a/src/language.ts +++ b/src/language.ts @@ -254,7 +254,7 @@ export const Language = { name: "Czech", latin: true, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -1021,7 +1021,7 @@ export const Language = { */ export function getLanguageInfoFromKey( languageKey: string, - languageDictionnary: { [k: string]: LanguageInfo } = Language, + languageDictionnary: { [k: string]: LanguageInfo } = Language ): LanguageInfo | null { if (languageKey in languageDictionnary) { return languageKey[languageKey]; @@ -1036,7 +1036,7 @@ export function getLanguageInfoFromKey( */ export function getLanguageInfoFromCode( languageCode: string, - languageDictionnary: { [k: string]: LanguageInfo } = Language, + languageDictionnary: { [k: string]: LanguageInfo } = Language ): LanguageInfo | null { for (const lang of Object.values(languageDictionnary)) { if (lang.code === languageCode) { @@ -1054,7 +1054,7 @@ export function getLanguageInfoFromCode( */ export function getLanguageInfoFromFlag( languageFlag: string, - languageDictionnary: { [k: string]: LanguageInfo } = Language, + languageDictionnary: { [k: string]: LanguageInfo } = Language ): LanguageInfo | null { for (const lang of Object.values(languageDictionnary)) { if (lang.flag === languageFlag) { @@ -1075,7 +1075,7 @@ export function getAutoLanguage(): LanguageInfo { } const canditatelangs = Array.from( - new Set(navigator.languages.map((l) => l.split("-")[0])), + new Set(navigator.languages.map((l) => l.split("-")[0])) ) .map((code) => getLanguageInfoFromCode(code)) .filter((li) => li); @@ -1107,7 +1107,7 @@ export function isLanguageInfo(obj: unknown): obj is LanguageInfo { */ export function toLanguageInfo( lang: LanguageInfo | string, - languageDictionnary: { [k: string]: LanguageInfo } = Language, + languageDictionnary: { [k: string]: LanguageInfo } = Language ): LanguageInfo | null { // Could be directly an object of type LanguageInfo if (isLanguageInfo(lang)) { @@ -1136,7 +1136,7 @@ export function toLanguageInfo( export function areSameLanguages( langA: string | LanguageInfo, langB: string | LanguageInfo, - languageDictionnary: { [k: string]: LanguageInfo } = Language, + languageDictionnary: { [k: string]: LanguageInfo } = Language ): boolean { const langAObj = toLanguageInfo(langA, languageDictionnary); const langBObj = toLanguageInfo(langB, languageDictionnary);