Skip to content

Commit 0a9e0e7

Browse files
authored
Merge pull request #156 from zhongerxll/Chinese
Try adding Chinese translation
2 parents bbef782 + 217eaf0 commit 0a9e0e7

File tree

5 files changed

+445
-11
lines changed

5 files changed

+445
-11
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/features/general/Others.java

+9-11
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,10 @@ private void showCallInformation(Object wamCall, Object userJid) throws Exceptio
218218
if (WppCore.isGroup(WppCore.getRawString(userJid)))
219219
return;
220220
var sb = new StringBuilder();
221-
222221
var contact = WppCore.getContactName(userJid);
223-
if (!TextUtils.isEmpty(contact))
224-
sb.append("Contact: ").append(contact).append("\n");
225-
sb.append("Number: ").append("+").append(WppCore.stripJID(WppCore.getRawString(userJid))).append("\n");
226-
222+
var number = WppCore.stripJID(WppCore.getRawString(userJid));
223+
if (!TextUtils.isEmpty(contact)) sb.append(String.format(Utils.getApplication().getString(ResId.string.contact_s), contact)).append("\n");
224+
sb.append(String.format(Utils.getApplication().getString(ResId.string.phone_number_s), number)).append("\n");
227225
var ip = (String) XposedHelpers.getObjectField(wamCall, "callPeerIpStr");
228226
if (ip != null) {
229227
var client = new OkHttpClient();
@@ -233,15 +231,15 @@ private void showCallInformation(Object wamCall, Object userJid) throws Exceptio
233231
var json = new JSONObject(content);
234232
var country = json.getString("country");
235233
var city = json.getString("city");
236-
sb.append("Country: ").append(country).append("\n");
237-
sb.append("City: ").append(city).append("\n");
238-
sb.append("IP: ").append(ip).append("\n");
234+
sb.append(String.format(Utils.getApplication().getString(ResId.string.country_s), country)).append("\n")
235+
.append(String.format(Utils.getApplication().getString(ResId.string.city_s), city)).append("\n")
236+
.append(String.format(Utils.getApplication().getString(ResId.string.ip_s), ip)).append("\n");
239237
}
240238
var platform = (String) XposedHelpers.getObjectField(wamCall, "callPeerPlatform");
241-
if (platform != null) sb.append("Platform: ").append(platform).append("\n");
239+
if (platform != null) sb.append(String.format(Utils.getApplication().getString(ResId.string.platform_s), platform)).append("\n");
242240
var wppVersion = (String) XposedHelpers.getObjectField(wamCall, "callPeerAppVersion");
243-
if (wppVersion != null) sb.append("WhatsApp Version: ").append(wppVersion).append("\n");
244-
Utils.showNotification("Call Information", sb.toString());
241+
if (wppVersion != null) sb.append(String.format(Utils.getApplication().getString(ResId.string.wpp_version_s), wppVersion)).append("\n");
242+
Utils.showNotification(Utils.getApplication().getString(ResId.string.call_information), sb.toString());
245243
}
246244

247245
private void alwaysOnline() throws Exception {

app/src/main/java/com/wmods/wppenhacer/xposed/utils/ResId.java

+8
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ public static class string {
9191
public static int custom_privacy;
9292
public static int custom_privacy_sum;
9393
public static int block_call;
94+
public static int contact_s;
95+
public static int phone_number_s;
96+
public static int country_s;
97+
public static int city_s;
98+
public static int ip_s;
99+
public static int platform_s;
100+
public static int wpp_version_s;
101+
public static int call_information;
94102
}
95103

96104
public static class array {

app/src/main/res/values-zh/arrays.xml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string-array name="animations_names">
4+
<item>默认</item>
5+
<item>淡入</item>
6+
<item>淡出</item>
7+
<item>放大</item>
8+
<item>向上滑动</item>
9+
<item>从右向左滑动</item>
10+
<item>旋转</item>
11+
<item>弹跳</item>
12+
<item>缩小</item>
13+
<item>翻转</item>
14+
<item>超空间消失</item>
15+
</string-array>
16+
</resources>

0 commit comments

Comments
 (0)