Skip to content

Commit

Permalink
Merge pull request #31 from stelabouras/fix/keep-translations
Browse files Browse the repository at this point in the history
Resolve --keep-translations argument issue
  • Loading branch information
Nikos Vasileiou authored Mar 7, 2024
2 parents 4af4e42 + 5888c34 commit 59dc221
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ always be able to export the source locale from the Xcode project.
- Fixes the issue where leading and trailing white space was being added around
the extracted ICU pluralization rules.

## Transifex Command Line Tool 2.1.3
## Transifex Command Line Tool 2.1.4

*October 30, 2023*
*March 7, 2024*

- Adds `--base-sdk` option to `push` command so that developers can specify the
sdk to be used when exporting localizations.
- Addresses issue with the `--keep-translations` option of the `push` command
due to inversion. The option has been replaced by the `--delete-translations`
option, in order to allow the underlying `keep_translations` meta flag to be
set to `false`.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/transifex/transifex-swift",
"state": {
"branch": null,
"revision": "aa97b51b642f3865cc9810d7e07ab2d33d6db215",
"version": "2.0.0"
"revision": "4490b3ed7abae304e9bb3fed02882320b1df224e",
"version": "2.0.1"
}
}
]
Expand Down
14 changes: 7 additions & 7 deletions Sources/TXCli/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ that can be bundled with the iOS application.
The tool can be also used to force CDS cache invalidation so that the next pull
command will fetch fresh translations from CDS.
""",
version: "2.1.3",
version: "2.1.4",
subcommands: [Push.self, Pull.self, Invalidate.self])
}

Expand Down Expand Up @@ -143,13 +143,13 @@ content to occurrences of existing strings instead of overwriting them.
private var overrideOccurrences: Bool = false

@Flag(name: .long, help: """
If keep-translations: true (default), then preserve translations on source
content updates.
If keep-translations: false, then delete translations on source string content
If delete-translations: true, then delete translations on source string content
updates.
If delete-translations: false (default), then preserve translations on source
content updates.
""")
private var keepTranslations: Bool = true
private var deleteTranslations: Bool = false

@Flag(name: .long, help: """
Emulate a content push, without doing actual changes.
Expand Down Expand Up @@ -293,7 +293,7 @@ Emulate a content push, without doing actual changes.
let configuration = TXPushConfiguration(purge: purge,
overrideTags: overrideTags,
overrideOccurrences: overrideOccurrences,
keepTranslations: keepTranslations,
keepTranslations: !deleteTranslations,
dryRun: dryRun)

logHandler.verbose("Push configuration: \(configuration.debugDescription)")
Expand Down

0 comments on commit 59dc221

Please sign in to comment.