From 1127a63b08f5efdd8aae79191f06d1b49078d10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=BDdila?= Date: Mon, 25 Nov 2024 13:32:58 +0100 Subject: [PATCH 1/3] GO-810 flagged more languages for geocoding --- CHANGELOG.md | 3 ++- src/language.ts | 40 ++++++++++++++++++++-------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4af85d6..8478ae0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ ### Others - fixing typos - languages are now ordered alphabetically - +### Bug Fixes +- Fixed incorrect `geocoding: false` for some more languages ## 2.1.0 ### New Features diff --git a/src/language.ts b/src/language.ts index 422b4ae..83dba88 100644 --- a/src/language.ts +++ b/src/language.ts @@ -115,7 +115,7 @@ export const ISOLanguage = { name: "Amharic", latin: false, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -163,7 +163,7 @@ export const ISOLanguage = { name: "Basque", latin: true, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -187,7 +187,7 @@ export const ISOLanguage = { name: "Bengali", latin: true, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -283,7 +283,7 @@ export const ISOLanguage = { name: "Corsican", latin: true, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -463,7 +463,7 @@ export const ISOLanguage = { name: "Hindi", latin: false, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -499,7 +499,7 @@ export const ISOLanguage = { name: "Indonesian", latin: true, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -643,7 +643,7 @@ export const ISOLanguage = { name: "Kurdish", latin: true, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -715,7 +715,7 @@ export const ISOLanguage = { name: "Malayalam", latin: false, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -751,7 +751,7 @@ export const ISOLanguage = { name: "Occitan", latin: true, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -763,7 +763,7 @@ export const ISOLanguage = { name: "Persian", latin: false, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -799,7 +799,7 @@ export const ISOLanguage = { name: "Punjabi", latin: false, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -943,7 +943,7 @@ export const ISOLanguage = { name: "Tamil", latin: false, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -955,7 +955,7 @@ export const ISOLanguage = { name: "Telugu", latin: false, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -1003,7 +1003,7 @@ export const ISOLanguage = { name: "Vietnamese (Latin script)", latin: true, isMode: false, - geocoding: false, + geocoding: true, } as LanguageInfo, /** @@ -1034,7 +1034,7 @@ export const Language = { */ export function getLanguageInfoFromKey( languageKey: string, - languageDictionary: { [k: string]: LanguageInfo } = Language, + languageDictionary: { [k: string]: LanguageInfo } = Language ): LanguageInfo | null { if (languageKey in languageDictionary) { return languageKey[languageKey]; @@ -1049,7 +1049,7 @@ export function getLanguageInfoFromKey( */ export function getLanguageInfoFromCode( languageCode: string, - languageDictionary: { [k: string]: LanguageInfo } = Language, + languageDictionary: { [k: string]: LanguageInfo } = Language ): LanguageInfo | null { for (const lang of Object.values(languageDictionary)) { if (lang.code === languageCode) { @@ -1067,7 +1067,7 @@ export function getLanguageInfoFromCode( */ export function getLanguageInfoFromFlag( languageFlag: string, - languageDictionary: { [k: string]: LanguageInfo } = Language, + languageDictionary: { [k: string]: LanguageInfo } = Language ): LanguageInfo | null { for (const lang of Object.values(languageDictionary)) { if (lang.flag === languageFlag) { @@ -1088,7 +1088,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); @@ -1120,7 +1120,7 @@ export function isLanguageInfo(obj: unknown): obj is LanguageInfo { */ export function toLanguageInfo( lang: LanguageInfo | string, - languageDictionary: { [k: string]: LanguageInfo } = Language, + languageDictionary: { [k: string]: LanguageInfo } = Language ): LanguageInfo | null { // Could be directly an object of type LanguageInfo if (isLanguageInfo(lang)) { @@ -1149,7 +1149,7 @@ export function toLanguageInfo( export function areSameLanguages( langA: string | LanguageInfo, langB: string | LanguageInfo, - languageDictionary: { [k: string]: LanguageInfo } = Language, + languageDictionary: { [k: string]: LanguageInfo } = Language ): boolean { const langAObj = toLanguageInfo(langA, languageDictionary); const langBObj = toLanguageInfo(langB, languageDictionary); From ee09ed5840f83609e2fb38d78667935dc530219a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=BDdila?= Date: Mon, 25 Nov 2024 13:35:34 +0100 Subject: [PATCH 2/3] reverted auto-formatting --- src/language.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/language.ts b/src/language.ts index 83dba88..14c7fa2 100644 --- a/src/language.ts +++ b/src/language.ts @@ -1034,7 +1034,7 @@ export const Language = { */ export function getLanguageInfoFromKey( languageKey: string, - languageDictionary: { [k: string]: LanguageInfo } = Language + languageDictionary: { [k: string]: LanguageInfo } = Language, ): LanguageInfo | null { if (languageKey in languageDictionary) { return languageKey[languageKey]; @@ -1049,7 +1049,7 @@ export function getLanguageInfoFromKey( */ export function getLanguageInfoFromCode( languageCode: string, - languageDictionary: { [k: string]: LanguageInfo } = Language + languageDictionary: { [k: string]: LanguageInfo } = Language, ): LanguageInfo | null { for (const lang of Object.values(languageDictionary)) { if (lang.code === languageCode) { @@ -1067,7 +1067,7 @@ export function getLanguageInfoFromCode( */ export function getLanguageInfoFromFlag( languageFlag: string, - languageDictionary: { [k: string]: LanguageInfo } = Language + languageDictionary: { [k: string]: LanguageInfo } = Language, ): LanguageInfo | null { for (const lang of Object.values(languageDictionary)) { if (lang.flag === languageFlag) { @@ -1088,7 +1088,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); @@ -1120,7 +1120,7 @@ export function isLanguageInfo(obj: unknown): obj is LanguageInfo { */ export function toLanguageInfo( lang: LanguageInfo | string, - languageDictionary: { [k: string]: LanguageInfo } = Language + languageDictionary: { [k: string]: LanguageInfo } = Language, ): LanguageInfo | null { // Could be directly an object of type LanguageInfo if (isLanguageInfo(lang)) { @@ -1149,7 +1149,7 @@ export function toLanguageInfo( export function areSameLanguages( langA: string | LanguageInfo, langB: string | LanguageInfo, - languageDictionary: { [k: string]: LanguageInfo } = Language + languageDictionary: { [k: string]: LanguageInfo } = Language, ): boolean { const langAObj = toLanguageInfo(langA, languageDictionary); const langBObj = toLanguageInfo(langB, languageDictionary); From d8b8d8f7feeeb3169d68a6776de2eec854f813a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=BDdila?= Date: Fri, 6 Dec 2024 10:05:09 +0100 Subject: [PATCH 3/3] GO-810 bumped patch version --- CHANGELOG.md | 6 ++++-- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8478ae0..b101315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,15 @@ # MapTiler Client Changelog +## 2.2.1 +### Bug Fixes +- Fixed incorrect `geocoding: false` for some more languages + ## 2.2.0 ### New Features - Exposing ISO languages and non-ISO language separately ### Others - fixing typos - languages are now ordered alphabetically -### Bug Fixes -- Fixed incorrect `geocoding: false` for some more languages ## 2.1.0 ### New Features diff --git a/package-lock.json b/package-lock.json index 9610fc5..0eb4eb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@maptiler/client", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@maptiler/client", - "version": "2.2.0", + "version": "2.2.1", "license": "BSD-3-Clause", "dependencies": { "quick-lru": "^7.0.0" diff --git a/package.json b/package.json index 03476a3..b584294 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@maptiler/client", - "version": "2.2.0", + "version": "2.2.1", "description": "Javascript & Typescript wrapper to MapTiler Cloud API", "module": "dist/maptiler-client.mjs", "types": "dist/maptiler-client.d.ts",