Skip to content

Empty Values when Pulling Translations into Xcode String Catalog #254

@i2h3

Description

@i2h3

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 --all

Reality

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 --all

Excerpt 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions