-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from dreammall-earth/208-feat-page-title-tran…
…slate feat(presenter): translate page title with i18n
- Loading branch information
Showing
20 changed files
with
70 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { PageContext } from 'vike/types' | ||
|
||
import { META } from '#src/env' | ||
import i18n from '#plugins/i18n' | ||
|
||
function getTitle(pageContext: PageContext) { | ||
// The value exported by /pages/**/+title.js is available at pageContext.config.title | ||
const val = pageContext.config.title | ||
if (typeof val === 'string') return val | ||
if (typeof val === 'function') return String(val(pageContext)) | ||
return META.DEFAULT_TITLE | ||
return i18n.global.t('meta.defaultTitle') | ||
} | ||
function getDescription(pageContext: PageContext) { | ||
const val = pageContext.config.description | ||
if (typeof val === 'string') return val | ||
if (typeof val === 'function') return val(pageContext) | ||
return META.DEFAULT_DESCRIPTION | ||
return i18n.global.t('meta.defaultDescription') | ||
} | ||
|
||
export { getTitle, getDescription } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const title = 'DreamMall | Fehler' | ||
import i18n from '#plugins/i18n' | ||
|
||
export const title = () => i18n.global.t('error.title') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const title = 'DreamMall | Authentifizierung' | ||
import i18n from '#plugins/i18n' | ||
|
||
export const title = () => i18n.global.t('auth.title') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const title = 'DreamMall | Datenschutz' | ||
import i18n from '#plugins/i18n' | ||
|
||
export const title = () => i18n.global.t('dataProtection.title') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const title = 'DreamMall | Impressum' | ||
import i18n from '#plugins/i18n' | ||
|
||
export const title = () => i18n.global.t('impress.title') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { META } from '#src/env' | ||
import i18n from '#plugins/i18n' | ||
|
||
export const title = META.DEFAULT_TITLE | ||
export const title = () => i18n.global.t('meta.defaultTitle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export const title = 'DreamMall | Newsletter' | ||
import i18n from '#plugins/i18n' | ||
|
||
// 'DreamMall | Newsletter' | ||
export const title = () => i18n.global.t('optin.title') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const title = 'DreamMall | Authentifizierung' | ||
import i18n from '#plugins/i18n' | ||
|
||
export const title = () => i18n.global.t('auth.title') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters