Skip to content

Commit

Permalink
update i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
diegopf committed Aug 25, 2024
1 parent c737500 commit 72d480c
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/i18n/messages/de.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"viewResults": "Alle anzeigen"
},
"priceFilter": {
"lessThan": "weniger als {max}",
"fromTo": "{min} - {max}",
"from": "ab {min}"
"lessThan": "weniger als {'{max}'}",
"fromTo": "{'{min}'} - {'{max}'}",
"from": "ab {'{min}'}"
},
"toggleAside": {
"showAside": "Sortieren & Filtern"
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/messages/en.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"viewResults": "View all"
},
"priceFilter": {
"lessThan": "less than {max}",
"fromTo": "{min} - {max}",
"from": "from {min}"
"lessThan": "less than {'{max}'}",
"fromTo": "{'{min}'} - {'{max}'}",
"from": "from {'{min}'}"
},
"toggleAside": {
"showAside": "Sort & Filter"
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/messages/es.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"viewResults": "Ver todos los resultados"
},
"priceFilter": {
"lessThan": "hasta {max}",
"fromTo": "{min} - {max}",
"from": "desde {min}"
"lessThan": "hasta {'{max}'}",
"fromTo": "{'{min}'} - {'{max}'}",
"from": "desde {'{min}'}"
},
"toggleAside": {
"showAside": "Ordenar y Filtrar"
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/messages/fr.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"viewResults": "Afficher tous les résultats"
},
"priceFilter": {
"lessThan": "moins de {max}",
"fromTo": "{min} - {max}",
"from": "à partir de {min}"
"lessThan": "moins de {'{max}'}",
"fromTo": "{'{min}'} - {'{max}'}",
"from": "à partir de {'{min}'}"
},
"toggleAside": {
"showAside": "Trier et filtrer"
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/messages/it.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"viewResults": "Mostra tutti i risultati"
},
"priceFilter": {
"lessThan": "meno di {max}",
"fromTo": "{min} - {max}",
"from": "da {min}"
"lessThan": "meno di {'{max}'}",
"fromTo": "{'{min}'} - {'{max}'}",
"from": "da {'{min}'}"
},
"toggleAside": {
"showAside": "Ordina & Filtra"
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/messages/pt.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"viewResults": "Ver todos"
},
"priceFilter": {
"lessThan": "Até {max}",
"fromTo": "{min} - {max}",
"from": "Mais de {min}"
"lessThan": "Até {'{max}'}",
"fromTo": "{'{min}'} - {'{max}'}",
"from": "Mais de {'{min}'}"
},
"toggleAside": {
"showAside": "Ordenar e Filtrar"
Expand Down
14 changes: 8 additions & 6 deletions src/x-components/plugin.options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { App as Application } from 'vue';
import { filter, InstallXOptions, SnippetConfig } from '@empathyco/x-components';
import { I18n, cssInjector } from '@empathyco/x-archetype-utils';
import { cssInjector } from '@empathyco/x-archetype-utils';
import { setSearchQuery } from '@empathyco/x-components/search';
import { addQueryToHistoryQueries } from '@empathyco/x-components/history-queries';
import { setUrlQuery } from '@empathyco/x-components/url';
Expand All @@ -9,6 +10,7 @@ import store from '../store';
import { adapter } from '../adapter/adapter';
import { useDevice } from '../composables/use-device.composable';
import { mergeSemanticQueriesConfigWire } from './wiring/semantic-queries.wiring';
import { I18n } from './i18n.plugin';

const device = useDevice();

Expand Down Expand Up @@ -54,7 +56,7 @@ export async function getInstallXOptions(): Promise<InstallXOptions> {
return {
adapter,
store,
app: App,
rootComponent: App,
domElement: getDomElement,
xModules: {
facets: {
Expand Down Expand Up @@ -95,16 +97,16 @@ export async function getInstallXOptions(): Promise<InstallXOptions> {
}
}
},
async installExtraPlugins({ vue, snippet }) {
async installExtraPlugins({ app, snippet }) {
const i18n = await I18n.create({
locale: snippet.uiLang,
device: (snippet.device as string) ?? device.deviceName.value,
fallbackLocale: 'en',
messages
});
vue.use(i18n);
vue.prototype.$setLocale = i18n.setLocale.bind(i18n);
vue.prototype.$setLocaleDevice = i18n.setDevice.bind(i18n);
(app as Application<typeof App>).use(i18n);
app.config.globalProperties.$setLocale = i18n.setLocale.bind(i18n);
app.config.globalProperties.$setLocaleDevice = i18n.setDevice.bind(i18n);

return {
i18n: i18n.vueI18n
Expand Down
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export const vueDocsPlugin = {
};

export default defineConfig({
define: {
'process.env': {}
},
plugins: [injectHTML(), vue(), vueDocsPlugin, Inspector()],
server: {
port: 8080
Expand Down

0 comments on commit 72d480c

Please sign in to comment.