For the complete documentation index, see llms.txt. This page is also available as Markdown.

Language

getLocale The function Fetch the current user's locale information, and based on that, an API that can be used to handle the app in multiple languages.

If you provide the app so that users can use it in a language they are familiar with, the overall user experience and accessibilitycan be greatly improved. It can be used in all areas that require localization, such as string translation, date and time formatting, and number representation.

See

  • If locale information cannot be retrieved, the default value 'ko-KR'is returned.

  • This API and the example are available only in the Toss app environment can be checked.

Get User Language

SDK function: getLocale

Signature

function getLocale(): string;

Return value

  • string

    Returns the user's locale information.

Get the current user's locale information

import { getLocale } from '@apps-in-toss/framework';
import { Text } from 'react-native';

function MyPage() {
  const locale = getLocale();

  return <Text>User locale information: {locale}</Text>;
}

Try the sample app

apps-in-toss-examples from the repository with-locale Download the code, or scan the QR code below to try it yourself.

QR code link: intoss://with-locale

Last updated

Was this helpful?