Skip to content

Commit 07bc3a7

Browse files
authored
feat: Add tmApprovedSuggestionsOnly parameter in Add Project API (#121)
1 parent 0198054 commit 07bc3a7

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

crowdin/model/projects.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type (
5252
UseGlobalTM bool `json:"useGlobalTm,omitempty"`
5353
TMContextType string `json:"tmContextType,omitempty"`
5454
ShowTMSuggestionsDialects bool `json:"showTmSuggestionsDialects,omitempty"`
55+
TmApprovedSuggestionsOnly bool `json:"tmApprovedSuggestionsOnly,omitempty"`
5556
IsSuspended bool `json:"isSuspended,omitempty"`
5657
QACheckIsActive bool `json:"qaCheckIsActive,omitempty"`
5758
QAApprovalsCount int `json:"qaApprovalsCount,omitempty"`
@@ -228,6 +229,8 @@ type ProjectsAddRequest struct {
228229
UseGlobalTM *bool `json:"useGlobalTm,omitempty"`
229230
// If true - show primary language TM suggestions for dialects if there are no dialect-specific ones. Default: true.
230231
ShowTMSuggestionsDialects *bool `json:"showTmSuggestionsDialects,omitempty"`
232+
// If true - only approved suggestions will be saved to the project default TM.
233+
TmApprovedSuggestionsOnly *bool `json:"tmApprovedSuggestionsOnly,omitempty"`
231234
// Defines whether to skip untranslated strings.
232235
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
233236
// Defines whether to export only approved strings.

crowdin/projects_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func TestProjectsService_Get(t *testing.T) {
8282
"autoTranslateDialects": true,
8383
"useGlobalTm": false,
8484
"showTmSuggestionsDialects": true,
85+
"tmApprovedSuggestionsOnly": false,
8586
"isSuspended": false,
8687
"qaCheckIsActive": true,
8788
"qaCheckCategories": {
@@ -286,6 +287,7 @@ func TestProjectsService_Get(t *testing.T) {
286287
AutoTranslateDialects: true,
287288
UseGlobalTM: false,
288289
ShowTMSuggestionsDialects: true,
290+
TmApprovedSuggestionsOnly: false,
289291
IsSuspended: false,
290292
QACheckIsActive: true,
291293
QACheckCategories: map[string]bool{
@@ -476,6 +478,7 @@ func TestProjectsService_Get_Enterprise(t *testing.T) {
476478
"hiddenStringsProofreadersAccess": true,
477479
"autoSubstitution": true,
478480
"showTmSuggestionsDialects": true,
481+
"tmApprovedSuggestionsOnly": false,
479482
"exportTranslatedOnly": false,
480483
"skipUntranslatedStrings": false,
481484
"exportWithMinApprovalsCount": 0,
@@ -675,6 +678,7 @@ func TestProjectsService_Get_Enterprise(t *testing.T) {
675678
HiddenStringsProofreadersAccess: true,
676679
AutoSubstitution: true,
677680
ShowTMSuggestionsDialects: true,
681+
TmApprovedSuggestionsOnly: false,
678682
ExportTranslatedOnly: false,
679683
SkipUntranslatedStrings: false,
680684
ExportWithMinApprovalsCount: 0,
@@ -984,6 +988,7 @@ func TestProjectsService_Add(t *testing.T) {
984988
HiddenStringsProofreadersAccess: ToPtr(false),
985989
UseGlobalTM: ToPtr(false),
986990
ShowTMSuggestionsDialects: ToPtr(true),
991+
TmApprovedSuggestionsOnly: ToPtr(false),
987992
SkipUntranslatedStrings: ToPtr(false),
988993
ExportApprovedOnly: ToPtr(false),
989994
QACheckIsActive: ToPtr(false),
@@ -1105,6 +1110,7 @@ func TestProjectsService_Add(t *testing.T) {
11051110
"hiddenStringsProofreadersAccess": false,
11061111
"useGlobalTm": false,
11071112
"showTmSuggestionsDialects": true,
1113+
"tmApprovedSuggestionsOnly": false,
11081114
"skipUntranslatedStrings": false,
11091115
"exportApprovedOnly": false,
11101116
"qaCheckIsActive": false,

0 commit comments

Comments
 (0)