Skip to content

[Feature] 언어 변경 기능 추가 필요 #20

@cyLee1111

Description

@cyLee1111

현재 i18n을 이용한 locales 기능 추가 완료. (#19)


Feature - 환경설정

  • 설정 언어 변경에 따른 앱 내 텍스트 자동 변경 기능

  • 사용자 기기 설정 언어와 연동하여 기본 언어 설정

  • 환경설정들을 로컬스토리지에 저장

  • 언어 변경 예제

    import React from 'react';
    import { View, Text, Button } from 'react-native';
    import { useTranslation } from 'react-i18next';
    
    const LanguageSwitcher: React.FC = () => {
      const { t, i18n } = useTranslation();
    
      const changeToKorean = () => {
        i18n.changeLanguage('ko');
      };
    
      const changeToEnglish = () => {
        i18n.changeLanguage('en');
      };
    
      return (
        <View style={{ padding: 20 }}>
          <Text style={{ fontSize: 20, marginBottom: 16 }}>
            {t('welcome')}
          </Text>
    
          <Button title="🇰🇷 한국어" onPress={changeToKorean} />
          <Button title="🇺🇸 English" onPress={changeToEnglish} />
        </View>
      );
    };
    
    export default LanguageSwitcher;
  • 현재 언어 상태 확인

    <Text>현재 언어: {i18n.language}</Text>

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions