Merge commit '923e524b62af637fca05119959d4b5f579e6b6fe' into feature/20250910-all

This commit is contained in:
clkim
2025-09-16 13:06:40 +09:00
67 changed files with 2705 additions and 1381 deletions

View File

@@ -1,24 +1,30 @@
export default defineNuxtPlugin(() => {
const { $i18n } = useNuxtApp()
const gameDataStore = useGameDataStore()
// gameData가 로드되면 언어 제외 설정 적용
watchEffect(() => {
const gameData = gameDataStore.gameData
if (gameData && gameData.lang_codes && gameData.lang_codes.length > 0) {
const allowedLangCodes = gameData.lang_codes
// 현재 설정된 locales에서 허용된 언어만 필터링
const availableLocales = $i18n.locales.value.filter((locale: any) =>
const availableLocales = $i18n.locales.value.filter((locale: any) =>
allowedLangCodes.includes(locale.code)
)
// locales 업데이트
$i18n.locales.value = availableLocales
// 에러로 인해 주석처리
// $i18n.locales.value = availableLocales
// 현재 locale이 허용되지 않은 경우 기본 locale로 변경
if (!allowedLangCodes.includes($i18n.locale.value)) {
$i18n.locale.value = gameData.default_lang_code || 'ko'
const defaultLang = allowedLangCodes.includes(
gameData.default_lang_code
)
? gameData.default_lang_code
: 'ko'
$i18n.locale.value = defaultLang as any
}
}
})

View File

@@ -1,22 +1,27 @@
export default defineNuxtPlugin(() => {
const { $i18n } = useNuxtApp()
// SSR에서 gameData를 가져와서 언어 제외 설정 적용
const gameDataFromServer = process.server
const gameDataFromServer = import.meta.server
? useNuxtApp().ssrContext?.event.context.gameData
: null
if (gameDataFromServer && gameDataFromServer.lang_codes && gameDataFromServer.lang_codes.length > 0) {
if (
gameDataFromServer &&
gameDataFromServer.lang_codes &&
gameDataFromServer.lang_codes.length > 0
) {
const allowedLangCodes = gameDataFromServer.lang_codes
// 현재 설정된 locales에서 허용된 언어만 필터링
const availableLocales = $i18n.locales.value.filter((locale: any) =>
const availableLocales = $i18n.locales.value.filter((locale: any) =>
allowedLangCodes.includes(locale.code)
)
// locales 업데이트
$i18n.locales.value = availableLocales
// 에러로 인해 주석처리
// $i18n.locales.value = availableLocales
// 현재 locale이 허용되지 않은 경우 기본 locale로 변경
if (!allowedLangCodes.includes($i18n.locale.value)) {
$i18n.locale.value = gameDataFromServer.default_lang_code || 'ko'

View File

@@ -1,10 +1,10 @@
export default defineNuxtPlugin(() => {
const runtimeConfig = useRuntimeConfig();
const callerInfoStore = useCallerInfoStore();
const runtimeConfig = useRuntimeConfig()
const callerInfoStore = useCallerInfoStore()
const callerId = `${runtimeConfig.public.stoveGameId}`;
const callerDetail = `${useCookie("sgs_da_uuid").value || ""}`;
const callerId = `${runtimeConfig.public.stoveGameId}`
const callerDetail = `${useCookie('sgs_da_uuid').value || ''}`
callerInfoStore.setCallerId(callerId);
callerInfoStore.setCallerDetail(callerDetail);
});
callerInfoStore.setCallerId(callerId)
callerInfoStore.setCallerDetail(callerDetail)
})