Skip to content

Commit

Permalink
feat: support cache by language
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Mar 19, 2023
1 parent d18ca4a commit 4fb4c5a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
24 changes: 12 additions & 12 deletions utils/constants/language.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export const PROMPT_LANGUAGE_MAP: { [key: string]: string } = {
English: 'UK English',
中文: 'Simplified Chinese',
繁體中文: 'Traditional Chinese',
日本語: 'Japanese',
Italiano: 'Italian',
Deutsch: 'German',
Español: 'Spanish',
Français: 'French',
Nederlands: 'Dutch',
한국어: 'Korean',
ភាសាខ្មែរ: 'Khmer',
हिंदी: 'Hindi',
English: 'en-US',
中文: 'zh-CN',
繁體中文: 'zh-TW',
日本語: 'ja-JP',
Italiano: 'it-IT',
Deutsch: 'de-DE',
Español: 'es-ES',
Français: 'fr-FR',
Nederlands: 'nl-NL',
한국어: 'ko-KR',
ភាសាខ្មែរ: 'km-KH',
हिंदी: 'hi-IN',
}
5 changes: 3 additions & 2 deletions utils/getCacheId.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { VideoConfig } from '~/lib/types'

export function getCacheId({ showTimestamp, videoId, detailLevel }: VideoConfig) {
return showTimestamp ? `timestamp-${videoId}-${detailLevel}` : `${videoId}-${detailLevel}`
export function getCacheId({ showTimestamp, videoId, outputLanguage, detailLevel }: VideoConfig) {
const prefix = showTimestamp ? 'timestamp-' : ''
return `${prefix}${videoId}-${outputLanguage}-${detailLevel}`
}

0 comments on commit 4fb4c5a

Please sign in to comment.