mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 14:04:50 +00:00
feat(i18n): add Korean locale (#531)
Add a Korean message catalog covering every key in the English catalog, with placeholders matching English for each message. Register ko in the inlang project, accept it as a sign-up and saved user locale, and offer it in the sign-up language switch and the team settings language select. Co-authored-by: phj1081 <5908832+phj1081@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
phj1081
Claude
parent
2be1093b91
commit
d255e76806
@@ -199,7 +199,10 @@ export const Route = createRootRouteWithContext<MyRouterContext>()({
|
||||
try {
|
||||
await fetchMetadata(teamId)
|
||||
const savedLocale = getMetadata<string>('locale')
|
||||
if ((savedLocale === 'en' || savedLocale === 'zh') && savedLocale !== getLocale()) {
|
||||
if (
|
||||
(savedLocale === 'en' || savedLocale === 'zh' || savedLocale === 'ko') &&
|
||||
savedLocale !== getLocale()
|
||||
) {
|
||||
setLocale(savedLocale, { reload: false })
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -31,12 +31,12 @@ function SignupPage() {
|
||||
const inviteCode = (search as { inviteCode?: string }).inviteCode
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [locale, setLocaleState] = useState<'en' | 'zh'>(() => {
|
||||
const [locale, setLocaleState] = useState<'en' | 'zh' | 'ko'>(() => {
|
||||
const activeLocale = getLocale()
|
||||
return activeLocale === 'zh' ? 'zh' : 'en'
|
||||
return activeLocale === 'zh' || activeLocale === 'ko' ? activeLocale : 'en'
|
||||
})
|
||||
|
||||
const handleLocaleChange = (newLocale: 'en' | 'zh') => {
|
||||
const handleLocaleChange = (newLocale: 'en' | 'zh' | 'ko') => {
|
||||
setLocaleState(newLocale)
|
||||
setLocale(newLocale)
|
||||
}
|
||||
@@ -280,6 +280,16 @@ function SignupPage() {
|
||||
>
|
||||
中文
|
||||
</button>
|
||||
<span className="text-zinc-300 dark:text-zinc-850">/</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => handleLocaleChange('ko')}
|
||||
className={`cursor-pointer hover:text-zinc-800 dark:hover:text-zinc-200 transition-colors ${
|
||||
locale === 'ko' ? 'font-bold text-rose-500 dark:text-rose-400' : ''
|
||||
}`}
|
||||
>
|
||||
한국어
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</AuthLayout>
|
||||
|
||||
@@ -254,7 +254,7 @@ export function TeamSettingsPage() {
|
||||
const currentLocale = getMetadata<string>('locale') || getLocale()
|
||||
|
||||
const handleLanguageChange = async (newLocale: string) => {
|
||||
if (newLocale === 'en' || newLocale === 'zh') {
|
||||
if (newLocale === 'en' || newLocale === 'zh' || newLocale === 'ko') {
|
||||
try {
|
||||
await setMetadata(teamId, 'locale', newLocale)
|
||||
setLocale(newLocale)
|
||||
@@ -957,6 +957,7 @@ export function TeamSettingsPage() {
|
||||
<SelectContent>
|
||||
<SelectItem value="en">{m.english()}</SelectItem>
|
||||
<SelectItem value="zh">{m.chinese()}</SelectItem>
|
||||
<SelectItem value="ko">{m.korean()}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user