From 38cef20cd509648d50e289cd4c7ec4a772031b12 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Sun, 20 Oct 2019 21:32:38 +0800 Subject: ... --- Timeline/Controllers/UserController.cs | 91 ++++++++---- Timeline/GlobalSuppressions.cs | 3 +- .../Helpers/StringLocalizerFactoryExtensions.cs | 14 ++ Timeline/InvalidBranchException.cs | 16 +++ Timeline/Models/Http/Common.cs | 36 +++-- Timeline/Resources/Common.Designer.cs | 72 ++++++++++ Timeline/Resources/Common.resx | 123 +++++++++++++++++ .../Controllers/TokenController.Designer.cs | 153 --------------------- .../Resources/Controllers/UserController.en.resx | 129 +++++++++++++++++ Timeline/Resources/Controllers/UserController.resx | 141 +++++++++++++++++++ .../Resources/Controllers/UserController.zh.resx | 129 +++++++++++++++++ Timeline/Resources/Http/Common.en.resx | 132 ++++++++++++++++++ Timeline/Resources/Http/Common.zh.resx | 132 ++++++++++++++++++ Timeline/Timeline.csproj | 20 +-- 14 files changed, 991 insertions(+), 200 deletions(-) create mode 100644 Timeline/Helpers/StringLocalizerFactoryExtensions.cs create mode 100644 Timeline/InvalidBranchException.cs create mode 100644 Timeline/Resources/Common.Designer.cs create mode 100644 Timeline/Resources/Common.resx delete mode 100644 Timeline/Resources/Controllers/TokenController.Designer.cs create mode 100644 Timeline/Resources/Controllers/UserController.en.resx create mode 100644 Timeline/Resources/Controllers/UserController.resx create mode 100644 Timeline/Resources/Controllers/UserController.zh.resx create mode 100644 Timeline/Resources/Http/Common.en.resx create mode 100644 Timeline/Resources/Http/Common.zh.resx (limited to 'Timeline') diff --git a/Timeline/Controllers/UserController.cs b/Timeline/Controllers/UserController.cs index c0cd3cdb..b01d06fb 100644 --- a/Timeline/Controllers/UserController.cs +++ b/Timeline/Controllers/UserController.cs @@ -1,40 +1,73 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; -using System; using System.Threading.Tasks; using Timeline.Authenticate; +using Timeline.Helpers; using Timeline.Models; using Timeline.Models.Http; using Timeline.Services; -using static Timeline.Helpers.MyLogHelper; -namespace Timeline.Controllers +namespace Timeline { - [ApiController] - public class UserController : Controller + public static partial class ErrorCodes { - public static class ErrorCodes + public static partial class Http { - public const int Get_NotExist = -1001; + public static class User // bbb = 002 + { + public static class Get // cc = 01 + { + public const int NotExist = 10020101; // dd = 01 + } - public const int Put_BadUsername = -2001; + public static class Put // cc = 02 + { + public const int BadUsername = 10020201; // dd = 01 + } + + public static class Patch // cc = 03 + { + public const int NotExist = 10020301; // dd = 01 + } - public const int Patch_NotExist = -3001; + public static class Op // cc = 1x + { + public static class ChangeUsername // cc = 11 + { + public const int NotExist = 10021101; // dd = 01 + public const int AlreadyExist = 10021102; // dd = 02 + } - public const int ChangeUsername_NotExist = -4001; - public const int ChangeUsername_AlreadyExist = -4002; + public static class ChangePassword // cc = 12 + { + public const int BadOldPassword = 10021201; // dd = 01 + } + } - public const int ChangePassword_BadOldPassword = -5001; + } } + } +} + +namespace Timeline.Controllers +{ + [ApiController] + public class UserController : Controller + { private readonly ILogger _logger; private readonly IUserService _userService; + private readonly IStringLocalizerFactory _localizerFactory; + private readonly IStringLocalizer _localizer; - public UserController(ILogger logger, IUserService userService) + public UserController(ILogger logger, IUserService userService, IStringLocalizerFactory localizerFactory) { _logger = logger; _userService = userService; + _localizerFactory = localizerFactory; + _localizer = localizerFactory.Create(GetType()); } [HttpGet("users"), AdminAuthorize] @@ -49,8 +82,8 @@ namespace Timeline.Controllers var user = await _userService.GetUser(username); if (user == null) { - _logger.LogInformation(FormatLogMessage("Attempt to get a non-existent user.", Pair("Username", username))); - return NotFound(new CommonResponse(ErrorCodes.Get_NotExist, "The user does not exist.")); + _logger.LogInformation(Log.Format(_localizer["LogGetUserNotExist"], ("Username", username))); + return NotFound(new CommonResponse(ErrorCodes.Http.User.Get.NotExist, _localizer["ErrorGetUserNotExist"])); } return Ok(user); } @@ -60,23 +93,23 @@ namespace Timeline.Controllers { try { - var result = await _userService.PutUser(username, request.Password, request.Administrator.Value); + var result = await _userService.PutUser(username, request.Password, request.Administrator!.Value); switch (result) { case PutResult.Created: - _logger.LogInformation(FormatLogMessage("A user is created.", Pair("Username", username))); - return CreatedAtAction("Get", new { username }, CommonPutResponse.Create()); + _logger.LogInformation(Log.Format(_localizer["LogPutCreate"], ("Username", username))); + return CreatedAtAction("Get", new { username }, CommonPutResponse.Create(_localizerFactory)); case PutResult.Modified: - _logger.LogInformation(FormatLogMessage("A user is modified.", Pair("Username", username))); - return Ok(CommonPutResponse.Modify()); + _logger.LogInformation(Log.Format(_localizer["LogPutModify"], ("Username", username))); + return Ok(CommonPutResponse.Modify(_localizerFactory)); default: - throw new Exception("Unreachable code."); + throw new InvalidBranchException(); } } catch (UsernameBadFormatException e) { - _logger.LogInformation(e, FormatLogMessage("Attempt to create a user with bad username failed.", Pair("Username", username))); - return BadRequest(new CommonResponse(ErrorCodes.Put_BadUsername, "Username is of bad format.")); + _logger.LogInformation(e, Log.Format(_localizer["LogPutBadUsername"], ("Username", username))); + return BadRequest(new CommonResponse(ErrorCodes.Http.User.Put.BadUsername, _localizer["ErrorPutBadUsername"])); } } @@ -90,8 +123,8 @@ namespace Timeline.Controllers } catch (UserNotExistException e) { - _logger.LogInformation(e, FormatLogMessage("Attempt to patch a non-existent user.", Pair("Username", username))); - return NotFound(new CommonResponse(ErrorCodes.Patch_NotExist, "The user does not exist.")); + _logger.LogInformation(e, Log.Format(_localizer["LogPatchUserNotExist"], ("Username", username))); + return NotFound(new CommonResponse(ErrorCodes.Http.User.Patch.NotExist, _localizer["ErrorPatchUserNotExist"])); } } @@ -101,13 +134,13 @@ namespace Timeline.Controllers try { await _userService.DeleteUser(username); - _logger.LogInformation(FormatLogMessage("A user is deleted.", Pair("Username", username))); - return Ok(CommonDeleteResponse.Delete()); + _logger.LogInformation(Log.Format(_localizer["LogDeleteDelete"], ("Username", username))); + return Ok(CommonDeleteResponse.Delete(_localizerFactory)); } catch (UserNotExistException e) { - _logger.LogInformation(e, FormatLogMessage("Attempt to delete a non-existent user.", Pair("Username", username))); - return Ok(CommonDeleteResponse.NotExist()); + _logger.LogInformation(e, Log.Format(_localizer["LogDeleteUserNotExist"], ("Username", username))); + return Ok(CommonDeleteResponse.NotExist(_localizerFactory)); } } diff --git a/Timeline/GlobalSuppressions.cs b/Timeline/GlobalSuppressions.cs index 3c9c8341..6c89b230 100644 --- a/Timeline/GlobalSuppressions.cs +++ b/Timeline/GlobalSuppressions.cs @@ -6,4 +6,5 @@ [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task", Justification = "This is not a UI application.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "This is not bad.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "No need to check the null because it's ASP.Net's duty.", Scope = "namespaceanddescendants", Target = "Timeline.Controllers")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Error code constant identifiers use nested names.", Scope = "type", Target = "Timeline.ErrorCodes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Error code constant identifiers.", Scope = "type", Target = "Timeline.ErrorCodes")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "Error code constant identifiers.", Scope = "type", Target = "Timeline.ErrorCodes")] diff --git a/Timeline/Helpers/StringLocalizerFactoryExtensions.cs b/Timeline/Helpers/StringLocalizerFactoryExtensions.cs new file mode 100644 index 00000000..3cb561f5 --- /dev/null +++ b/Timeline/Helpers/StringLocalizerFactoryExtensions.cs @@ -0,0 +1,14 @@ + +using Microsoft.Extensions.Localization; +using System.Reflection; + +namespace Timeline.Helpers +{ + internal static class StringLocalizerFactoryExtensions + { + internal static IStringLocalizer Create(this IStringLocalizerFactory factory, string basename) + { + return factory.Create(basename, new AssemblyName(typeof(StringLocalizerFactoryExtensions).Assembly.FullName!).Name); + } + } +} \ No newline at end of file diff --git a/Timeline/InvalidBranchException.cs b/Timeline/InvalidBranchException.cs new file mode 100644 index 00000000..32937c5d --- /dev/null +++ b/Timeline/InvalidBranchException.cs @@ -0,0 +1,16 @@ +using System; + +namespace Timeline +{ + + [Serializable] + public class InvalidBranchException : Exception + { + public InvalidBranchException() : base(Resources.Common.ExceptionInvalidBranch) { } + public InvalidBranchException(string message) : base(message) { } + public InvalidBranchException(string message, Exception inner) : base(message, inner) { } + protected InvalidBranchException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } +} diff --git a/Timeline/Models/Http/Common.cs b/Timeline/Models/Http/Common.cs index 6f6dbc1e..2735e43c 100644 --- a/Timeline/Models/Http/Common.cs +++ b/Timeline/Models/Http/Common.cs @@ -1,3 +1,6 @@ +using Microsoft.Extensions.Localization; +using Timeline.Helpers; + namespace Timeline.Models.Http { public class CommonResponse @@ -55,7 +58,7 @@ namespace Timeline.Models.Http Data = data; } - public T Data { get; set; } + public T Data { get; set; } = default!; } public static class CommonPutResponse @@ -70,10 +73,18 @@ namespace Timeline.Models.Http public bool Create { get; set; } } - public static CommonDataResponse Create() => - new CommonDataResponse(0, "A new item is created.", new ResponseData(true)); - public static CommonDataResponse Modify() => - new CommonDataResponse(0, "An existent item is modified.", new ResponseData(false)); + internal static CommonDataResponse Create(IStringLocalizerFactory localizerFactory) + { + var localizer = localizerFactory.Create("Http.Common"); + return new CommonDataResponse(0, localizer["ResponsePutCreate"], new ResponseData(true)); + } + + internal static CommonDataResponse Modify(IStringLocalizerFactory localizerFactory) + { + var localizer = localizerFactory.Create("Http.Common"); + return new CommonDataResponse(0, localizer["ResponsePutModify"], new ResponseData(false)); + + } } public static class CommonDeleteResponse @@ -88,9 +99,16 @@ namespace Timeline.Models.Http public bool Delete { get; set; } } - public static CommonDataResponse Delete() => - new CommonDataResponse(0, "An existent item is deleted.", new ResponseData(true)); - public static CommonDataResponse NotExist() => - new CommonDataResponse(0, "The item does not exist.", new ResponseData(false)); + internal static CommonDataResponse Delete(IStringLocalizerFactory localizerFactory) + { + var localizer = localizerFactory.Create("Http.Common"); + return new CommonDataResponse(0, localizer["ResponseDeleteDelete"], new ResponseData(true)); + } + + internal static CommonDataResponse NotExist(IStringLocalizerFactory localizerFactory) + { + var localizer = localizerFactory.Create("Http.Common"); + return new CommonDataResponse(0, localizer["ResponseDeleteNotExist"], new ResponseData(false)); + } } } diff --git a/Timeline/Resources/Common.Designer.cs b/Timeline/Resources/Common.Designer.cs new file mode 100644 index 00000000..4f1c8e3f --- /dev/null +++ b/Timeline/Resources/Common.Designer.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Timeline.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Common { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Common() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Common", typeof(Common).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The branch is invalid. Normally this branch is not reachable.. + /// + internal static string ExceptionInvalidBranch { + get { + return ResourceManager.GetString("ExceptionInvalidBranch", resourceCulture); + } + } + } +} diff --git a/Timeline/Resources/Common.resx b/Timeline/Resources/Common.resx new file mode 100644 index 00000000..8a036996 --- /dev/null +++ b/Timeline/Resources/Common.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The branch is invalid. Normally this branch is not reachable. + + \ No newline at end of file diff --git a/Timeline/Resources/Controllers/TokenController.Designer.cs b/Timeline/Resources/Controllers/TokenController.Designer.cs deleted file mode 100644 index 0dcfb79e..00000000 --- a/Timeline/Resources/Controllers/TokenController.Designer.cs +++ /dev/null @@ -1,153 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Timeline.Resources.Controllers { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class TokenController { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal TokenController() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Timeline.Resources.Controllers.TokenController", typeof(TokenController).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to The password is wrong.. - /// - public static string LogBadPassword { - get { - return ResourceManager.GetString("LogBadPassword", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A user failed to create a token.. - /// - public static string LogCreateFailure { - get { - return ResourceManager.GetString("LogCreateFailure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A user succeeded to create a token.. - /// - public static string LogCreateSuccess { - get { - return ResourceManager.GetString("LogCreateSuccess", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The user does not exist.. - /// - public static string LogUserNotExist { - get { - return ResourceManager.GetString("LogUserNotExist", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The token is of bad format. It might not be created by the server.. - /// - public static string LogVerifyBadFormat { - get { - return ResourceManager.GetString("LogVerifyBadFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The token is expired.. - /// - public static string LogVerifyExpire { - get { - return ResourceManager.GetString("LogVerifyExpire", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A token failed to be verified.. - /// - public static string LogVerifyFailure { - get { - return ResourceManager.GetString("LogVerifyFailure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Token has an old version. User might have update some info.. - /// - public static string LogVerifyOldVersion { - get { - return ResourceManager.GetString("LogVerifyOldVersion", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A token succeeded to be verified.. - /// - public static string LogVerifySuccess { - get { - return ResourceManager.GetString("LogVerifySuccess", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to User does not exist. Administrator might have deleted this user.. - /// - public static string LogVerifyUserNotExist { - get { - return ResourceManager.GetString("LogVerifyUserNotExist", resourceCulture); - } - } - } -} diff --git a/Timeline/Resources/Controllers/UserController.en.resx b/Timeline/Resources/Controllers/UserController.en.resx new file mode 100644 index 00000000..f0fb372a --- /dev/null +++ b/Timeline/Resources/Controllers/UserController.en.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The user does not exist. + + + Can't patch a user that does not exist. + + + Username is of bad format. + + \ No newline at end of file diff --git a/Timeline/Resources/Controllers/UserController.resx b/Timeline/Resources/Controllers/UserController.resx new file mode 100644 index 00000000..901f8aab --- /dev/null +++ b/Timeline/Resources/Controllers/UserController.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + A user has been deleted. + + + Attempt to delete a user that does not exist. + + + Attempt to retrieve info of a user that does not exist failed. + + + Attempt to patch a user that does not exist failed. + + + Attempt to create a user with bad username failed. + + + A user has been created. + + + A user has been modified. + + \ No newline at end of file diff --git a/Timeline/Resources/Controllers/UserController.zh.resx b/Timeline/Resources/Controllers/UserController.zh.resx new file mode 100644 index 00000000..519f08f6 --- /dev/null +++ b/Timeline/Resources/Controllers/UserController.zh.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 用户不存在。 + + + 不能修改一个不存在的用户。 + + + 用户名格式错误。 + + \ No newline at end of file diff --git a/Timeline/Resources/Http/Common.en.resx b/Timeline/Resources/Http/Common.en.resx new file mode 100644 index 00000000..40d44191 --- /dev/null +++ b/Timeline/Resources/Http/Common.en.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + An existent item is deleted. + + + The item does not exist, so nothing is changed. + + + A new item is created. + + + An existent item is modified. + + \ No newline at end of file diff --git a/Timeline/Resources/Http/Common.zh.resx b/Timeline/Resources/Http/Common.zh.resx new file mode 100644 index 00000000..b6d955d9 --- /dev/null +++ b/Timeline/Resources/Http/Common.zh.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 删除了一个项目。 + + + 要删除的项目不存在,什么都没有修改。 + + + 创建了一个新项目。 + + + 修改了一个已存在的项目。 + + \ No newline at end of file diff --git a/Timeline/Timeline.csproj b/Timeline/Timeline.csproj index 302d1677..d2d3fa67 100644 --- a/Timeline/Timeline.csproj +++ b/Timeline/Timeline.csproj @@ -28,27 +28,31 @@ - + True True - TokenController.resx + Common.resx + + ResXFileCodeGenerator + Common.Designer.cs + Designer - TokenController.Designer.cs - PublicResXFileCodeGenerator + Designer - TokenController.en.Designer.cs - PublicResXFileCodeGenerator + - PublicResXFileCodeGenerator - TokenController.en.Designer.cs + + + + -- cgit v1.2.3