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.
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?