diff --git a/packages/cv-wrapper/src/App.vue b/packages/cv-wrapper/src/App.vue
index ba937b3..ac1e601 100644
--- a/packages/cv-wrapper/src/App.vue
+++ b/packages/cv-wrapper/src/App.vue
@@ -1,7 +1,7 @@
Tobias Stadler - {{ t('TheMenubar.cv') }}
++ {{ t('static.TheMenubar.title') }} +
@@ -38,7 +40,7 @@ import { useI18n } from 'vue-i18n'; import profilePicture from '@/assets/images/profile_picture.png'; - import menuLinks from '@/data/menuLinks'; + import menuLinks from '@/helpers/menuLinks'; const { t } = useI18n(); diff --git a/packages/cv-wrapper/src/data/menuLinks.ts b/packages/cv-wrapper/src/data/menuLinks.ts deleted file mode 100644 index 732e021..0000000 --- a/packages/cv-wrapper/src/data/menuLinks.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { PrimeIcons } from 'primevue/api'; - -import type { MenuItem } from 'primevue/menuitem'; - -const menuLinks: MenuItem[] = [ - { - icon: PrimeIcons.CODE, - key: 'website', - label: 'My projects', - url: 'https://devtobi.de', - color: 'primary', - }, - { - icon: PrimeIcons.GITHUB, - key: 'github', - label: 'GitHub (@devtobi)', - url: 'https://github.com/devtobi', - color: 'contrast', - }, - { - icon: PrimeIcons.LINKEDIN, - key: 'linkedin', - label: 'LinkedIn', - url: 'https://www.linkedin.com/in/tobias-stadler/', - color: 'info', - }, -]; - -export default menuLinks; diff --git a/packages/cv-wrapper/src/helpers/menuLinks.ts b/packages/cv-wrapper/src/helpers/menuLinks.ts new file mode 100644 index 0000000..c4b5e49 --- /dev/null +++ b/packages/cv-wrapper/src/helpers/menuLinks.ts @@ -0,0 +1,33 @@ +import { PrimeIcons } from 'primevue/api'; + +import type { MenuItem } from 'primevue/menuitem'; + +import i18n from '@/plugins/i18n'; + +const t = i18n.global.t; + +const menuLinks: MenuItem[] = [ + { + icon: PrimeIcons.CODE, + key: 'projects', + label: t('TheMenubar.links.projects.label'), + url: t('static.TheMenubar.links.projects.url'), + color: 'primary', + }, + { + icon: PrimeIcons.GITHUB, + key: 'github', + label: t('static.TheMenubar.links.github.label'), + url: t('static.TheMenubar.links.github.url'), + color: 'contrast', + }, + { + icon: PrimeIcons.LINKEDIN, + key: 'linkedin', + label: t('static.TheMenubar.links.linkedin.label'), + url: t('static.TheMenubar.links.linkedin.url'), + color: 'info', + }, +]; + +export default menuLinks; diff --git a/packages/cv-wrapper/src/locales/de.json b/packages/cv-wrapper/src/locales/de.json new file mode 100644 index 0000000..5a632b9 --- /dev/null +++ b/packages/cv-wrapper/src/locales/de.json @@ -0,0 +1,36 @@ +{ + "static": { + "authorName": "Tobias Stadler", + "githubName": "devtobi", + "TheMenubar": { + "title": "@:static.authorName - @:TheMenubar.cv", + "profilePictureAlt": "@:TheMenubar.profilePictureAltPrefix @:static.authorName", + "links": { + "projects": { + "url": "https://devtobi.de" + }, + "github": { + "label": "GitHub ({'@'}@:static.githubName)", + "url": "https://github.com/@:static.githubName" + }, + "linkedin": { + "label": "LinkedIn", + "url": "https://www.linkedin.com/in/tobias-stadler/" + } + } + }, + "TheFooter": { + "copyright": "© {0} @:static.authorName ({'@'}@:static.githubName)" + } + }, + "TheMenubar": { + "profilePictureAltPrefix": "Profilbild von", + "newFeaturesSoon": "Neue Funktionen werden bald hinzugefügt!", + "cv": "Lebenslauf", + "links": { + "projects": { + "label": "Meine Projekte" + } + } + } +} diff --git a/packages/cv-wrapper/src/locales/en.json b/packages/cv-wrapper/src/locales/en.json index f83d21c..f080579 100644 --- a/packages/cv-wrapper/src/locales/en.json +++ b/packages/cv-wrapper/src/locales/en.json @@ -1,7 +1,36 @@ { + "static": { + "authorName": "Tobias Stadler", + "githubName": "devtobi", + "TheMenubar": { + "title": "@:static.authorName - @:TheMenubar.cv", + "profilePictureAlt": "@:TheMenubar.profilePictureAltPrefix @:static.authorName", + "links": { + "projects": { + "url": "https://devtobi.de" + }, + "github": { + "label": "GitHub ({'@'}@:static.githubName)", + "url": "https://github.com/@:static.githubName" + }, + "linkedin": { + "label": "LinkedIn", + "url": "https://www.linkedin.com/in/tobias-stadler/" + } + } + }, + "TheFooter": { + "copyright": "© {0} @:static.authorName ({'@'}@:static.githubName)" + } + }, "TheMenubar": { - "profilePictureAltText": "Profile picture of Tobias Stadler", + "profilePictureAltPrefix": "Profile picture of", "newFeaturesSoon": "New features will be added soon!", - "cv": "Curriculum Vitae" + "cv": "Curriculum Vitae", + "links": { + "projects": { + "label": "My projects" + } + } } } diff --git a/packages/cv-wrapper/src/plugins/i18n.ts b/packages/cv-wrapper/src/plugins/i18n.ts index 56167b2..16b0612 100644 --- a/packages/cv-wrapper/src/plugins/i18n.ts +++ b/packages/cv-wrapper/src/plugins/i18n.ts @@ -1,5 +1,6 @@ import { createI18n } from 'vue-i18n'; +import de from '@/locales/de.json'; import en from '@/locales/en.json'; export const supportedLocales = ['en']; @@ -12,10 +13,12 @@ type MessageSchema = typeof en; const i18n = createI18n<[MessageSchema], SupportedLocale>({ legacy: false, - locale: defaultLocale, + locale: 'de', fallbackLocale: defaultLocale, + formatFallbackMessages: true, messages: { en: Object.assign(en), + de: Object.assign(de), }, }); export default i18n;