- {{ $t('common:plugins.geometrySearch.draw.title') }}
+ {{ $t('plugins.geometrySearch.draw.title') }}
@@ -27,7 +27,7 @@
dismissible
elevation="4"
>{{
- $t(`common:plugins.geometrySearch.draw.description.${_drawMode}`)
+ $t(`plugins.geometrySearch.draw.description.${_drawMode}`)
}}
diff --git a/packages/clients/textLocator/src/plugins/GeometrySearch/components/GeometrySearch.vue b/packages/clients/textLocator/src/plugins/GeometrySearch/components/GeometrySearch.vue
index c7e779fc6..552beb98c 100644
--- a/packages/clients/textLocator/src/plugins/GeometrySearch/components/GeometrySearch.vue
+++ b/packages/clients/textLocator/src/plugins/GeometrySearch/components/GeometrySearch.vue
@@ -2,13 +2,13 @@
- {{ $t('common:plugins.geometrySearch.results.title') }}
+ {{ $t('plugins.geometrySearch.results.title') }}
{{
- $t('common:plugins.geometrySearch.results.source', {
+ $t('plugins.geometrySearch.results.source', {
searchType: $t(
- `common:plugins.geometrySearch.results.sourceOptions.${lastSearch}`
+ `plugins.geometrySearch.results.sourceOptions.${lastSearch}`
),
})
}}
@@ -17,7 +17,7 @@
- {{ $t('common:plugins.geometrySearch.results.none') }}
+ {{ $t('plugins.geometrySearch.results.none') }}
diff --git a/packages/clients/textLocator/src/plugins/GeometrySearch/components/ViewToggle.vue b/packages/clients/textLocator/src/plugins/GeometrySearch/components/ViewToggle.vue
index 791d3c984..4950992ee 100644
--- a/packages/clients/textLocator/src/plugins/GeometrySearch/components/ViewToggle.vue
+++ b/packages/clients/textLocator/src/plugins/GeometrySearch/components/ViewToggle.vue
@@ -2,11 +2,11 @@
fa-book-open
- {{ $t('common:plugins.geometrySearch.results.byText') }}
+ {{ $t('plugins.geometrySearch.results.byText') }}
fa-location-pin
- {{ $t('common:plugins.geometrySearch.results.byLocation') }}
+ {{ $t('plugins.geometrySearch.results.byLocation') }}
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 @@
- {{ $t('common:overlay.oneFingerPan') }}
+ {{ $t('overlay.oneFingerPan') }}
@@ -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)}${element}>`
)
.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 @@