refactor: 다국어 처리 개선 및 코드 정리
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</li>
|
||||
<li class="relative">
|
||||
<button class="text-[15px] text-white/50 hover:text-gray-600 transition-colors" @click="toggleAgeRating">
|
||||
{{ tm('Footer_AgeRating') }}
|
||||
<em v-dompurify-html="tm('Footer_AgeRating')"></em>
|
||||
</button>
|
||||
<div v-if="showAgeRating" class="game-rating-card absolute bottom-6 left-1 md:left-1/2 md:-translate-x-1/2 bg-[#383838] rounded-lg border border-white/30 w-[340px] mx-auto z-10">
|
||||
<!-- 헤더 -->
|
||||
@@ -101,7 +101,7 @@
|
||||
</div>
|
||||
|
||||
<div class="copyright-area mt-6 text-[13px] text-white/50 md:mt-4">
|
||||
<span>{{ tm('Footer_Copyright') }}</span>
|
||||
<span v-dompurify-html="tm('Footer_Copyright')"></span>
|
||||
</div>
|
||||
|
||||
<div class="logo-area flex mt-6 md:mt-6">
|
||||
|
||||
@@ -70,6 +70,7 @@ const cache = new LRUCache({
|
||||
* @param baseDomain - 기본 도메인
|
||||
*/
|
||||
function setFinalLocaleCookie(event: any, finalLocale: string, baseDomain: string) {
|
||||
console.log("🚀 ~ 구어 구어 setFinalLocaleCookie:============", finalLocale)
|
||||
setCookie(event, 'LOCALE', finalLocale.toUpperCase(), {
|
||||
domain: baseDomain,
|
||||
path: '/',
|
||||
@@ -211,10 +212,7 @@ export default defineEventHandler(async event => {
|
||||
|
||||
// 캐시 키 생성
|
||||
const cacheKey = 'inspection'
|
||||
// console.log("🚀 11111 ~ cacheKey:", cacheKey)
|
||||
|
||||
|
||||
// gameData를 직접 가져와서 context에 저장 (API 호출 없이)
|
||||
try {
|
||||
|
||||
// 2. 언어 코드 추출
|
||||
|
||||
@@ -86,7 +86,7 @@ export const csrGetFinalLocale = (path = '', coveragesLocales: string[]) => {
|
||||
* @param {any} headers - 요청 헤더
|
||||
*/
|
||||
export const ssrGetFinalLocale = (path = '', headers: any, coveragesLocales: string[], defaultLocale: string) => {
|
||||
let finalLocale = defaultLocale || DEFAULT_LOCALE_CODE // 기본값 설정
|
||||
let finalLocale // 기본값 설정
|
||||
try {
|
||||
// coveragesLocales가 빈 배열이거나 유효하지 않은 경우 기본 언어 반환
|
||||
if (!coveragesLocales || !Array.isArray(coveragesLocales) || coveragesLocales.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user