diff --git a/locales/de.json b/locales/de.json new file mode 100644 index 0000000..cabf3d3 --- /dev/null +++ b/locales/de.json @@ -0,0 +1,8 @@ +{ + "nuxt-bundle": { + "license-information": { + "description": "Diese Webseite basiert auf Free Open Source Software (FOSS), die gesonderten Lizenzbedingungen unterliegen, die im folgenden aufgelistet werden.", + "title": "Lizenzinformationen" + } + } +} diff --git a/locales/en.json b/locales/en.json new file mode 100644 index 0000000..beb158e --- /dev/null +++ b/locales/en.json @@ -0,0 +1,8 @@ +{ + "nuxt-bundle": { + "license-information": { + "description": "This website is based on Free Open Source Software (FOSS), which is subject to separate license conditions, which are listed below.", + "title": "License information" + } + } +} diff --git a/nuxt.config.ts b/nuxt.config.ts index 29fb6de..b11be8c 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -3,6 +3,20 @@ import chalk from "chalk"; import vuetify from "vite-plugin-vuetify"; import license from "rollup-plugin-license"; +/** + * Returns all locales with their corresponding file names from `./locales`. + */ +export function getLocales(): { code: string; file: string }[] { + const files = fs.readdirSync("./locales"); + + return files.map((file) => { + return { + code: file.split(".")[0], + file, + }; + }); +} + export default defineNuxtConfig({ app: { pageTransition: { name: "page", mode: "out-in" }, @@ -50,7 +64,18 @@ export default defineNuxtConfig({ }, }, css: ["vuetify/styles"], - modules: ["@nuxt/image", "@nuxtjs/i18n", "@nuxtjs/robots"], + modules: [ + "@crystal-creations/crystal-components/nuxt", + "@nuxt/image", + [ + "@nuxtjs/i18n", + { + locales: getLocales(), + langDir: "locales", + }, + ], + "@nuxtjs/robots", + ], hooks: { "nitro:build:before": () => { const fontsDir = "public/assets/fonts/"; @@ -61,7 +86,6 @@ export default defineNuxtConfig({ console.log(chalk.green("√"), "Copied fonts to " + fontsDir); }, }, - i18n: {}, vite: { define: { "process.env.DEBUG": "false", diff --git a/package.json b/package.json index 4421a20..7289ec5 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,15 @@ "semantic-release": "semantic-release" }, "files": [ + "locales", + "pages", "nuxt.config.ts", "package.json", "README.md" ], "main": "nuxt.config.ts", "dependencies": { + "@crystal-creations/crystal-components": "^1.0.0-beta.1", "@fontsource/roboto": "5.0.8", "@mdi/js": "7.4.47", "@nuxt/image": "1.2.0", diff --git a/pages/license-information.vue b/pages/license-information.vue new file mode 100644 index 0000000..7da081a --- /dev/null +++ b/pages/license-information.vue @@ -0,0 +1,100 @@ + + + + +