Skip to content

Commit 321ec30

Browse files
committed
Internationalized code comments
1 parent 5adae2d commit 321ec30

File tree

11 files changed

+336
-124
lines changed

11 files changed

+336
-124
lines changed

v2rayN/ServiceLib/Common/AesUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class AesUtils
88
private const int KeySize = 256; // AES-256
99
private const int IvSize = 16; // AES block size
1010
private const int Iterations = 10000;
11-
private static readonly byte[] Salt = Encoding.ASCII.GetBytes("saltysalt".PadRight(16, ' ')); // google浏览器默认盐值
11+
private static readonly byte[] Salt = Encoding.ASCII.GetBytes("saltysalt".PadRight(16, ' '));
1212
private static readonly string DefaultPassword = Utils.GetMd5(Utils.GetHomePath() + "AesUtils");
1313

1414
/// <summary>

v2rayN/ServiceLib/Common/JsonUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static string Serialize(object? obj, bool indented = true, bool nullValue
8888
{
8989
WriteIndented = indented,
9090
DefaultIgnoreCondition = nullValue ? JsonIgnoreCondition.Never : JsonIgnoreCondition.WhenWritingNull,
91-
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping // 避免转义加号
91+
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
9292
};
9393
result = JsonSerializer.Serialize(obj, options);
9494
}

v2rayN/ServiceLib/Common/YamlUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class YamlUtils
1111
#region YAML
1212

1313
/// <summary>
14-
/// 反序列化成对象
14+
/// Deserialize
1515
/// </summary>
1616
/// <typeparam name="T"></typeparam>
1717
/// <param name="str"></param>
@@ -34,7 +34,7 @@ public static T FromYaml<T>(string str)
3434
}
3535

3636
/// <summary>
37-
/// 序列化
37+
/// Serialize
3838
/// </summary>
3939
/// <param name="obj"></param>
4040
/// <returns></returns>

v2rayN/ServiceLib/Handler/ConfigHandler.cs

Lines changed: 323 additions & 93 deletions
Large diffs are not rendered by default.

v2rayN/ServiceLib/Handler/Fmt/BaseFmt.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ protected static string GetIpv6(string address)
88
{
99
if (Utils.IsIpv6(address))
1010
{
11-
// 检查地址是否已经被方括号包围,如果没有,则添加方括号
11+
// Check if the address is already surrounded by square brackets, if not, add square brackets
1212
return address.StartsWith('[') && address.EndsWith(']') ? address : $"[{address}]";
1313
}
14-
return address; // 如果不是IPv6地址,直接返回原地址
14+
else
15+
{
16+
return address;
17+
}
1518
}
1619

1720
protected static int GetStdTransport(ProfileItem item, string? securityDef, ref Dictionary<string, string> dicQuery)

v2rayN/ServiceLib/Models/Config.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
namespace ServiceLib.Models;
22

3-
/// <summary>
4-
/// 本软件配置文件实体类
5-
/// </summary>
63
[Serializable]
74
public class Config
85
{

v2rayN/ServiceLib/Models/V2rayTcpRequest.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
namespace ServiceLib.Models;
22

3-
/// <summary>
4-
/// Tcp伪装http的Request,只要Host
5-
/// </summary>
63
public class V2rayTcpRequest
74
{
85
/// <summary>

v2rayN/ServiceLib/Services/CoreConfig/CoreConfigClashService.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ public CoreConfigClashService(Config config)
1212
{
1313
_config = config;
1414
}
15-
16-
/// <summary>
17-
/// 生成配置文件
18-
/// </summary>
19-
/// <param name="node"></param>
20-
/// <param name="fileName"></param>
21-
/// <param name="msg"></param>
22-
/// <returns></returns>
15+
2316
public async Task<RetResult> GenerateClientCustomConfig(ProfileItem node, string? fileName)
2417
{
2518
var ret = new RetResult();

v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ private async Task<int> GenOutbound(ProfileItem node, Outbounds4Ray outbound)
661661
{
662662
usersItem = vnextItem.users.First();
663663
}
664-
//远程服务器用户ID
664+
665665
usersItem.id = node.Id;
666666
usersItem.alterId = node.AlterId;
667667
usersItem.email = Global.UserEMail;
@@ -1143,7 +1143,7 @@ private async Task<int> GenDns(ProfileItem? node, V2rayConfig v2rayConfig)
11431143
obj["servers"] = JsonUtils.SerializeToNode(servers);
11441144
}
11451145

1146-
// 追加至 dns 设置
1146+
// Append to dns settings
11471147
if (item.UseSystemHosts)
11481148
{
11491149
var systemHosts = Utils.GetSystemHosts();

v2rayN/v2rayN/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public App()
1919
}
2020

2121
/// <summary>
22-
/// 只打开一个进程
22+
/// Open only one process
2323
/// </summary>
2424
/// <param name="e"></param>
2525
protected override void OnStartup(StartupEventArgs e)

v2rayN/v2rayN/Common/WindowsUtils.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ internal static class WindowsUtils
1212
{
1313
private static readonly string _tag = "WindowsUtils";
1414

15-
/// <summary>
16-
/// 获取剪贴板数
17-
/// </summary>
18-
/// <returns></returns>
1915
public static string? GetClipboardData()
2016
{
2117
var strData = string.Empty;
@@ -35,10 +31,6 @@ internal static class WindowsUtils
3531
return strData;
3632
}
3733

38-
/// <summary>
39-
/// 拷贝至剪贴板
40-
/// </summary>
41-
/// <returns></returns>
4234
public static void SetClipboardData(string strData)
4335
{
4436
try

0 commit comments

Comments
 (0)