From c5ab3149440a7f56eb717c3527107bbc62ace9b7 Mon Sep 17 00:00:00 2001 From: zahid92 Date: Sun, 24 Mar 2024 14:02:25 +0530 Subject: [PATCH] #226 remove markAddedTranslationsAsDone deprecated property --- .../ApplyPreTranslationRequest.cs | 5 +- .../Translations/PreTranslateAttributes.cs | 7 +- .../Translations/UploadTranslationsRequest.cs | 6 +- .../Core/Resources/Translations.Designer.cs | 7 +- .../Core/Resources/Translations.resx | 148 +++++++++++++++--- .../Translations/TranslationsApiTests.cs | 4 +- 6 files changed, 132 insertions(+), 45 deletions(-) diff --git a/src/Crowdin.Api/Translations/ApplyPreTranslationRequest.cs b/src/Crowdin.Api/Translations/ApplyPreTranslationRequest.cs index 58b685a4..68bf586e 100644 --- a/src/Crowdin.Api/Translations/ApplyPreTranslationRequest.cs +++ b/src/Crowdin.Api/Translations/ApplyPreTranslationRequest.cs @@ -1,4 +1,4 @@ - + using System.Collections.Generic; using JetBrains.Annotations; using Newtonsoft.Json; @@ -37,9 +37,6 @@ public class ApplyPreTranslationRequest [JsonProperty("fallbackLanguages")] public IDictionary? FallbackLanguages { get; set; } - [JsonProperty("markAddedTranslationsAsDone")] - public bool? MarkAddedTranslationsAsDone { get; set; } - [JsonProperty("labelIds")] public ICollection LabelIds { get; set; } = new List(); diff --git a/src/Crowdin.Api/Translations/PreTranslateAttributes.cs b/src/Crowdin.Api/Translations/PreTranslateAttributes.cs index b6857033..5565dd5b 100644 --- a/src/Crowdin.Api/Translations/PreTranslateAttributes.cs +++ b/src/Crowdin.Api/Translations/PreTranslateAttributes.cs @@ -1,4 +1,4 @@ - + using JetBrains.Annotations; using Newtonsoft.Json; @@ -6,10 +6,7 @@ namespace Crowdin.Api.Translations { [PublicAPI] public class PreTranslateAttributes - { - [JsonProperty("markAddedTranslationsAsDone")] - public bool? MarkAddedTranslationsAsDone { get; set; } - + { [JsonProperty("languageIds")] public string[] LanguageIds { get; set; } diff --git a/src/Crowdin.Api/Translations/UploadTranslationsRequest.cs b/src/Crowdin.Api/Translations/UploadTranslationsRequest.cs index 9c1def13..cba941c9 100644 --- a/src/Crowdin.Api/Translations/UploadTranslationsRequest.cs +++ b/src/Crowdin.Api/Translations/UploadTranslationsRequest.cs @@ -1,4 +1,4 @@ - + using JetBrains.Annotations; using Newtonsoft.Json; @@ -21,9 +21,5 @@ public class UploadTranslationsRequest [JsonProperty("translateHidden")] public bool? TranslateHidden { get; set; } - - // only enterprise API - [JsonProperty("markAddedTranslationsAsDone")] - public bool? MarkAddedTranslationsAsDone { get; set; } } } \ No newline at end of file diff --git a/tests/Crowdin.Api.Tests/Core/Resources/Translations.Designer.cs b/tests/Crowdin.Api.Tests/Core/Resources/Translations.Designer.cs index ee68a05d..1f86a202 100644 --- a/tests/Crowdin.Api.Tests/Core/Resources/Translations.Designer.cs +++ b/tests/Crowdin.Api.Tests/Core/Resources/Translations.Designer.cs @@ -1,6 +1,7 @@ //------------------------------------------------------------------------------ // // 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. @@ -18,7 +19,7 @@ namespace Crowdin.Api.Tests.Core.Resources { // 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", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Translations { @@ -141,8 +142,8 @@ internal static string GetLanguageStatusResponse { /// "skipApprovedTranslations": true, /// "translateUntranslatedOnly": true, /// "translateWithPerfectMatchOnly": true, - /// "markAddedTranslationsAsDone": true, - /// "labe [rest of string was truncated]";. + /// "labelIds": [2, 3], + /// "excludeLabelIds": [4] [rest of string was truncated]";. /// internal static string GetPreTranslationStatus_Response { get { diff --git a/tests/Crowdin.Api.Tests/Core/Resources/Translations.resx b/tests/Crowdin.Api.Tests/Core/Resources/Translations.resx index d4c63c34..0912aae9 100644 --- a/tests/Crowdin.Api.Tests/Core/Resources/Translations.resx +++ b/tests/Crowdin.Api.Tests/Core/Resources/Translations.resx @@ -1,25 +1,124 @@  - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + { "data": { "identifier": "9e7de270-4f83-41cb-b606-2f90631f26e2", "status": "created", @@ -45,7 +144,7 @@ "finishedAt": "2019-08-24T14:15:22Z", } } - + { "data": [ @@ -113,8 +212,8 @@ } } - - { + + { "data": { "identifier": "9e7de270-4f83-41cb-b606-2f90631f26e2", "status": "created", @@ -132,7 +231,6 @@ "skipApprovedTranslations": true, "translateUntranslatedOnly": true, "translateWithPerfectMatchOnly": true, - "markAddedTranslationsAsDone": true, "labelIds": [2, 3], "excludeLabelIds": [4] }, @@ -142,5 +240,5 @@ "finishedAt": "2019-08-24T14:15:22Z" } } - + \ No newline at end of file diff --git a/tests/Crowdin.Api.Tests/Translations/TranslationsApiTests.cs b/tests/Crowdin.Api.Tests/Translations/TranslationsApiTests.cs index 1600622e..5207d483 100644 --- a/tests/Crowdin.Api.Tests/Translations/TranslationsApiTests.cs +++ b/tests/Crowdin.Api.Tests/Translations/TranslationsApiTests.cs @@ -1,4 +1,4 @@ - + using System; using System.Collections.Generic; using System.Linq; @@ -66,7 +66,6 @@ public async Task UploadTranslations() FileId = 56, AutoApproveImported = false, ImportEqSuggestions = false, - MarkAddedTranslationsAsDone = false, StorageId = 34, TranslateHidden = false }; @@ -159,7 +158,6 @@ public async Task GetPreTranslationStatus() Assert.True(attributes.SkipApprovedTranslations); Assert.True(attributes.TranslateUntranslatedOnly); Assert.True(attributes.TranslateWithPerfectMatchOnly); - Assert.True(attributes.MarkAddedTranslationsAsDone); Assert.Equal(2, attributes.LabelIds.Length); Assert.Contains(2, attributes.LabelIds);