-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a991ef
commit 0271a23
Showing
13 changed files
with
178 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"general": { | ||
"start": "START", | ||
|
||
"ip": "IP", | ||
"lossRate": "Loss Rate", | ||
"respondTime": "Respond Time", | ||
"downloadSpeed": "Download Speed" | ||
}, | ||
"testRun": { | ||
"title": "Test Run", | ||
"testRespond": "TEST RESPOND", | ||
"testDownload": "TEST DOWNLOAD", | ||
"ipCount": "ip count", | ||
"coCurrentCount": "coCurrent count", | ||
"testUrl": "test url" | ||
}, | ||
"testStatistics": { | ||
"title": "Test Statistics", | ||
"totalRespond": "Total Respond", | ||
"respondSuccessRate": "Respond Suc Rate", | ||
"meanRespondTime": "Mean Respond Time", | ||
"totalDownload": "Total Download", | ||
"downloadSuccessRate": "Download Suc Rate", | ||
"meanDownload": "Mean Download", | ||
"showAllColumns": "Show All Columns", | ||
"hideSomeColumns": "Hide Some Columns" | ||
}, | ||
"testConfig": { | ||
"title": "Test Config" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"general": { | ||
"start": "开始", | ||
|
||
"ip": "IP", | ||
"lossRate": "丢包率", | ||
"respondTime": "响应时长", | ||
"downloadSpeed": "下载速度" | ||
}, | ||
"testRun": { | ||
"title": "运行测试", | ||
"testRespond": "测试响应", | ||
"testDownload": "测试下载", | ||
"ipCount": "IP 数量", | ||
"coCurrentCount": "并发数", | ||
"testUrl": "测试地址" | ||
}, | ||
"testStatistics": { | ||
"title": "测试统计", | ||
"totalRespond": "响应次数", | ||
"respondSuccessRate": "响应成功率", | ||
"meanRespondTime": "平均响应时长", | ||
"totalDownload": "下载次数", | ||
"downloadSuccessRate": "下载成功率", | ||
"meanDownload": "平均下载速度", | ||
"showAllColumns": "展示所有列", | ||
"hideSomeColumns": "隐藏某些列" | ||
}, | ||
"testConfig": { | ||
"title": "测试配置" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import I18n from "i18n-js"; | ||
import * as RNLocalize from "react-native-localize"; | ||
import cn from "../lang/zh-cn.json"; | ||
import en from "../lang/en-us.json"; | ||
|
||
// 获取手机本地国际化信息 | ||
const locales = RNLocalize.getLocales(); | ||
const systemLanguage = locales[0]?.languageCode; // 用户系统偏好语言 | ||
console.log(locales, 12, systemLanguage); | ||
|
||
// 如果获取到了即使用,否则启用默认语言 | ||
if (systemLanguage) { | ||
I18n.locale = systemLanguage; | ||
} else { | ||
I18n.locale = "en"; // 用户既没有设置,也没有获取到系统语言,默认加载英语语言资源 | ||
} | ||
|
||
I18n.fallbacks = true; | ||
|
||
// 加载语言包 | ||
I18n.translations = { | ||
zh: cn, | ||
cn, | ||
en, | ||
}; | ||
|
||
export { I18n }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.