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

chore: debug i18n #161

Merged
merged 1 commit into from
Feb 8, 2022
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
2 changes: 0 additions & 2 deletions locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ contacts:
website: Website
save: Save
add: Add
cancel: Cancel
teaser:
partner:
title: Need a partner?
Expand Down Expand Up @@ -523,4 +522,3 @@ EventDashboard:
subscribed: Subscribed
paid: Paid
notPaid: Didn't Pay

34 changes: 20 additions & 14 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ export const app = {
cover: '/cover/wide.png',
}

const locales = [
{ code: 'en', name: 'English', file: 'en.yml' },
{ code: 'es', name: 'Español', file: 'es.yml' },
{ code: 'de', name: 'Deutsch', file: 'de.yml' },
{ code: 'fr', name: 'Français', file: 'fr.yml' },
{ code: 'it', name: 'Italiano', file: 'it.yml' },
{ code: 'pl', name: 'Polski', file: 'pl.yml' },
{ code: 'pt', name: 'Português', file: 'pt.yml' },
{ code: 'ro', name: 'Română', file: 'ro.yml' },
{ code: 'tr', name: 'Türkçe', file: 'tr.yml' },
{ code: 'ru', name: 'Русский', file: 'ru.yml' },
{ code: 'sr', name: 'Српски', file: 'sr.yml' },
]

if (process.env.DEBUG_I18N) {
locales.push({ code: 'debug', name: 'DEBUG', file: 'debug.yml' })
}

export default {
target: 'static',
ssr: false,
Expand Down Expand Up @@ -196,25 +214,13 @@ export default {
routes: ['/'],
},
i18n: {
locales: [
{ code: 'en', name: 'English', file: 'en.yml' },
{ code: 'es', name: 'Español', file: 'es.yml' },
{ code: 'de', name: 'Deutsch', file: 'de.yml' },
{ code: 'fr', name: 'Français', file: 'fr.yml' },
{ code: 'it', name: 'Italiano', file: 'it.yml' },
{ code: 'pl', name: 'Polski', file: 'pl.yml' },
{ code: 'pt', name: 'Português', file: 'pt.yml' },
{ code: 'ro', name: 'Română', file: 'ro.yml' },
{ code: 'tr', name: 'Türkçe', file: 'tr.yml' },
{ code: 'ru', name: 'Русский', file: 'ru.yml' },
{ code: 'sr', name: 'Српски', file: 'sr.yml' },
],
locales,
defaultLocale: 'en',
strategy: 'no_prefix',
lazy: true,
langDir: 'locales/',
vueI18n: {
fallbackLocale: 'en',
fallbackLocale: process.env.DEBUG_I18N ? 'debug' : 'en',
},
detectBrowserLanguage: {
useCookie: true,
Expand Down