Skip to content

Commit

Permalink
Merge pull request #156 from zhongerxll/Chinese
Browse files Browse the repository at this point in the history
Try adding Chinese translation
  • Loading branch information
Dev4Mod authored Oct 28, 2024
2 parents bbef782 + 217eaf0 commit 0a9e0e7
Show file tree
Hide file tree
Showing 5 changed files with 445 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,10 @@ private void showCallInformation(Object wamCall, Object userJid) throws Exceptio
if (WppCore.isGroup(WppCore.getRawString(userJid)))
return;
var sb = new StringBuilder();

var contact = WppCore.getContactName(userJid);
if (!TextUtils.isEmpty(contact))
sb.append("Contact: ").append(contact).append("\n");
sb.append("Number: ").append("+").append(WppCore.stripJID(WppCore.getRawString(userJid))).append("\n");

var number = WppCore.stripJID(WppCore.getRawString(userJid));
if (!TextUtils.isEmpty(contact)) sb.append(String.format(Utils.getApplication().getString(ResId.string.contact_s), contact)).append("\n");
sb.append(String.format(Utils.getApplication().getString(ResId.string.phone_number_s), number)).append("\n");
var ip = (String) XposedHelpers.getObjectField(wamCall, "callPeerIpStr");
if (ip != null) {
var client = new OkHttpClient();
Expand All @@ -233,15 +231,15 @@ private void showCallInformation(Object wamCall, Object userJid) throws Exceptio
var json = new JSONObject(content);
var country = json.getString("country");
var city = json.getString("city");
sb.append("Country: ").append(country).append("\n");
sb.append("City: ").append(city).append("\n");
sb.append("IP: ").append(ip).append("\n");
sb.append(String.format(Utils.getApplication().getString(ResId.string.country_s), country)).append("\n")
.append(String.format(Utils.getApplication().getString(ResId.string.city_s), city)).append("\n")
.append(String.format(Utils.getApplication().getString(ResId.string.ip_s), ip)).append("\n");
}
var platform = (String) XposedHelpers.getObjectField(wamCall, "callPeerPlatform");
if (platform != null) sb.append("Platform: ").append(platform).append("\n");
if (platform != null) sb.append(String.format(Utils.getApplication().getString(ResId.string.platform_s), platform)).append("\n");
var wppVersion = (String) XposedHelpers.getObjectField(wamCall, "callPeerAppVersion");
if (wppVersion != null) sb.append("WhatsApp Version: ").append(wppVersion).append("\n");
Utils.showNotification("Call Information", sb.toString());
if (wppVersion != null) sb.append(String.format(Utils.getApplication().getString(ResId.string.wpp_version_s), wppVersion)).append("\n");
Utils.showNotification(Utils.getApplication().getString(ResId.string.call_information), sb.toString());
}

private void alwaysOnline() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ public static class string {
public static int custom_privacy;
public static int custom_privacy_sum;
public static int block_call;
public static int contact_s;
public static int phone_number_s;
public static int country_s;
public static int city_s;
public static int ip_s;
public static int platform_s;
public static int wpp_version_s;
public static int call_information;
}

public static class array {
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/res/values-zh/arrays.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="animations_names">
<item>默认</item>
<item>淡入</item>
<item>淡出</item>
<item>放大</item>
<item>向上滑动</item>
<item>从右向左滑动</item>
<item>旋转</item>
<item>弹跳</item>
<item>缩小</item>
<item>翻转</item>
<item>超空间消失</item>
</string-array>
</resources>
Loading

0 comments on commit 0a9e0e7

Please sign in to comment.