Skip to content

Commit

Permalink
Merge pull request #1485 from GrabarzUndPartner/feature/update
Browse files Browse the repository at this point in the history
fix(update): added i18n
  • Loading branch information
ThornWalli authored Aug 5, 2024
2 parents 76d1e1e + c19f681 commit c626d0e
Show file tree
Hide file tree
Showing 78 changed files with 1,590 additions and 755 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# NUXT_PUBLIC_SITE_URL=
# BASE_URL=
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
touch dist/.nojekyll
env:
BASE_URL: /gp-vue-boilerplate/
WEBSITE_HOST: https://grabarzundpartner.github.io/gp-vue-boilerplate
NUXT_PUBLIC_SITE_URL: https://grabarzundpartner.github.io
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ jobs:

- name: Test
run: npm run test
env:
BASE_URL: /gp-vue-boilerplate/
NUXT_PUBLIC_SITE_URL: https://grabarzundpartner.github.io
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ export default withNuxt({
'vue/multi-word-component-names': 'off'
}
}).prepend(pluginSecurity.configs.recommended, eslintPluginPrettierRecommended);
// .remove('nuxt/import-globals');
12 changes: 12 additions & 0 deletions i18n.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { i18nMessageDe, i18nMessageEn } from './src/globals/locales';

export const DEFAULT_LOCALE = 'en';

export default {
legacy: false,
locale: DEFAULT_LOCALE,
messages: {
en: i18nMessageEn,
de: i18nMessageDe
}
};
54 changes: 43 additions & 11 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import path from 'pathe';
import { defineNuxtConfig } from 'nuxt/config';
import svgLoader from 'vite-svg-loader';
import * as postcssFunctions from './src/globals/postcss/functions';
import { DEFAULT_LOCALE } from './i18n.config';

const isDev = process.env.NODE_ENV === 'development';

Expand All @@ -14,10 +15,17 @@ export default defineNuxtConfig(() => {

css: ['@/assets/css/vars.css'],

compatibilityDate: '2024-08-01',

devtools: { enabled: false },

imports: {
autoImport: false
},

site: {
indexable: false,
trailingSlash: true,
url: getWebsiteHost()
trailingSlash: true
},

app: {
Expand Down Expand Up @@ -121,6 +129,29 @@ export default defineNuxtConfig(() => {
order: 'cssnanoLast'
},

generate: {
routes: ['/', '/de']
},

i18n: {
locales: [
{
code: 'de',
iso: 'de-DE'
},
{
code: 'en',
iso: 'en-EN'
}
],
detectBrowserLanguage: {
useCookie: false
},
defaultLocale: DEFAULT_LOCALE,
strategy: 'prefix_except_default',
vueI18n: './i18n.config.js'
},

image: {
// The screen sizes predefined by `@nuxt/image`:
screens: {
Expand Down Expand Up @@ -260,24 +291,25 @@ export default defineNuxtConfig(() => {
'@nuxtjs/seo',
'@nuxt/content',
'@pinia/nuxt',
'@nuxtjs/i18n',
'nuxt-booster'
],

buildModules: [
'@nuxtjs/dotenv',
...(isDev ? ['@nuxtjs/eslint-module', '@nuxtjs/stylelint-module'] : [])
]
],

schemaOrg: {
enabled: false
},

linkChecker: {
failOnError: false
}
};
});

function getWebsiteHost() {
return (
process.env.npm_config_website_host ||
process.env.WEBSITE_HOST ||
'http://localhost:8050'
);
}

function getBaseUrl() {
return process.env.npm_config_base_url || process.env.BASE_URL || '/';
}
Expand Down
Loading

0 comments on commit c626d0e

Please sign in to comment.