Skip to content

Commit

Permalink
fix(i18n): update i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
ThornWalli committed Nov 4, 2024
1 parent d3373dc commit 5799fc5
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 171 deletions.
360 changes: 217 additions & 143 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@fullhuman/postcss-purgecss": "6.0.0",
"@js-basics/vector": "2.1.0",
"@nuxt/content": "2.13.4",
"@nuxtjs/i18n": "8.5.6",
"@nuxtjs/i18n": "^9.0.0",
"@nuxtjs/seo": "2.0.0-rc.23",
"@pinia/nuxt": "0.7.0",
"lost": "9.0.2",
Expand Down
48 changes: 23 additions & 25 deletions src/components/fragment/LanguageSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,38 @@
:to="switchLocalePath(language.code)"
class="language-switch"
:title="language.code"
>{{ language.code }}
>
{{ language.code }}
</site-link>
</li>
</fragment-link-list>
</template>

<script>
<script setup>
import FragmentLinkList from '@/components/fragment/LinkList';
import { useSwitchLocalePath, useI18n } from '#imports';
import { computed } from 'vue';
const switchLocalePath = useSwitchLocalePath();
const { locales, locale: currentLocale } = useI18n();
export default {
components: {
FragmentLinkList
},
props: {
filterCurrentLang: {
type: Boolean,
required: false,
default() {
return false;
}
}
},
computed: {
languages() {
return this.$i18n.locales.filter(locale => {
return (
!this.filterCurrentLang ||
(this.filterCurrentLang && locale.code !== this.$i18n.locale)
);
});
const $props = defineProps({
filterCurrentLang: {
type: Boolean,
required: false,
default() {
return false;
}
}
};
});
const languages = computed(() => {
return locales.value.filter(locale => {
return (
!$props.filterCurrentLang ||
($props.filterCurrentLang && locale.code !== currentLocale.value)
);
});
});
</script>

<style lang="postcss" scoped>
Expand Down
4 changes: 3 additions & 1 deletion src/components/fragment/LinkList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import { useBoosterFonts, useLocalePath } from '#imports';
import { computed } from 'vue';
const localePath = useLocalePath();
const { $getFont } = useBoosterFonts();
const props = defineProps({
Expand Down
3 changes: 3 additions & 0 deletions src/components/module/TextImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

<script setup>
import BoosterPicture from '#booster/components/BoosterPicture';
import { useLocalePath } from '#imports';
const localePath = useLocalePath();
defineProps({
mirror: {
Expand Down
2 changes: 2 additions & 0 deletions src/components/page/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
<script setup>
import { useLayoutStore } from '@/stores/layout';
import { computed } from 'vue';
import { useLocalePath } from '#imports';
const layoutStore = useLayoutStore();
const localePath = useLocalePath();
const props = defineProps({
sticky: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/page/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@

<script setup>
import { useModalStore } from '@/stores/layout';
import { useRoute } from '#imports';
import { useRoute, useLocalePath } from '#imports';
import { computed, watch } from 'vue';
const modalStore = useModalStore();
const localePath = useLocalePath();
const $route = useRoute();
Expand Down

0 comments on commit 5799fc5

Please sign in to comment.