国际化

此接口提供了与全球化 (g11n) 和国际化 (i18n) 相关的接口。

有些语言是从右往左读的。在这种情况下,最好让用户界面“镜像”显示。在从左往右读的语言中,屏幕左侧的按钮会翻转到屏幕右侧,以适应从右往左读的语言。这种镜像大多是自动的,但可能需要一些代码更改——例如,翻转取决于位置的图标或图像。有关 React Native 对从右往左读语言支持的更多详细信息,请参阅这篇有用的博客文章

方法

// By default, right-to-left mirroring is enabled based on the
// OS or browser settings. This method allows the app to disable
// right-to-left mirroring.
allowRTL(allow: boolean): void;

// This method overrides the right-to-left setting of the system
// or browser, forcing right-to-left mirroring behavior if true.
forceRTL(force: boolean): void;

// Indicates whether the app is currently running in right-to-left mode.
isRTL(): boolean;