Skip to content

Commit

Permalink
Adding French
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-Zhixing committed Aug 22, 2023
1 parent 60ef40d commit c133730
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/locale/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import * as csCZ from './cs-CZ/index.js'
import * as koKR from './ko-KR/index.js'
import * as deDE from './de-DE/index.js'
import * as huHU from './hu-HU/index.js'
import * as frFR from './fr-FR/index.js'


const locale = {
'zh-CN': zhCN,
Expand All @@ -28,5 +30,6 @@ const locale = {
'es-ES': esES,
'hu-HU': huHU,
'de-DE': deDE,
'fr-FR': frFR,
}
export default locale
4 changes: 3 additions & 1 deletion src/plugins/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vue from 'vue'
import VueI18n from 'vue-i18n'
import { formatDistanceToNow, parseISO, formatRelative } from 'date-fns'
import { pick } from 'accept-language-parser'
import { enUS, zhCN, zhTW, ptBR, th, vi, ja, es, id, cs, de, hu, ko } from 'date-fns/locale'
import { enUS, zhCN, zhTW, ptBR, th, vi, ja, es, id, cs, de, hu, ko, fr } from 'date-fns/locale'
import locales from '@/locale'

export const supportedLanguages = [
Expand All @@ -20,6 +20,7 @@ export const supportedLanguages = [
'id-ID',
'cs-CZ',
'hu-HU',
'fr-FR'
]

export const dateLocales = Object.freeze({
Expand All @@ -37,6 +38,7 @@ export const dateLocales = Object.freeze({
'ko-KR': ko,
'de-DE': de,
'hu-HU': hu,
'fr-FR': fr
})

export function pickLanguage (headerStr) {
Expand Down

0 comments on commit c133730

Please sign in to comment.