-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Situation
- There is the NextcloudSwiftUI Swift package which contains an Xcode string catalog to manage localizable texts.
- On Transifex, 108 languages are 100% translated (due to another separate issue of all translated strings having the source language key as their value).
Expectation
When I pull the translations from Transifex with its CLI in the NextcloudSwiftUI repository clone root directory with the following command, then the string catalog translation values for all of the languages (which are not the source language) are updated to the value on Transifex or completely omitted in case of missing translations.
tx pull --force --allReality
When I pull the translations from Transifex with its CLI in the NextcloudSwiftUI repository clone root directory with the following command, then the string catalog translation values are emptied.
tx pull --force --allExcerpt from the resulting changes:
diff --git a/Sources/SwiftNextcloudUI/Localizable.xcstrings b/Sources/SwiftNextcloudUI/Localizable.xcstrings
index 33147c9..43a0510 100644
--- a/Sources/SwiftNextcloudUI/Localizable.xcstrings
+++ b/Sources/SwiftNextcloudUI/Localizable.xcstrings
@@ -12,259 +12,259 @@
"af": {
"stringUnit": {
"state": "translated",
- "value": "Accounts"
+ "value": ""
}
},
"an": {
"stringUnit": {
"state": "translated",
- "value": "Accounts"
+ "value": ""
}
},
"ar": {
"stringUnit": {
"state": "translated",
- "value": "الحسابات"
+ "value": ""
}
},Example
Without any changes, having the string catalog of the aforementioned project, I manually add a new string "Oh no!" to the catalog in Xcode.
"Oh no!" : {
"comment" : "Transifex CLI Test",
"extractionState" : "manual"
},Without any translations, this is it. Adding a German translation manually changes it to this:
"Oh no!" : {
"comment" : "Transifex CLI Test",
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Oh nein!"
}
}
}
},In Xcode itself, it is not possible to enter an empty text in the user interface. Manually changing the value to an empty string in the JSON file results in the string as being regarded translated with an empty string in German (which does not make sense in this case). I guess Transifex CLI should completely omit the de translation dictionary instead of adding an empty string value for the key.
References
- Apple documentation on string catalogs: https://developer.apple.com/documentation/xcode/localizing-and-varying-text-with-a-string-catalog
- Transifex documentation on string catalogs: https://help.transifex.com/en/articles/9459174-xcode-strings-catalogs-xcstrings#h_434bfebb34