add lib rabbit-node for encoding mynmar language to zawgyi

This commit is contained in:
Boonkarit 2025-08-19 18:31:22 +07:00
parent 457f046fab
commit ed21bce143
3 changed files with 15 additions and 1 deletions

View File

@ -39,6 +39,7 @@
"moment": "^2.24.0",
"native-base": "^2.13.8",
"patch-package": "^7.0.0",
"rabbit-node": "^1.0.4",
"react": "18.2.0",
"react-native": "0.72.6",
"react-native-action-sheet": "^2.2.0",

View File

@ -1,5 +1,6 @@
import I18n from 'i18n-js'
import moment from 'moment'
import { uni2zg } from 'rabbit-node'
import 'moment/locale/th'
import 'moment/locale/my'
@ -23,7 +24,14 @@ ReactNative.I18nManager.allowRTL(isRTL)
// The method we'll use instead of a regular string
export function t (name, params = {}) {
return I18n.t(name, params)
let text = I18n.t(name, params)
// แปลงเป็น Zawgyi กรณีเป็นภาษาพม่า
if (I18n.locale.startsWith('my')) {
text = uni2zg(text)
}
return text
}
export function locale () {

View File

@ -7274,6 +7274,11 @@ queue@6.0.2:
dependencies:
inherits "~2.0.3"
rabbit-node@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/rabbit-node/-/rabbit-node-1.0.4.tgz#b329b1a25c5ec70371f5da47d7dd26b06b8120e0"
integrity sha512-B+eMJwfnRab47sp5q96TfZVdGEHunA3sAuoXcwRFiM3e4ZT5t7h9U8dl1fCM1aSMqOg9ysGbE8Szpl2Q8w504Q==
raf@^3.1.0:
version "3.4.1"
resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"