diff --git a/@types/i18next.d.ts b/@types/i18next.d.ts new file mode 100644 index 000000000..0e51e06e6 --- /dev/null +++ b/@types/i18next.d.ts @@ -0,0 +1,84 @@ +import 'i18next' + +// // // core/plugins // // // + +import { resourcesDe as resourcesDeCore } from '@polar/core/src/locales' +import { resourcesDe as resourcesDeAddressSearch } from '@polar/plugin-address-search/src/locales' +import { resourcesDe as resourcesDeAttributions } from '@polar/plugin-attributions/src/locales' +import { resourcesDe as resourcesDeDraw } from '@polar/plugin-draw/src/locales' +import { resourcesDe as resourcesDeExport } from '@polar/plugin-export/src/locales' +import { resourcesDe as resourcesDeFilter } from '@polar/plugin-filter/src/locales' +import { resourcesDe as resourcesDeFullscreen } from '@polar/plugin-fullscreen/src/locales' +import { resourcesDe as resourcesDeGeoLocation } from '@polar/plugin-geo-location/src/locales' +import { resourcesDe as resourcesDeGfi } from '@polar/plugin-gfi/src/locales' +import { resourcesDe as resourcesDeIconMenu } from '@polar/plugin-icon-menu/src/locales' +import { resourcesDe as resourcesDeLayerChooser } from '@polar/plugin-layer-chooser/src/locales' +import { resourcesDe as resourcesDeLegend } from '@polar/plugin-legend/src/locales' +import { resourcesDe as resourcesDeLoadingIndicator } from '@polar/plugin-loading-indicator/src/locales' +import { resourcesDe as resourcesDePins } from '@polar/plugin-pins/src/locales' +import { resourcesDe as resourcesDeScale } from '@polar/plugin-scale/src/locales' +import { resourcesDe as resourcesDeToast } from '@polar/plugin-toast/src/locales' +import { resourcesDe as resourcesDeZoom } from '@polar/plugin-zoom/src/locales' + +// // // clients // // // + +import { dishDe } from '@polar/client-dish/src/locales' +import { dishHeaderDe } from '@polar/client-dish/src/plugins/Header/locales' +import { dishModalDe } from '@polar/client-dish/src/plugins/Modal/locales' +import { meldemichelDe } from '@polar/client-meldemichel/src/locales' +import { meldemichelDe as meldemichelAfmButtonDe } from '@polar/client-meldemichel/src/plugins/AfmButton/locales' +import { snowboxDe } from '@polar/client-snowbox/src/locales' +import { textLocatorDe } from '@polar/client-text-locator/src/locales' +import { textLocatorDe as textLocatorHeaderDe } from '@polar/client-text-locator/src/plugins/Header/locales' +import { geometrySearchDe } from '@polar/client-text-locator/src/plugins/GeometrySearch/locales' + +// // // resources // // // + +const resources = { + common: { + ...resourcesDeCore, + dish: dishDe, + meldemichel: meldemichelDe, + snowbox: snowboxDe, + textLocator: textLocatorDe, + plugins: { + addressSearch: resourcesDeAddressSearch.plugins.addressSearch, + attributions: resourcesDeAttributions.plugins.attributions, + dish: { + ...dishHeaderDe, + ...dishModalDe + }, + draw: resourcesDeDraw.plugins.draw, + export: resourcesDeExport.plugins.export, + filter: resourcesDeFilter.plugins.filter, + fullscreen: resourcesDeFullscreen.plugins.fullscreen, + geoLocation: resourcesDeGeoLocation.plugins.geoLocation, + // geometrySearch is from textLocator + geometrySearch: { + ...geometrySearchDe + }, + gfi: resourcesDeGfi.plugins.gfi, + iconMenu: resourcesDeIconMenu.plugins.iconMenu, + layerChooser: resourcesDeLayerChooser.plugins.layerChooser, + legend: resourcesDeLegend.plugins.legend, + loadingIndicator: resourcesDeLoadingIndicator.plugins.loadingIndicator, + meldemichel: { + ...meldemichelAfmButtonDe + }, + pins: resourcesDePins.plugins.pins, + scale: resourcesDeScale.plugins.scale, + textLocator: { + ...textLocatorHeaderDe + }, + toast: resourcesDeToast.plugins.toast, + zoom: resourcesDeZoom.plugins.zoom, + } + } +} as const + +declare module 'i18next' { + interface CustomTypeOptions { + defaultNS: "common" + resources: typeof resources + } +} diff --git a/packages/clients/afm/tsconfig.json b/packages/clients/afm/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/clients/afm/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/clients/dish/CHANGELOG.md b/packages/clients/dish/CHANGELOG.md index 48aee808e..3591b9c9c 100644 --- a/packages/clients/dish/CHANGELOG.md +++ b/packages/clients/dish/CHANGELOG.md @@ -6,6 +6,7 @@ - Fix: Extend typing for search result function according to type package update. - Fix: Import types `AddressSearchState` and `AddressSearchGetters` from correct position. - Fix: Import enum `SearchResultSymbols` from correct position. +- Fix: The alt text to the "Landesdachmarke" for screen readers was missing. - Chore: Change value of `pins.movable` configuration to `'drag'` as using a boolean has been deprecated in a future release. - Chore: Upgrade `@masterportal/masterportalapi` from `2.8.0` to `2.45.0` and subsequently `ol` from `^7.1.0` to `^10.3.1`. - Chore: Update `@polar`-dependencies to the latest versions. diff --git a/packages/clients/dish/src/language.ts b/packages/clients/dish/src/language.ts deleted file mode 100644 index f1372b375..000000000 --- a/packages/clients/dish/src/language.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { LanguageOption } from '@polar/lib-custom-types' - -const language: LanguageOption[] = [ - { - type: 'de', - resources: { - dish: { - backendSizeError: - 'Die Suche ist zu allgemein. Bitte wählen Sie weitere Suchbegriffe oder schränken Sie die Suche über einen Filter ein.', - unknownError: 'Ein unbekannter Fehler ist aufgetreten.', - idNotFound: - 'Die verlinkte ID konnte leider nicht aufgelöst werden. Bitte verwenden Sie Suche und Karte, um zum Denkmal zu navigieren.', - addressSearchHint: 'Eingabe von z.B. Bezeichnung, Lage, Adresse, ...', - }, - plugins: { - gfi: { - property: { - export: 'Export Detailinformationen', - }, - toggle: 'Informationen zu Sachgesamtheit öffnen/schließen', - }, - }, - }, - }, - { - type: 'en', - resources: { - dish: { - backendSizeError: - 'Too broad search. Please choose additional search terms or use a filter.', - unknownError: 'An unknown error occurred.', - idNotFound: - 'The linked ID could not be found. Please use the search function or map to navigate to your point of interest.', - addressSearchHint: - 'Entry of e.g. monument names, location, address, ...', - }, - plugins: { - gfi: { - property: { - export: 'Detail information export', - }, - toggle: 'Open/close additional information', - }, - }, - }, - }, -] - -export default language diff --git a/packages/clients/dish/src/locales.ts b/packages/clients/dish/src/locales.ts new file mode 100644 index 000000000..48d4e4211 --- /dev/null +++ b/packages/clients/dish/src/locales.ts @@ -0,0 +1,54 @@ +import { Locale } from '@polar/lib-custom-types' + +export const dishDe = { + backendSizeError: + 'Die Suche ist zu allgemein. Bitte wählen Sie weitere Suchbegriffe oder schränken Sie die Suche über einen Filter ein.', + unknownError: 'Ein unbekannter Fehler ist aufgetreten.', + idNotFound: + 'Die verlinkte ID konnte leider nicht aufgelöst werden. Bitte verwenden Sie Suche und Karte, um zum Denkmal zu navigieren.', + addressSearchHint: 'Eingabe von z.B. Bezeichnung, Lage, Adresse, ...', +} as const + +export const resourcesDe = { + dish: dishDe, + plugins: { + gfi: { + property: { + export: 'Export Detailinformationen', + }, + toggle: 'Informationen zu Sachgesamtheit öffnen/schließen', + }, + }, +} as const + +export const resourcesEn = { + dish: { + backendSizeError: + 'Too broad search. Please choose additional search terms or use a filter.', + unknownError: 'An unknown error occurred.', + idNotFound: + 'The linked ID could not be found. Please use the search function or map to navigate to your point of interest.', + addressSearchHint: 'Entry of e.g. monument names, location, address, ...', + }, + plugins: { + gfi: { + property: { + export: 'Detail information export', + }, + toggle: 'Open/close additional information', + }, + }, +} as const + +const locales: Locale[] = [ + { + type: 'de', + resources: resourcesDe, + }, + { + type: 'en', + resources: resourcesEn, + }, +] + +export default locales diff --git a/packages/clients/dish/src/mapConfig.ts b/packages/clients/dish/src/mapConfig.ts index dd29dd3b0..2840e4d4f 100644 --- a/packages/clients/dish/src/mapConfig.ts +++ b/packages/clients/dish/src/mapConfig.ts @@ -7,7 +7,7 @@ import { dishBaseUrl, // servicePrefix, s.u. } from './services' -import locales from './language' +import locales from './locales' const shBlue = '#003064' const shWhite = '#FFFFFF' @@ -171,7 +171,7 @@ export const mapConfiguration = { groupProperties: { groupDenkmalsuche: { label: 'Denkmalsuche', - hint: 'common:dish.addressSearchHint', + hint: 'dish.addressSearchHint', resultDisplayMode: 'categorized', limitResults: 3, }, diff --git a/packages/clients/dish/src/plugins/Gfi/ActionButton.vue b/packages/clients/dish/src/plugins/Gfi/ActionButton.vue index b5aacb833..1eed4c6b3 100644 --- a/packages/clients/dish/src/plugins/Gfi/ActionButton.vue +++ b/packages/clients/dish/src/plugins/Gfi/ActionButton.vue @@ -5,13 +5,13 @@ text :href="exportProperty" target="_blank" - :alt="$t('common:plugins.gfi.property.imageAlt')" - :title="$t('common:plugins.gfi.property.linkTitle')" - :aria-label="$t('common:plugins.gfi.property.export')" + :alt="$t('plugins.gfi.property.imageAlt')" + :title="$t('plugins.gfi.property.linkTitle')" + :aria-label="$t('plugins.gfi.property.export')" onmousedown="return false" > fa-download - {{ $t('common:plugins.gfi.property.export') }} + {{ $t('plugins.gfi.property.export') }} diff --git a/packages/clients/dish/src/plugins/Gfi/Content.vue b/packages/clients/dish/src/plugins/Gfi/Content.vue index 0c3831ec4..f54bf8ac5 100644 --- a/packages/clients/dish/src/plugins/Gfi/Content.vue +++ b/packages/clients/dish/src/plugins/Gfi/Content.vue @@ -6,7 +6,7 @@ fa-xmark @@ -49,7 +49,7 @@ diff --git a/packages/clients/dish/src/plugins/Header/Header.vue b/packages/clients/dish/src/plugins/Header/Header.vue index 36def29be..f17172e9c 100644 --- a/packages/clients/dish/src/plugins/Header/Header.vue +++ b/packages/clients/dish/src/plugins/Header/Header.vue @@ -1,6 +1,6 @@ diff --git a/packages/clients/dish/src/plugins/Header/index.ts b/packages/clients/dish/src/plugins/Header/index.ts index 142182c3d..3b5f0ead8 100644 --- a/packages/clients/dish/src/plugins/Header/index.ts +++ b/packages/clients/dish/src/plugins/Header/index.ts @@ -1,12 +1,12 @@ import Vue from 'vue' import { PluginOptions } from '@polar/lib-custom-types' import Header from './Header.vue' -import language from './language' +import locales from './locales' export default (options: PluginOptions) => (instance: Vue) => instance.$store.dispatch('addComponent', { name: 'header', plugin: Header, - language, + locales, options, }) diff --git a/packages/clients/dish/src/plugins/Header/language.ts b/packages/clients/dish/src/plugins/Header/language.ts deleted file mode 100644 index 05ac65753..000000000 --- a/packages/clients/dish/src/plugins/Header/language.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { LanguageOption } from '@polar/lib-custom-types' - -const lang: LanguageOption[] = [ - { - type: 'de', - resources: { - plugins: { - dish: { - header: { - text: 'Denkmalkarte Schleswig-Holstein', - }, - }, - }, - }, - }, - { - type: 'en', - resources: { - plugins: { - dish: { - header: {}, - }, - }, - }, - }, -] - -export default lang diff --git a/packages/clients/dish/src/plugins/Header/locales.ts b/packages/clients/dish/src/plugins/Header/locales.ts new file mode 100644 index 000000000..94e77d57a --- /dev/null +++ b/packages/clients/dish/src/plugins/Header/locales.ts @@ -0,0 +1,32 @@ +import { Locale } from '@polar/lib-custom-types' + +export const dishHeaderDe = { + header: { + text: 'Denkmalkarte Schleswig-Holstein', + }, +} as const + +const locales: Locale[] = [ + { + type: 'de', + resources: { + plugins: { + dish: { + ...dishHeaderDe, + }, + }, + }, + }, + { + type: 'en', + resources: { + plugins: { + dish: { + header: {}, + }, + }, + }, + }, +] + +export default locales diff --git a/packages/clients/dish/src/plugins/Modal/Welcome.vue b/packages/clients/dish/src/plugins/Modal/Welcome.vue index aac34a406..34372b608 100644 --- a/packages/clients/dish/src/plugins/Modal/Welcome.vue +++ b/packages/clients/dish/src/plugins/Modal/Welcome.vue @@ -3,44 +3,44 @@ - {{ $t('common:plugins.dish.modal.welcome.header') }} + {{ $t('plugins.dish.modal.welcome.header') }} - {{ $t('common:plugins.dish.modal.welcome.p1') }} + {{ $t('plugins.dish.modal.welcome.p1') }} - {{ $t('common:plugins.dish.modal.welcome.p2') }} + {{ $t('plugins.dish.modal.welcome.p2') }} - {{ $t('common:plugins.dish.modal.welcome.p3') }} + {{ $t('plugins.dish.modal.welcome.p3') }} fa-chevron-right - {{ $t('common:plugins.dish.modal.welcome.link1') }}. + {{ $t('plugins.dish.modal.welcome.link1') }}. - {{ $t('common:plugins.dish.modal.welcome.p4') }} + {{ $t('plugins.dish.modal.welcome.p4') }} fa-chevron-right - {{ $t('common:plugins.dish.modal.welcome.link2') }}. + {{ $t('plugins.dish.modal.welcome.link2') }}. - {{ $t('common:plugins.dish.modal.welcome.closeInfo') }} + {{ $t('plugins.dish.modal.welcome.closeInfo') }} diff --git a/packages/clients/dish/src/plugins/Modal/index.ts b/packages/clients/dish/src/plugins/Modal/index.ts index 34a38b6d7..7c910d5c4 100644 --- a/packages/clients/dish/src/plugins/Modal/index.ts +++ b/packages/clients/dish/src/plugins/Modal/index.ts @@ -1,14 +1,14 @@ import Vue from 'vue' import { PluginOptions } from '@polar/lib-custom-types' import Modal from './Modal.vue' -import language from './language' +import locales from './locales' import storeModule from './store' export default (options: PluginOptions) => (instance: Vue) => instance.$store.dispatch('addComponent', { name: 'modal', plugin: Modal, - language, + locales, storeModule, options, }) diff --git a/packages/clients/dish/src/plugins/Modal/language.ts b/packages/clients/dish/src/plugins/Modal/language.ts deleted file mode 100644 index cd4bd1fb7..000000000 --- a/packages/clients/dish/src/plugins/Modal/language.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { LanguageOption } from '@polar/lib-custom-types' - -const lang: LanguageOption[] = [ - { - type: 'de', - resources: { - plugins: { - dish: { - modal: { - welcome: { - header: 'Willkommen in der Denkmalkarte Schleswig-Holstein', - landesdachmarkeAlt: - 'Logo der Landesdachmarke "Schleswig-Holstein. Der echte Norden."', - p1: 'Kulturdenkmale sind gesetzlich geschützt, und nachrichtlich in ein Verzeichnis, die sogenannte Denkmalliste, aufzunehmen. Die Denkmaleigenschaft ist nicht von der Eintragung in die Denkmalliste, oder von der Darstellung in der Denkmalkarte abhängig. Auch Objekte, die nicht hier verzeichnet sind, können als Kulturdenkmale kraft Gesetz (Ipsa Lege) geschützt sein, wenn sie die gesetzlichen Kriterien für die Denkmaleigenschaft erfüllen.', - p2: 'In der Denkmalkarte werden Kulturdenkmale in der Zuständigkeit des Landesamtes für Denkmalpflege Schleswig-Holstein (Baudenkmale, Gründenkmale, Schutzzonen vom Typ Denkmalbereich) dargestellt, mit Ausnahme der Hansestadt Lübeck.', - p3: 'Die Darstellungen in der Denkmalkarte haben informatorischen Charakter. Sie sind nicht rechtsverbindlich. Für tagesaktuelle, rechtsverbindliche Auskünfte wenden Sie sich bitte an:', - link1: 'Landesamt für Denkmalpflege Schleswig-Holstein', - link2: 'Planungs- und Genehmigungsverfahren', - p4: 'Die Nutzung der Denkmalkarte ersetzt nicht die förmliche Beteiligung der jeweils zuständigen Denkmalbehörde in', - confirmRead: - 'Hiermit bestätige ich, dass ich die Informationen zur Kenntnis genommen habe.', - closeInfo: "Los geht's!", - }, - hints: { - /* NOTE - * There's lots of special formatting and links in that - * text block, and no multilingual support in sight. - * For that reason, this part is currently maintained - * in the Hints.vue file, until the need arises. - */ - }, - }, - }, - }, - }, - }, - { - type: 'en', - resources: { - plugins: { - dish: { - modal: {}, - }, - }, - }, - }, -] - -export default lang diff --git a/packages/clients/dish/src/plugins/Modal/locales.ts b/packages/clients/dish/src/plugins/Modal/locales.ts new file mode 100644 index 000000000..b6691ac2e --- /dev/null +++ b/packages/clients/dish/src/plugins/Modal/locales.ts @@ -0,0 +1,53 @@ +import { Locale } from '@polar/lib-custom-types' + +export const dishModalDe = { + modal: { + welcome: { + header: 'Willkommen in der Denkmalkarte Schleswig-Holstein', + landesdachmarkeAlt: + 'Logo der Landesdachmarke "Schleswig-Holstein. Der echte Norden."', + p1: 'Kulturdenkmale sind gesetzlich geschützt, und nachrichtlich in ein Verzeichnis, die sogenannte Denkmalliste, aufzunehmen. Die Denkmaleigenschaft ist nicht von der Eintragung in die Denkmalliste, oder von der Darstellung in der Denkmalkarte abhängig. Auch Objekte, die nicht hier verzeichnet sind, können als Kulturdenkmale kraft Gesetz (Ipsa Lege) geschützt sein, wenn sie die gesetzlichen Kriterien für die Denkmaleigenschaft erfüllen.', + p2: 'In der Denkmalkarte werden Kulturdenkmale in der Zuständigkeit des Landesamtes für Denkmalpflege Schleswig-Holstein (Baudenkmale, Gründenkmale, Schutzzonen vom Typ Denkmalbereich) dargestellt, mit Ausnahme der Hansestadt Lübeck.', + p3: 'Die Darstellungen in der Denkmalkarte haben informatorischen Charakter. Sie sind nicht rechtsverbindlich. Für tagesaktuelle, rechtsverbindliche Auskünfte wenden Sie sich bitte an:', + link1: 'Landesamt für Denkmalpflege Schleswig-Holstein', + link2: 'Planungs- und Genehmigungsverfahren', + p4: 'Die Nutzung der Denkmalkarte ersetzt nicht die förmliche Beteiligung der jeweils zuständigen Denkmalbehörde in', + confirmRead: + 'Hiermit bestätige ich, dass ich die Informationen zur Kenntnis genommen habe.', + closeInfo: "Los geht's!", + }, + hints: { + /* NOTE + * There's lots of special formatting and links in that + * text block, and no multilingual support in sight. + * For that reason, this part is currently maintained + * in the Hints.vue file, until the need arises. + */ + }, + }, +} as const + +const locales: Locale[] = [ + { + type: 'de', + resources: { + plugins: { + dish: { + ...dishModalDe, + }, + }, + }, + }, + { + type: 'en', + resources: { + plugins: { + dish: { + modal: {}, + }, + }, + }, + }, +] + +export default locales diff --git a/packages/clients/dish/src/utils/navigateToDenkmal.ts b/packages/clients/dish/src/utils/navigateToDenkmal.ts index dd98581b7..515032c93 100644 --- a/packages/clients/dish/src/utils/navigateToDenkmal.ts +++ b/packages/clients/dish/src/utils/navigateToDenkmal.ts @@ -44,7 +44,7 @@ export function navigateToDenkmal(instance, objektId: string) { console.error('@polar/client-dish', error) instance.$store.dispatch('plugin/toast/addToast', { type: 'warning', - text: 'common:dish.idNotFound', + text: 'dish.idNotFound', }) }) } diff --git a/packages/clients/dish/src/utils/search.ts b/packages/clients/dish/src/utils/search.ts index c7329f608..20acadf6e 100644 --- a/packages/clients/dish/src/utils/search.ts +++ b/packages/clients/dish/src/utils/search.ts @@ -162,12 +162,12 @@ export function search( if (error.message === dishBackendSizeError) { this.dispatch('plugin/toast/addToast', { type: 'warning', - text: 'common:dish.backendSizeError', + text: 'dish.backendSizeError', }) } else { this.dispatch('plugin/toast/addToast', { type: 'error', - text: 'common:dish.unknownError', + text: 'dish.unknownError', }) } } diff --git a/packages/clients/dish/tsconfig.json b/packages/clients/dish/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/clients/dish/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/clients/generic/tsconfig.json b/packages/clients/generic/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/clients/generic/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/clients/meldemichel/src/language.ts b/packages/clients/meldemichel/src/locales.ts similarity index 66% rename from packages/clients/meldemichel/src/language.ts rename to packages/clients/meldemichel/src/locales.ts index 082c7d37e..b8847d44a 100644 --- a/packages/clients/meldemichel/src/language.ts +++ b/packages/clients/meldemichel/src/locales.ts @@ -1,6 +1,6 @@ // SKAT modeled by their ID; no semantic value for client /* eslint-disable @typescript-eslint/naming-convention */ -import { LanguageOption } from '@polar/lib-custom-types' +import { Locale } from '@polar/lib-custom-types' import { REPORT_STATUS, TIME_FILTER, SKAT } from './enums' const skat = { @@ -46,49 +46,51 @@ const filterCategory = { title: { skat: 'Kategorien', statu: 'Status' }, } -const language: LanguageOption[] = [ +export const meldemichelDe = { + attributions: { + stadtplan: + 'Kartografie Stadtplan: Landesbetrieb Geoinformation und Vermessung', + stadtwald: + 'Kartografie Stadtwald: Freie und Hansestadt Hamburg, Behörde für Umwelt, Klima, Energie und Agrarwirtschaft (BUKEA)', + luftbilder: + 'Kartografie Luftbilder: Landesbetrieb Geoinformation und Vermessung', + reports: 'Meldungen durch Bürger', + }, + gfi: { + title: 'Meldung', + skat: 'Kategorie', + beschr: 'Beschreibung', + rueck: 'Rückmeldung', + start: 'Gemeldet am', + statu: 'Status', + tooltip: { + multiHeader: 'Mehrere Anliegen', + multiBody: 'Klick zum Zoomen', + multiBodyUnresolvable: 'Klick zum Öffnen', + }, + }, + layers: { + stadtplan: 'Stadtplan', + stadtwald: 'Stadtwald', + luftbilder: 'Luftbildansicht', + reports: 'Meldungen', + hamburgBorder: 'Stadtgrenze Hamburg', + }, + skat, + status, + time: { + [TIME_FILTER.NONE]: 'Keine Einschränkung', + [TIME_FILTER.DAYS_7]: 'Die letzten 7 Tage', + [TIME_FILTER.DAYS_30]: 'Die letzten 30 Tage', + [TIME_FILTER.SELECTABLE]: 'Zeitraum wählen', + }, +} as const + +const locales: Locale[] = [ { type: 'de', resources: { - meldemichel: { - attributions: { - stadtplan: - 'Kartografie Stadtplan: Landesbetrieb Geoinformation und Vermessung', - stadtwald: - 'Kartografie Stadtwald: Freie und Hansestadt Hamburg, Behörde für Umwelt, Klima, Energie und Agrarwirtschaft (BUKEA)', - luftbilder: - 'Kartografie Luftbilder: Landesbetrieb Geoinformation und Vermessung', - reports: 'Meldungen durch Bürger', - }, - gfi: { - title: 'Meldung', - skat: 'Kategorie', - beschr: 'Beschreibung', - rueck: 'Rückmeldung', - start: 'Gemeldet am', - statu: 'Status', - tooltip: { - multiHeader: 'Mehrere Anliegen', - multiBody: 'Klick zum Zoomen', - multiBodyUnresolvable: 'Klick zum Öffnen', - }, - }, - layers: { - stadtplan: 'Stadtplan', - stadtwald: 'Stadtwald', - luftbilder: 'Luftbildansicht', - reports: 'Meldungen', - hamburgBorder: 'Stadtgrenze Hamburg', - }, - skat, - status, - time: { - [TIME_FILTER.NONE]: 'Keine Einschränkung', - [TIME_FILTER.DAYS_7]: 'Die letzten 7 Tage', - [TIME_FILTER.DAYS_30]: 'Die letzten 30 Tage', - [TIME_FILTER.SELECTABLE]: 'Zeitraum wählen', - }, - }, + meldemichel: meldemichelDe, plugins: { filter: { layerName: { @@ -147,13 +149,13 @@ const language: LanguageOption[] = [ ] // test for enum/locale synchronity; error on mismatch -language.forEach((languageOption) => { +locales.forEach((locale) => { const knownLocaleSKAT = Object.keys(skat) const knownEnumSKAT = SKAT.map((n) => String(n)) if (knownLocaleSKAT.sort().join(',') !== knownEnumSKAT.sort().join(',')) { throw new Error( - `POLAR Meldemichel: Error in language.ts/enums.ts: SKAT and Locales not in sync for language "${ - languageOption.type + `POLAR Meldemichel: Error in locales.ts/enums.ts: SKAT and Locales not in sync for language "${ + locale.type }". Affected SKAT: ${knownLocaleSKAT .filter((x) => !knownEnumSKAT.includes(x)) .concat(knownEnumSKAT.filter((x) => !knownLocaleSKAT.includes(x)))}` @@ -161,4 +163,4 @@ language.forEach((languageOption) => { } }) -export default language +export default locales diff --git a/packages/clients/meldemichel/src/mapConfigurations.ts b/packages/clients/meldemichel/src/mapConfigurations.ts index e5668174c..9996f563d 100644 --- a/packages/clients/meldemichel/src/mapConfigurations.ts +++ b/packages/clients/meldemichel/src/mapConfigurations.ts @@ -11,7 +11,7 @@ import { } from '@polar/lib-custom-types' import { MpApiParameters } from '@polar/plugin-address-search' import { MODE, SKAT, REPORT_STATUS } from './enums' -import language from './language' +import locales from './locales' import { MeldemichelCreateMapParams } from './types' import { showTooltip } from './utils/showTooltip' @@ -26,7 +26,7 @@ const hamburgRed = '#ff0019' const commonMapConfiguration: Partial = { checkServiceAvailability: false, // service register too long - locales: language, + locales, vuetify: { theme: { themes: { diff --git a/packages/clients/meldemichel/src/plugins/AfmButton/AfmButton.vue b/packages/clients/meldemichel/src/plugins/AfmButton/AfmButton.vue index 0465de0b4..3b0421a33 100644 --- a/packages/clients/meldemichel/src/plugins/AfmButton/AfmButton.vue +++ b/packages/clients/meldemichel/src/plugins/AfmButton/AfmButton.vue @@ -18,10 +18,10 @@ v-on="on" > fa-map-location - {{ $t('common:plugins.meldemichel.afmButton.buttonText') }} + {{ $t('plugins.meldemichel.afmButton.buttonText') }} - {{ $t('common:plugins.meldemichel.afmButton.hint') }} + {{ $t('plugins.meldemichel.afmButton.hint') }} diff --git a/packages/clients/meldemichel/src/plugins/AfmButton/index.ts b/packages/clients/meldemichel/src/plugins/AfmButton/index.ts index d556b6a49..cdf9ea260 100644 --- a/packages/clients/meldemichel/src/plugins/AfmButton/index.ts +++ b/packages/clients/meldemichel/src/plugins/AfmButton/index.ts @@ -1,12 +1,12 @@ import Vue from 'vue' import { PluginOptions } from '@polar/lib-custom-types' import AfmButton from './AfmButton.vue' -import language from './language' +import locales from './locales' export default (options: PluginOptions) => (instance: Vue) => instance.$store.dispatch('addComponent', { name: 'meldemichelAfmButton', plugin: AfmButton, - language, + locales, options, }) diff --git a/packages/clients/meldemichel/src/plugins/AfmButton/language.ts b/packages/clients/meldemichel/src/plugins/AfmButton/language.ts deleted file mode 100644 index c1b623fab..000000000 --- a/packages/clients/meldemichel/src/plugins/AfmButton/language.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { LanguageOption } from '@polar/lib-custom-types' - -const language: LanguageOption[] = [ - { - type: 'de', - resources: { - plugins: { - meldemichel: { - afmButton: { - buttonText: 'Neues Anliegen', - missingAddress: - 'Bitte geben Sie eine Adresse ein oder wählen Sie eine Position durch Klick in die Karte.', - hint: 'Einen neuen Schaden melden', - }, - }, - }, - }, - }, -] - -export default language diff --git a/packages/clients/meldemichel/src/plugins/AfmButton/locales.ts b/packages/clients/meldemichel/src/plugins/AfmButton/locales.ts new file mode 100644 index 000000000..903fff884 --- /dev/null +++ b/packages/clients/meldemichel/src/plugins/AfmButton/locales.ts @@ -0,0 +1,25 @@ +import { Locale } from '@polar/lib-custom-types' + +export const meldemichelDe = { + afmButton: { + buttonText: 'Neues Anliegen', + missingAddress: + 'Bitte geben Sie eine Adresse ein oder wählen Sie eine Position durch Klick in die Karte.', + hint: 'Einen neuen Schaden melden', + }, +} as const + +const locales: Locale[] = [ + { + type: 'de', + resources: { + plugins: { + meldemichel: { + ...meldemichelDe, + }, + }, + }, + }, +] + +export default locales diff --git a/packages/clients/meldemichel/src/plugins/Gfi/ActionButtons.vue b/packages/clients/meldemichel/src/plugins/Gfi/ActionButtons.vue index 857f65264..c23b467aa 100644 --- a/packages/clients/meldemichel/src/plugins/Gfi/ActionButtons.vue +++ b/packages/clients/meldemichel/src/plugins/Gfi/ActionButtons.vue @@ -3,7 +3,7 @@ fa-arrow-left-long @@ -11,7 +11,7 @@ fa-arrow-right-long diff --git a/packages/clients/meldemichel/src/plugins/Gfi/Feature.vue b/packages/clients/meldemichel/src/plugins/Gfi/Feature.vue index b06bcffd2..f26d7e4a7 100644 --- a/packages/clients/meldemichel/src/plugins/Gfi/Feature.vue +++ b/packages/clients/meldemichel/src/plugins/Gfi/Feature.vue @@ -6,7 +6,7 @@ fa-angles-right diff --git a/packages/clients/meldemichel/tsconfig.json b/packages/clients/meldemichel/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/clients/meldemichel/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/clients/snowbox/src/language.ts b/packages/clients/snowbox/src/locales.ts similarity index 58% rename from packages/clients/snowbox/src/language.ts rename to packages/clients/snowbox/src/locales.ts index eb71670fc..18c2da0dd 100644 --- a/packages/clients/snowbox/src/language.ts +++ b/packages/clients/snowbox/src/locales.ts @@ -1,32 +1,34 @@ -import { LanguageOption } from '@polar/lib-custom-types' +import { Locale } from '@polar/lib-custom-types' -const language: LanguageOption[] = [ +export const snowboxDe = { + attributions: { + basemap: 'Basemap © basemap.de / BKG ', + basemapGrey: 'Basemap Grau © basemap.de / BKG ', + underground: + 'Strecken U-Bahn © Freie und Hansestadt Hamburg, Behörde für Wirtschaft, Verkehr und Innovation', + rapid: + 'Strecken S-Bahn © Freie und Hansestadt Hamburg, Behörde für Wirtschaft, Verkehr und Innovation', + reports: 'Meldungen durch Bürger', + ausgleichsflaechen: + 'Ausgleichsflächen © Freie und Hansestadt Hamburg, Behörde für Umwelt und Energie', + hamburgBorder: 'Landesgrenze Hamburg © Freie und Hansestadt Hamburg', + }, + layers: { + basemap: 'Basemap.de (Farbe)', + basemapGrey: 'Basemap.de (Grau)', + underground: 'U-Bahn', + rapid: 'S-Bahn', + reports: 'Anliegen (MML)', + ausgleichsflaechen: 'Ausgleichsflächen', + hamburgBorder: 'Landesgrenze Hamburg', + }, +} as const + +const locales: Locale[] = [ { type: 'de', resources: { - snowbox: { - attributions: { - basemap: 'Basemap © basemap.de / BKG ', - basemapGrey: 'Basemap Grau © basemap.de / BKG ', - underground: - 'Strecken U-Bahn © Freie und Hansestadt Hamburg, Behörde für Wirtschaft, Verkehr und Innovation', - rapid: - 'Strecken S-Bahn © Freie und Hansestadt Hamburg, Behörde für Wirtschaft, Verkehr und Innovation', - reports: 'Meldungen durch Bürger', - ausgleichsflaechen: - 'Ausgleichsflächen © Freie und Hansestadt Hamburg, Behörde für Umwelt und Energie', - hamburgBorder: 'Landesgrenze Hamburg © Freie und Hansestadt Hamburg', - }, - layers: { - basemap: 'Basemap.de (Farbe)', - basemapGrey: 'Basemap.de (Grau)', - underground: 'U-Bahn', - rapid: 'S-Bahn', - reports: 'Anliegen (MML)', - ausgleichsflaechen: 'Ausgleichsflächen', - hamburgBorder: 'Landesgrenze Hamburg', - }, - }, + snowbox: snowboxDe, plugins: { pins: { toast: { @@ -75,4 +77,4 @@ const language: LanguageOption[] = [ }, ] -export default language +export default locales diff --git a/packages/clients/snowbox/src/mapConfiguration.ts b/packages/clients/snowbox/src/mapConfiguration.ts index 2f262a618..a9e6e3424 100644 --- a/packages/clients/snowbox/src/mapConfiguration.ts +++ b/packages/clients/snowbox/src/mapConfiguration.ts @@ -3,7 +3,7 @@ import { ExtendedMasterportalapiMarkersIsSelectableFunction, GfiIsSelectableFunction, } from '@polar/lib-custom-types' -import language from './language' +import locales from './locales' const eigengrau = '#16161d' const somewhatBlue = '#002177' @@ -49,7 +49,7 @@ const isReportSelectable: ExtendedMasterportalapiMarkersIsSelectableFunction = ( export const mapConfiguration = { language: 'en', - locales: language, + locales, vuetify: { theme: { themes: { diff --git a/packages/clients/snowbox/tsconfig.json b/packages/clients/snowbox/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/clients/snowbox/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/clients/textLocator/src/components/ResultInfo.vue b/packages/clients/textLocator/src/components/ResultInfo.vue index ee59efd17..2ef496103 100644 --- a/packages/clients/textLocator/src/components/ResultInfo.vue +++ b/packages/clients/textLocator/src/components/ResultInfo.vue @@ -18,16 +18,16 @@ - {{ $t('common:textLocator.addressSearch.resultInfo.name') }} + {{ $t('textLocator.addressSearch.resultInfo.name') }} - {{ $t('common:textLocator.addressSearch.resultInfo.type') }} + {{ $t('textLocator.addressSearch.resultInfo.type') }} - {{ $t('common:textLocator.addressSearch.resultInfo.language') }} + {{ $t('textLocator.addressSearch.resultInfo.language') }} - {{ $t('common:textLocator.addressSearch.resultInfo.timeFrame') }} + {{ $t('textLocator.addressSearch.resultInfo.timeFrame') }} diff --git a/packages/clients/textLocator/src/language.ts b/packages/clients/textLocator/src/language.ts deleted file mode 100644 index ae13f0124..000000000 --- a/packages/clients/textLocator/src/language.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { LanguageOption } from '@polar/lib-custom-types' -import { - openStreetMap, - openSeaMap, - mdiSeaNames, - wmtsTopplusOpenWeb, - wmtsTopplusOpenWebGrey, - wmtsTopplusOpenLight, - wmtsTopplusOpenLightGrey, - aerial, -} from './services' - -const locales: LanguageOption[] = [ - { - type: 'de', - resources: { - textLocator: { - layers: { - [openStreetMap]: 'OpenStreetMap', - [openSeaMap]: 'OpenSeaMap', - [mdiSeaNames]: 'Namensdienst Küste', - [wmtsTopplusOpenWeb]: 'TopPlusOpen (Web)', - [wmtsTopplusOpenWebGrey]: 'TopPlusOpen (Web, Grau)', - [wmtsTopplusOpenLight]: 'TopPlusOpen (Light)', - [wmtsTopplusOpenLightGrey]: 'TopPlusOpen (Light, Grau)', - [aerial]: 'Luftbilder Sen2Europe', - }, - addressSearch: { - resultInfo: { - name: 'Name', - type: 'Typ', - language: 'Sprache', - timeFrame: 'Zeitraum', - }, - groupTL: 'Literatur- und Ortssuche', - toponym: 'Ortssuche', - literature: 'Literatursuche', - }, - attributions: { - [openStreetMap]: `$t(textLocator.layers.${openStreetMap}): © OpenStreetMap contributors`, - [openSeaMap]: `$t(textLocator.layers.${openSeaMap}): © OpenSeaMap`, - [mdiSeaNames]: `$t(textLocator.layers.${mdiSeaNames}): © MDI DE`, - [wmtsTopplusOpenWeb]: `$t(textLocator.layers.${wmtsTopplusOpenWeb}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, - [wmtsTopplusOpenWebGrey]: `$t(textLocator.layers.${wmtsTopplusOpenWebGrey}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, - [wmtsTopplusOpenLight]: `$t(textLocator.layers.${wmtsTopplusOpenLight}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, - [wmtsTopplusOpenLightGrey]: `$t(textLocator.layers.${wmtsTopplusOpenLightGrey}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, - [aerial]: `$t(textLocator.layers.${aerial}): © Europäische Union, enthält veränderte Copernicus Sentinel-Daten ({{YEAR}})`, - kuestengazetteer: - '
Zur Ortssuche wird der Küstengazetteer eingesetzt.', - static: - 'Impressum', - }, - info: { - noLiteratureFound: 'Es wurden keine Texte zu diesen Orten gefunden.', - noGeometriesFound: - 'Es wurden keine Orte zu dieser Geometrie gefunden.', - loadingTime: - 'Es gibt viele Ergebnisse zu der letzten Anfrage. Der Ladevorgang kann einen Moment länger dauern.', - }, - error: { - search: - 'Die Suche ist mit einem unbekannten Fehler fehlgeschlagen. Bitte versuchen Sie es später erneut.', - }, - }, - }, - }, - // NOTE: English translation not yet required and may be incomplete - { - type: 'en', - resources: { - textLocator: { - layers: { - [openStreetMap]: 'OpenStreetMap', - [openSeaMap]: 'OpenSeaMap', - [mdiSeaNames]: 'Coastal name service', - [wmtsTopplusOpenWeb]: 'TopPlusOpen (Web)', - [wmtsTopplusOpenWebGrey]: 'TopPlusOpen (Web, Grey)', - [wmtsTopplusOpenLight]: 'TopPlusOpen (Light)', - [wmtsTopplusOpenLightGrey]: 'TopPlusOpen (Light, Grey)', - [aerial]: 'Aerial photographs Sen2Europe', - }, - addressSearch: { - unnamed: 'Unnamed', - }, - attributions: { - [openStreetMap]: `$t(textLocator.layers.${openStreetMap}): © OpenStreetMap contributors`, - [openSeaMap]: `$t(textLocator.layers.${openSeaMap}): © OpenSeaMap`, - [mdiSeaNames]: `$t(textLocator.layers.${mdiSeaNames}): © MDI DE`, - [wmtsTopplusOpenWeb]: `$t(textLocator.layers.${wmtsTopplusOpenWeb}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, - [wmtsTopplusOpenWebGrey]: `$t(textLocator.layers.${wmtsTopplusOpenWebGrey}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, - [wmtsTopplusOpenLight]: `$t(textLocator.layers.${wmtsTopplusOpenLight}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, - [wmtsTopplusOpenLightGrey]: `$t(textLocator.layers.${wmtsTopplusOpenLightGrey}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, - [aerial]: `$t(textLocator.layers.${aerial}): © European Union, contains modified Copernicus Sentinel data ({{YEAR}})`, - static: - '
Legal notice (Impressum)', - }, - info: { - noLiteratureFound: 'No texts were found regarding these places.', - noGeometriesFound: 'No places were found regarding this geometry.', - }, - error: { - searchCoastalGazetteer: - 'The search failed with an unknown error. Please try again later.', - }, - }, - plugins: { - addressSearch: { - defaultGroup: 'Location search', - }, - }, - }, - }, -] - -export default locales diff --git a/packages/clients/textLocator/src/locales.ts b/packages/clients/textLocator/src/locales.ts new file mode 100644 index 000000000..6631058aa --- /dev/null +++ b/packages/clients/textLocator/src/locales.ts @@ -0,0 +1,116 @@ +import { Locale } from '@polar/lib-custom-types' +import { + openStreetMap, + openSeaMap, + mdiSeaNames, + wmtsTopplusOpenWeb, + wmtsTopplusOpenWebGrey, + wmtsTopplusOpenLight, + wmtsTopplusOpenLightGrey, + aerial, +} from './services' + +export const textLocatorDe = { + layers: { + [openStreetMap]: 'OpenStreetMap', + [openSeaMap]: 'OpenSeaMap', + [mdiSeaNames]: 'Namensdienst Küste', + [wmtsTopplusOpenWeb]: 'TopPlusOpen (Web)', + [wmtsTopplusOpenWebGrey]: 'TopPlusOpen (Web, Grau)', + [wmtsTopplusOpenLight]: 'TopPlusOpen (Light)', + [wmtsTopplusOpenLightGrey]: 'TopPlusOpen (Light, Grau)', + [aerial]: 'Luftbilder Sen2Europe', + }, + addressSearch: { + resultInfo: { + name: 'Name', + type: 'Typ', + language: 'Sprache', + timeFrame: 'Zeitraum', + }, + groupTL: 'Literatur- und Ortssuche', + toponym: 'Ortssuche', + literature: 'Literatursuche', + }, + attributions: { + [openStreetMap]: `$t(textLocator.layers.${openStreetMap}): © OpenStreetMap contributors`, + [openSeaMap]: `$t(textLocator.layers.${openSeaMap}): © OpenSeaMap`, + [mdiSeaNames]: `$t(textLocator.layers.${mdiSeaNames}): © MDI DE`, + [wmtsTopplusOpenWeb]: `$t(textLocator.layers.${wmtsTopplusOpenWeb}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, + [wmtsTopplusOpenWebGrey]: `$t(textLocator.layers.${wmtsTopplusOpenWebGrey}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, + [wmtsTopplusOpenLight]: `$t(textLocator.layers.${wmtsTopplusOpenLight}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, + [wmtsTopplusOpenLightGrey]: `$t(textLocator.layers.${wmtsTopplusOpenLightGrey}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, + [aerial]: `$t(textLocator.layers.${aerial}): © Europäische Union, enthält veränderte Copernicus Sentinel-Daten ({{YEAR}})`, + kuestengazetteer: + '
Zur Ortssuche wird der Küstengazetteer eingesetzt.', + static: + 'Impressum', + }, + info: { + noLiteratureFound: 'Es wurden keine Texte zu diesen Orten gefunden.', + noGeometriesFound: 'Es wurden keine Orte zu dieser Geometrie gefunden.', + loadingTime: + 'Es gibt viele Ergebnisse zu der letzten Anfrage. Der Ladevorgang kann einen Moment länger dauern.', + }, + error: { + search: + 'Die Suche ist mit einem unbekannten Fehler fehlgeschlagen. Bitte versuchen Sie es später erneut.', + }, +} as const + +const locales: Locale[] = [ + { + type: 'de', + resources: { + textLocator: textLocatorDe, + }, + }, + // NOTE: English translation not yet required and may be incomplete + { + type: 'en', + resources: { + textLocator: { + layers: { + [openStreetMap]: 'OpenStreetMap', + [openSeaMap]: 'OpenSeaMap', + [mdiSeaNames]: 'Coastal name service', + [wmtsTopplusOpenWeb]: 'TopPlusOpen (Web)', + [wmtsTopplusOpenWebGrey]: 'TopPlusOpen (Web, Grey)', + [wmtsTopplusOpenLight]: 'TopPlusOpen (Light)', + [wmtsTopplusOpenLightGrey]: 'TopPlusOpen (Light, Grey)', + [aerial]: 'Aerial photographs Sen2Europe', + }, + addressSearch: { + unnamed: 'Unnamed', + }, + attributions: { + [openStreetMap]: `$t(textLocator.layers.${openStreetMap}): © OpenStreetMap contributors`, + [openSeaMap]: `$t(textLocator.layers.${openSeaMap}): © OpenSeaMap`, + [mdiSeaNames]: `$t(textLocator.layers.${mdiSeaNames}): © MDI DE`, + [wmtsTopplusOpenWeb]: `$t(textLocator.layers.${wmtsTopplusOpenWeb}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, + [wmtsTopplusOpenWebGrey]: `$t(textLocator.layers.${wmtsTopplusOpenWebGrey}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, + [wmtsTopplusOpenLight]: `$t(textLocator.layers.${wmtsTopplusOpenLight}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, + [wmtsTopplusOpenLightGrey]: `$t(textLocator.layers.${wmtsTopplusOpenLightGrey}): © Bundesamt für Kartographie und Geodäsie {{YEAR}}`, + [aerial]: `$t(textLocator.layers.${aerial}): © European Union, contains modified Copernicus Sentinel data ({{YEAR}})`, + static: + '
Legal notice (Impressum)', + }, + info: { + noLiteratureFound: 'No texts were found regarding these places.', + noGeometriesFound: 'No places were found regarding this geometry.', + }, + error: { + searchCoastalGazetteer: + 'The search failed with an unknown error. Please try again later.', + }, + }, + plugins: { + addressSearch: { + defaultGroup: 'Location search', + }, + }, + }, + }, +] + +export default locales diff --git a/packages/clients/textLocator/src/mapConfig.ts b/packages/clients/textLocator/src/mapConfig.ts index ab54b5ba4..fa8ca3c30 100644 --- a/packages/clients/textLocator/src/mapConfig.ts +++ b/packages/clients/textLocator/src/mapConfig.ts @@ -1,5 +1,5 @@ import { MapConfig } from '@polar/lib-custom-types' -import locales from './language' +import locales from './locales' import { openStreetMap, openSeaMap, diff --git a/packages/clients/textLocator/src/plugins/GeometrySearch/components/DrawMode.vue b/packages/clients/textLocator/src/plugins/GeometrySearch/components/DrawMode.vue index ac25ccd55..1a9ffebb4 100644 --- a/packages/clients/textLocator/src/plugins/GeometrySearch/components/DrawMode.vue +++ b/packages/clients/textLocator/src/plugins/GeometrySearch/components/DrawMode.vue @@ -1,16 +1,16 @@ diff --git a/packages/clients/textLocator/src/plugins/GeometrySearch/index.ts b/packages/clients/textLocator/src/plugins/GeometrySearch/index.ts index ee98c800a..60df52f16 100644 --- a/packages/clients/textLocator/src/plugins/GeometrySearch/index.ts +++ b/packages/clients/textLocator/src/plugins/GeometrySearch/index.ts @@ -1,7 +1,7 @@ import Vue from 'vue' import { PluginOptions } from '@polar/lib-custom-types' import { GeometrySearch } from './components' -import language from './language' +import locales from './locales' import { makeStoreModule } from './store' interface GeometrySearchConfiguration extends PluginOptions { @@ -13,7 +13,7 @@ export default (options: Partial) => instance.$store.dispatch('addComponent', { name: 'geometrySearch', plugin: GeometrySearch, - language, + locales, storeModule: makeStoreModule(), options, }) diff --git a/packages/clients/textLocator/src/plugins/GeometrySearch/language.ts b/packages/clients/textLocator/src/plugins/GeometrySearch/language.ts deleted file mode 100644 index f05e8c159..000000000 --- a/packages/clients/textLocator/src/plugins/GeometrySearch/language.ts +++ /dev/null @@ -1,101 +0,0 @@ -// other names required -/* eslint-disable @typescript-eslint/naming-convention */ -import { LanguageOption } from '@polar/lib-custom-types' - -const language: LanguageOption[] = [ - { - type: 'de', - resources: { - plugins: { - iconMenu: { - hints: { - geometrySearch: 'Geometriesuche', - }, - }, - geometrySearch: { - draw: { - title: 'Zeichenmodus', - description: { - Point: - 'Klicken Sie in die Karte, um Ortsnamen und Literatur zu einer Punktkoordinate abzufragen. $t(plugins.geometrySearch.draw.description.Common)', - Polygon: - 'Klicken Sie wiederholt in die Karte, um eine Fläche zu zeichnen, zu der Ortsnamen und Literatur abgefragt werden. Doppelklick beendet eine Zeichnung. $t(plugins.geometrySearch.draw.description.Common)', - Common: 'Neue Zeichnungen verwerfen vorangehende Ergebnisse.', - }, - }, - tooltip: { - title: 'Orte', - highlight: { - cold: 'Auf Fund zoomen', - heat: 'Auf Funde zoomen und nach Relevanz färben', - }, - focusSearch: 'Neue Suche nach allen Geometrien zu dieser Geometrie', - textSearch: 'Suche nach allen Geometrien zu diesem Text', - badge: { - textToToponym: - 'Anzahl der Ortsnennungen zu den aktuell angezeigten Geometrien in diesem Text', - toponymInText: - 'Anzahl der Funde dieses Ortes im aktuell geöffneten Text', - toponymToText: - 'Anzahl der Ortsnennungen dieses Ortes über alle aktuell betrachteten Texte', - textInToponym: - 'Anzahl der Funde des aktuellen geöffneten Ortes in diesem Text', - }, - }, - results: { - title: 'Funde', - source: 'aus der {{ searchType }}', - sourceOptions: { - geometrySearch: 'Geometriesuche', - literatureSearch: 'Literatursuche', - toponymSearch: 'Ortssuche', - }, - byLocation: 'Ort', - byText: 'Text', - none: 'Keine Suchergebnisse', - }, - }, - }, - }, - }, - { - type: 'en', - resources: { - plugins: { - iconMenu: { - hints: { - geometrySearch: 'Geometry search', - }, - }, - geometrySearch: { - draw: { - title: 'Draw mode', - description: { - Point: - 'Click somewhere in the map to request location names and literature to a point coordinate. $t(plugins.geometrySearch.draw.description.Common)', - Polygon: - 'Click repeatedly in the map to draw an area to request location names and literature to. Double click finishes an area. $t(plugins.geometrySearch.draw.description.Common)', - Common: 'New drawings discard previous results.', - }, - }, - tooltip: { - title: 'Locations', - highlight: { - cold: 'Zoom to finding', - heat: 'Zoom to findings and color by relevance', - }, - focusSearch: 'New search for all geometries to this geometry', - }, - results: { - title: 'Findings', - byLocation: 'Place', - byText: 'Text', - none: 'No search results', - }, - }, - }, - }, - }, -] - -export default language diff --git a/packages/clients/textLocator/src/plugins/GeometrySearch/locales.ts b/packages/clients/textLocator/src/plugins/GeometrySearch/locales.ts new file mode 100644 index 000000000..0bfd8ebcb --- /dev/null +++ b/packages/clients/textLocator/src/plugins/GeometrySearch/locales.ts @@ -0,0 +1,104 @@ +// other names required +/* eslint-disable @typescript-eslint/naming-convention */ +import { Locale } from '@polar/lib-custom-types' + +export const geometrySearchDe = { + draw: { + title: 'Zeichenmodus', + description: { + Point: + 'Klicken Sie in die Karte, um Ortsnamen und Literatur zu einer Punktkoordinate abzufragen. $t(plugins.geometrySearch.draw.description.Common)', + Polygon: + 'Klicken Sie wiederholt in die Karte, um eine Fläche zu zeichnen, zu der Ortsnamen und Literatur abgefragt werden. Doppelklick beendet eine Zeichnung. $t(plugins.geometrySearch.draw.description.Common)', + Common: 'Neue Zeichnungen verwerfen vorangehende Ergebnisse.', + }, + }, + tooltip: { + title: 'Orte', + highlight: { + cold: 'Auf Fund zoomen', + heat: 'Auf Funde zoomen und nach Relevanz färben', + }, + focusSearch: 'Neue Suche nach allen Geometrien zu dieser Geometrie', + textSearch: 'Suche nach allen Geometrien zu diesem Text', + badge: { + textToToponym: + 'Anzahl der Ortsnennungen zu den aktuell angezeigten Geometrien in diesem Text', + toponymInText: 'Anzahl der Funde dieses Ortes im aktuell geöffneten Text', + toponymToText: + 'Anzahl der Ortsnennungen dieses Ortes über alle aktuell betrachteten Texte', + textInToponym: + 'Anzahl der Funde des aktuellen geöffneten Ortes in diesem Text', + }, + }, + results: { + title: 'Funde', + source: 'aus der {{ searchType }}', + sourceOptions: { + geometrySearch: 'Geometriesuche', + literatureSearch: 'Literatursuche', + toponymSearch: 'Ortssuche', + }, + byLocation: 'Ort', + byText: 'Text', + none: 'Keine Suchergebnisse', + }, +} as const + +const locales: Locale[] = [ + { + type: 'de', + resources: { + plugins: { + iconMenu: { + hints: { + geometrySearch: 'Geometriesuche', + }, + }, + geometrySearch: { + ...geometrySearchDe, + }, + }, + }, + }, + { + type: 'en', + resources: { + plugins: { + iconMenu: { + hints: { + geometrySearch: 'Geometry search', + }, + }, + geometrySearch: { + draw: { + title: 'Draw mode', + description: { + Point: + 'Click somewhere in the map to request location names and literature to a point coordinate. $t(plugins.geometrySearch.draw.description.Common)', + Polygon: + 'Click repeatedly in the map to draw an area to request location names and literature to. Double click finishes an area. $t(plugins.geometrySearch.draw.description.Common)', + Common: 'New drawings discard previous results.', + }, + }, + tooltip: { + title: 'Locations', + highlight: { + cold: 'Zoom to finding', + heat: 'Zoom to findings and color by relevance', + }, + focusSearch: 'New search for all geometries to this geometry', + }, + results: { + title: 'Findings', + byLocation: 'Place', + byText: 'Text', + none: 'No search results', + }, + }, + }, + }, + }, +] + +export default locales diff --git a/packages/clients/textLocator/src/plugins/Header/Header.vue b/packages/clients/textLocator/src/plugins/Header/Header.vue index dc4c5eee1..0bd1fa8e5 100644 --- a/packages/clients/textLocator/src/plugins/Header/Header.vue +++ b/packages/clients/textLocator/src/plugins/Header/Header.vue @@ -1,6 +1,6 @@ @@ -17,7 +17,7 @@ ref="polar-map-container" class="polar-map" tabindex="0" - :aria-label="$t('common:canvas.label')" + :aria-label="$t('canvas.label')" > - i18next.addResourceBundle(lng.type, 'common', lng.resources, true) + this.mapConfiguration.locales?.forEach?.((locale: Locale) => + i18next.addResourceBundle(locale.type, 'common', locale.resources, true) ) i18next.on('languageChanged', (lang) => (this.lang = lang)) diff --git a/packages/core/src/i18n/index.ts b/packages/core/src/i18n/index.ts index a618a4c6b..7e932eb42 100644 --- a/packages/core/src/i18n/index.ts +++ b/packages/core/src/i18n/index.ts @@ -2,19 +2,19 @@ import i18next, { init, use } from 'i18next' import LanguageDetector from 'i18next-browser-languagedetector' import Vue from 'vue' import VueI18Next from 'i18next-vue' -import language from '../language' +import locales from '../locales' use(LanguageDetector) Vue.use(VueI18Next, { i18next }) -const supportedLngs = language.map(({ type }) => type) +const supportedLngs = locales.map(({ type }) => type) /** * @param initialLanguage - If given, the initial language set in the mapConfiguration. */ export default (initialLanguage?: string) => init({ - resources: language.reduce((accumulator, { type, resources }) => { + resources: locales.reduce((accumulator, { type, resources }) => { accumulator[type] = resources return accumulator }, {}), diff --git a/packages/core/src/language.ts b/packages/core/src/language.ts deleted file mode 100644 index 981361180..000000000 --- a/packages/core/src/language.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { LanguageOption } from '@polar/lib-custom-types' - -// first type will be used as fallback language -const language: LanguageOption[] = [ - { - type: 'de', - resources: { - common: { - canvas: { - label: 'Kartenanwendung', - }, - error: { - serviceUnavailable: - 'Der Kartendienst "{{serviceName}}" (ID: {{serviceId}}) ist derzeit nicht verfügbar. Dies kann die Funktionalität der Karte einschränken.', - }, - overlay: { - noControlOnZoom: 'Verwenden Sie Strg+Scrollen zum Zoomen der Karte', - noCommandOnZoom: - 'Verwenden Sie Command ⌘ + Scrollen zum Zoomen der Karte', - oneFingerPan: - 'Verwenden Sie mindestens zwei Finger zum Verschieben der Karte', - }, - }, - }, - }, - { - type: 'en', - resources: { - common: { - canvas: { - label: 'Map application', - }, - error: { - serviceUnavailable: - 'Service "{{serviceName}}" (ID: {{serviceId}}) is unavailable. This may limit the map\'s functionality.', - }, - overlay: { - noControlOnZoom: 'Use Ctrl+Mousewheel to zoom into the map', - noCommandOnZoom: 'Use Command ⌘ + Mousewheel to zoom into the map', - oneFingerPan: 'Use at least two fingers to pan the map', - }, - }, - }, - }, -] - -export default language diff --git a/packages/core/src/locales.ts b/packages/core/src/locales.ts new file mode 100644 index 000000000..32f94a824 --- /dev/null +++ b/packages/core/src/locales.ts @@ -0,0 +1,51 @@ +import { Locale } from '@polar/lib-custom-types' + +export const resourcesDe = { + common: { + canvas: { + label: 'Kartenanwendung', + }, + error: { + serviceUnavailable: + 'Der Kartendienst "{{serviceName}}" (ID: {{serviceId}}) ist derzeit nicht verfügbar. Dies kann die Funktionalität der Karte einschränken.', + }, + overlay: { + noControlOnZoom: 'Verwenden Sie Strg+Scrollen zum Zoomen der Karte', + noCommandOnZoom: + 'Verwenden Sie Command ⌘ + Scrollen zum Zoomen der Karte', + oneFingerPan: + 'Verwenden Sie mindestens zwei Finger zum Verschieben der Karte', + }, + }, +} + +export const resourcesEn = { + common: { + canvas: { + label: 'Map application', + }, + error: { + serviceUnavailable: + 'Service "{{serviceName}}" (ID: {{serviceId}}) is unavailable. This may limit the map\'s functionality.', + }, + overlay: { + noControlOnZoom: 'Use Ctrl+Mousewheel to zoom into the map', + noCommandOnZoom: 'Use Command ⌘ + Mousewheel to zoom into the map', + oneFingerPan: 'Use at least two fingers to pan the map', + }, + }, +} + +// first type will be used as fallback language +const locales: Locale[] = [ + { + type: 'de', + resources: resourcesDe, + }, + { + type: 'en', + resources: resourcesEn, + }, +] + +export default locales diff --git a/packages/core/src/vuePlugins/actions/checkServiceAvailability.ts b/packages/core/src/vuePlugins/actions/checkServiceAvailability.ts index 96f34f50f..24e637ee7 100644 --- a/packages/core/src/vuePlugins/actions/checkServiceAvailability.ts +++ b/packages/core/src/vuePlugins/actions/checkServiceAvailability.ts @@ -28,7 +28,8 @@ export default function ( if (this.hasModule(['plugin', 'toast'])) { this.dispatch('plugin/toast/addToast', { type: 'warning', - text: i18next.t('common:error.serviceUnavailable', { + // @ts-expect-error | t seems to be mistyped https://www.i18next.com/translation-function/interpolation#basic + text: i18next.t('error.serviceUnavailable', { serviceId: service.id, serviceName: service.name, }), diff --git a/packages/core/src/vuePlugins/vuex.ts b/packages/core/src/vuePlugins/vuex.ts index e3d0f3d6b..6d66cd10d 100644 --- a/packages/core/src/vuePlugins/vuex.ts +++ b/packages/core/src/vuePlugins/vuex.ts @@ -217,7 +217,7 @@ export const makeStore = () => { actions: { checkServiceAvailability, addComponent({ state, commit, dispatch }, component: PluginContainer) { - const { language, name, options, storeModule } = component + const { locales, language, name, options, storeModule } = component /* configuration merge – "options" are from client-code, "configuration" * is from mapConfiguration object and thus overrides */ @@ -239,9 +239,9 @@ export const makeStore = () => { dispatch(setupActionName, options) } } - if (language) { - // NOTE: If somehow needed later, add the namespace to the LanguageOption as well - language.forEach((lng) => { + if (locales ?? language) { + // NOTE: If somehow needed later, add the namespace to the Locale as well + ;(locales ?? language).forEach((lng) => { i18next.addResourceBundle(lng.type, 'common', lng.resources, true) }) } diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json deleted file mode 100644 index 650b364e4..000000000 --- a/packages/core/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "types": ["custom", "vue-shims", "vuetify", "jest", "DOM"] - } -} diff --git a/packages/lib/getCluster/tsconfig.json b/packages/lib/getCluster/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/lib/getCluster/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/lib/getFeatures/tsconfig.json b/packages/lib/getFeatures/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/lib/getFeatures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/lib/idx/tsconfig.json b/packages/lib/idx/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/lib/idx/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/lib/invisibleStyle/tsconfig.json b/packages/lib/invisibleStyle/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/lib/invisibleStyle/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/lib/passesBoundaryCheck/tsconfig.json b/packages/lib/passesBoundaryCheck/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/lib/passesBoundaryCheck/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/lib/testMountParameters/tsconfig.json b/packages/lib/testMountParameters/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/lib/testMountParameters/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/lib/tooltip/index.ts b/packages/lib/tooltip/index.ts index f3df55974..9578796e3 100644 --- a/packages/lib/tooltip/index.ts +++ b/packages/lib/tooltip/index.ts @@ -26,6 +26,7 @@ const setInnerHtml = (tooltip.innerHTML = localeKeys .map( ([element, localeKey]) => + // @ts-expect-error | can't control key configuration `<${element}>${i18next.t(localeKey)}` ) .join('')) diff --git a/packages/lib/tooltip/tsconfig.json b/packages/lib/tooltip/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/lib/tooltip/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/plugins/AddressSearch/src/components/GroupSelect.vue b/packages/plugins/AddressSearch/src/components/GroupSelect.vue index 344b73164..71030cf86 100644 --- a/packages/plugins/AddressSearch/src/components/GroupSelect.vue +++ b/packages/plugins/AddressSearch/src/components/GroupSelect.vue @@ -4,7 +4,7 @@ v-model="selectedItem" dense class="polar-plugin-address-search-group-select" - :aria-label="$t('common:plugins.addressSearch.groupSelector')" + :aria-label="$t('plugins.addressSearch.groupSelector')" :items=" // mapping in template to guarantee update on language change groupSelectOptions.map(({ value, text }) => ({ value, text: $t(text) })) diff --git a/packages/plugins/AddressSearch/src/components/Results.vue b/packages/plugins/AddressSearch/src/components/Results.vue index 98efc708f..a62ee5dc6 100644 --- a/packages/plugins/AddressSearch/src/components/Results.vue +++ b/packages/plugins/AddressSearch/src/components/Results.vue @@ -24,7 +24,7 @@ > {{ $t(category) }} {{ - $t('common:plugins.addressSearch.resultCount', { + $t('plugins.addressSearch.resultCount', { count: features.length, }) }} @@ -86,7 +86,7 @@ {{ $t( - `common:plugins.addressSearch.resultList.${ + `plugins.addressSearch.resultList.${ areResultsExpanded(category) ? 'reduce' : `extend${hasMaximum(selectedGroup[index]) ? 'Max' : ''}` diff --git a/packages/plugins/AddressSearch/src/index.ts b/packages/plugins/AddressSearch/src/index.ts index bb7a94053..6aa14af55 100644 --- a/packages/plugins/AddressSearch/src/index.ts +++ b/packages/plugins/AddressSearch/src/index.ts @@ -2,7 +2,7 @@ import Vue from 'vue' import { AddressSearchConfiguration } from '@polar/lib-custom-types' import { AddressSearch } from './components' -import language from './language' +import locales from './locales' import { makeStoreModule } from './store' import SearchResultSymbols from './utils/searchResultSymbols' @@ -18,7 +18,7 @@ export default (options: AddressSearchConfiguration) => (instance: Vue) => instance.$store.dispatch('addComponent', { name: 'addressSearch', plugin: AddressSearch, - language, + locales, storeModule: makeStoreModule(), options, }) diff --git a/packages/plugins/AddressSearch/src/language.ts b/packages/plugins/AddressSearch/src/language.ts deleted file mode 100644 index 98e03a1e2..000000000 --- a/packages/plugins/AddressSearch/src/language.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { LanguageOption } from '@polar/lib-custom-types' - -const language: LanguageOption[] = [ - { - type: 'de', - resources: { - plugins: { - addressSearch: { - hint: { - error: 'Etwas ist bei der Suche schiefgegangen.', - noResults: 'Keine Ergebnisse gefunden.', - loading: 'Suche ...', - tooShort: - 'Für die Suche bitte mindestens {{minLength}} Zeichen eingeben.', - }, - defaultGroup: 'Adresssuche', - groupSelector: 'Suchthema auswählen', - resultCount: '({{count}} Ergebnisse)', - resultList: { - extend: 'Alle Ergebnisse anzeigen', - extendMax: - 'Alle Ergebnisse (max. {{queryParameters.maxFeatures}}) anzeigen', - reduce: 'Ergebnisliste reduzieren', - }, - }, - }, - }, - }, - { - type: 'en', - resources: { - plugins: { - addressSearch: { - hint: { - error: 'Something went wrong.', - noResults: 'No results for the current query.', - loading: 'Searching ...', - tooShort: 'Please enter at least {{minLength}} characters.', - }, - defaultGroup: 'Address Search', - groupSelector: 'Select search topic', - resultCount: '({{count}} results)', - resultList: { - extend: 'Show all results', - extendMax: - 'Show all results (max. {{queryParameters.maxFeatures}})', - reduce: 'Reduce result list', - }, - }, - }, - }, - }, -] - -export default language diff --git a/packages/plugins/AddressSearch/src/locales.ts b/packages/plugins/AddressSearch/src/locales.ts new file mode 100644 index 000000000..423fd7e86 --- /dev/null +++ b/packages/plugins/AddressSearch/src/locales.ts @@ -0,0 +1,58 @@ +import { Locale } from '@polar/lib-custom-types' + +export const resourcesDe = { + plugins: { + addressSearch: { + hint: { + error: 'Etwas ist bei der Suche schiefgegangen.', + noResults: 'Keine Ergebnisse gefunden.', + loading: 'Suche ...', + tooShort: + 'Für die Suche bitte mindestens {{minLength}} Zeichen eingeben.', + }, + defaultGroup: 'Adresssuche', + groupSelector: 'Suchthema auswählen', + resultCount: '({{count}} Ergebnisse)', + resultList: { + extend: 'Alle Ergebnisse anzeigen', + extendMax: + 'Alle Ergebnisse (max. {{queryParameters.maxFeatures}}) anzeigen', + reduce: 'Ergebnisliste reduzieren', + }, + }, + }, +} as const + +export const resourcesEn = { + plugins: { + addressSearch: { + hint: { + error: 'Something went wrong.', + noResults: 'No results for the current query.', + loading: 'Searching ...', + tooShort: 'Please enter at least {{minLength}} characters.', + }, + defaultGroup: 'Address Search', + groupSelector: 'Select search topic', + resultCount: '({{count}} results)', + resultList: { + extend: 'Show all results', + extendMax: 'Show all results (max. {{queryParameters.maxFeatures}})', + reduce: 'Reduce result list', + }, + }, + }, +} as const + +const locales: Locale[] = [ + { + type: 'de', + resources: resourcesDe, + }, + { + type: 'en', + resources: resourcesEn, + }, +] + +export default locales diff --git a/packages/plugins/AddressSearch/src/store/getters.ts b/packages/plugins/AddressSearch/src/store/getters.ts index d13e7fb71..9b41f7a5f 100644 --- a/packages/plugins/AddressSearch/src/store/getters.ts +++ b/packages/plugins/AddressSearch/src/store/getters.ts @@ -14,7 +14,7 @@ import { import { getInitialState } from './state' const defaultGroupProperties: AddressSearchGroupProperties = { - label: 'common:plugins.addressSearch.defaultGroup', + label: 'plugins.addressSearch.defaultGroup', placeholder: '', hint: '', resultDisplayMode: 'mixed', @@ -159,19 +159,19 @@ const getters: PolarGetterTree = { { selectedGroupHint, minLength, featuresAvailable, loading } ) { if (loading) { - return 'common:plugins.addressSearch.hint.loading' + return 'plugins.addressSearch.hint.loading' } if (searchResults === SearchResults.ERROR) { - return 'common:plugins.addressSearch.hint.error' + return 'plugins.addressSearch.hint.error' } if (inputValue && inputValue.length > 0 && inputValue.length < minLength) { - return 'common:plugins.addressSearch.hint.tooShort' + return 'plugins.addressSearch.hint.tooShort' } if (searchResults !== SearchResults.NO_SEARCH && !featuresAvailable) { - return 'common:plugins.addressSearch.hint.noResults' + return 'plugins.addressSearch.hint.noResults' } return selectedGroupHint diff --git a/packages/plugins/AddressSearch/tsconfig.json b/packages/plugins/AddressSearch/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/plugins/AddressSearch/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/plugins/Attributions/src/components/AttributionButton.vue b/packages/plugins/Attributions/src/components/AttributionButton.vue index bc0f4d2c2..1ceaebbb4 100644 --- a/packages/plugins/Attributions/src/components/AttributionButton.vue +++ b/packages/plugins/Attributions/src/components/AttributionButton.vue @@ -5,11 +5,7 @@ fab color="secondary" :title=" - $t( - `common:plugins.attributions.button.${ - windowIsOpen ? 'close' : 'open' - }Title` - ) + $t(`plugins.attributions.button.${windowIsOpen ? 'close' : 'open'}Title`) " @click="toggleMapInfo" > diff --git a/packages/plugins/Attributions/src/components/AttributionContent.vue b/packages/plugins/Attributions/src/components/AttributionContent.vue index e57bcc555..97269027a 100644 --- a/packages/plugins/Attributions/src/components/AttributionContent.vue +++ b/packages/plugins/Attributions/src/components/AttributionContent.vue @@ -9,7 +9,7 @@ :max-width="maxWidth" > - {{ $t('common:plugins.attributions.title') }} + {{ $t('plugins.attributions.title') }} (instance: Vue) => instance.$store.dispatch('addComponent', { name: 'iconMenu', plugin: IconMenu, - language, + locales, storeModule: makeStoreModule(), options, }) diff --git a/packages/plugins/IconMenu/src/language.ts b/packages/plugins/IconMenu/src/language.ts deleted file mode 100644 index ab05cd28d..000000000 --- a/packages/plugins/IconMenu/src/language.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { LanguageOption } from '@polar/lib-custom-types' - -const language: LanguageOption[] = [ - { - type: 'de', - resources: { - plugins: { - iconMenu: { - mobileCloseButton: '{{plugin}} schließen', - hints: { - attributions: 'Quellennachweis', - draw: 'Zeichenwerkzeuge', - filter: 'Filter', - layerChooser: 'Kartenauswahl', - gfi: 'Objektliste', - }, - }, - }, - }, - }, - { - type: 'en', - resources: { - plugins: { - iconMenu: { - mobileCloseButton: 'Close {{plugin}}', - hints: { - attributions: 'Attributions', - draw: 'Draw tools', - filter: 'Filter', - layerChooser: 'Choose map', - gfi: 'Feature list', - }, - }, - }, - }, - }, -] - -export default language diff --git a/packages/plugins/IconMenu/src/locales.ts b/packages/plugins/IconMenu/src/locales.ts new file mode 100644 index 000000000..4a3496a20 --- /dev/null +++ b/packages/plugins/IconMenu/src/locales.ts @@ -0,0 +1,44 @@ +import { Locale } from '@polar/lib-custom-types' + +export const resourcesDe = { + plugins: { + iconMenu: { + mobileCloseButton: '{{plugin}} schließen', + hints: { + attributions: 'Quellennachweis', + draw: 'Zeichenwerkzeuge', + filter: 'Filter', + layerChooser: 'Kartenauswahl', + gfi: 'Objektliste', + }, + }, + }, +} as const + +export const resourcesEn = { + plugins: { + iconMenu: { + mobileCloseButton: 'Close {{plugin}}', + hints: { + attributions: 'Attributions', + draw: 'Draw tools', + filter: 'Filter', + layerChooser: 'Choose map', + gfi: 'Feature list', + }, + }, + }, +} as const + +const locales: Locale[] = [ + { + type: 'de', + resources: resourcesDe, + }, + { + type: 'en', + resources: resourcesEn, + }, +] + +export default locales diff --git a/packages/plugins/IconMenu/src/store/index.ts b/packages/plugins/IconMenu/src/store/index.ts index cf9ab2dd3..e5b8e1427 100644 --- a/packages/plugins/IconMenu/src/store/index.ts +++ b/packages/plugins/IconMenu/src/store/index.ts @@ -75,7 +75,7 @@ export const makeStoreModule = () => { 'setMoveHandle', { closeLabel: t('plugins.iconMenu.mobileCloseButton', { - plugin: hint || `common:plugins.iconMenu.hints.${id}`, + plugin: hint || `plugins.iconMenu.hints.${id}`, }), closeFunction: () => commit('setOpen', null), component: plugin, diff --git a/packages/plugins/IconMenu/tsconfig.json b/packages/plugins/IconMenu/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/plugins/IconMenu/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/plugins/LayerChooser/src/components/LayerWrapper.vue b/packages/plugins/LayerChooser/src/components/LayerWrapper.vue index e5cb7c5db..eb5159437 100644 --- a/packages/plugins/LayerChooser/src/components/LayerWrapper.vue +++ b/packages/plugins/LayerChooser/src/components/LayerWrapper.vue @@ -9,7 +9,7 @@ - {{ $t('common:plugins.layerChooser.tooltipDisabledLayer') }} + {{ $t('plugins.layerChooser.tooltipDisabledLayer') }} diff --git a/packages/plugins/LayerChooser/src/components/Options.vue b/packages/plugins/LayerChooser/src/components/Options.vue index 39a485098..732ec3259 100644 --- a/packages/plugins/LayerChooser/src/components/Options.vue +++ b/packages/plugins/LayerChooser/src/components/Options.vue @@ -4,20 +4,20 @@ fa-chevron-left {{ - $t('common:plugins.layerChooser.optionsHeader', openedOptionsService) + $t('plugins.layerChooser.optionsHeader', openedOptionsService) }}