Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(i18n): update i18n #1513

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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