# Xcstrings again

**URL:** <https://community.transifex.com/t/xcstrings-again/4252>\
**Category:** Q&A\
**Created:** [October 24, 2024, 12:36pm UTC](https://community.transifex.com/t/xcstrings-again/4252 "2024-10-24T12:36:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas.mueller](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/thomas.mueller/32/3184_2.png) [@thomas.mueller](https://community.transifex.com/u/thomas.mueller)\
**Post date:** [October 24, 2024, 12:36pm UTC](https://community.transifex.com/t/xcstrings-again/4252/1 "2024-10-24T12:36:34Z")

</div>

Hello,

We are facing a few more issues with xcstrings lately:

1. We have nb\_NO as language in Transifex. When pulling the xcstrings file we see nb\_NO and nb-NO. Where is this duplication coming from?
2. When pushing this file then back to transifex we get errors: “owncloud-ios.sdk - failed to upload of resource ‘o:owncloud-org:p:owncloud-ios:r:sdk’ - parse\_error: Multiple different entries for language code: nb\_no or NB\_NO”
3. lang\_map does not seem to work - we only want to see nb-NO which is the language code how xcode understands them

Thanks a lot,

Thomas Müller

> <https://github.com/owncloud/ios-sdk/blob/master/.tx/config>

> <https://github.com/owncloud/ios-sdk/blob/master/ownCloudSDK/Resources/Localizable.xcstrings>

---

<div class="post-metadata">

**Author:** ![colvera](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/colvera/32/3187_2.png) [@colvera](https://community.transifex.com/u/colvera)\
**Post date:** [October 24, 2024, 6:03pm UTC](https://community.transifex.com/t/xcstrings-again/4252/2 "2024-10-24T18:03:12Z")

</div>

Hi @thomas.mueller

My name is Carlos from Transifex support, can you share please how are you handling the lang\_map in your config file?

I’m attendant to your comments,  
Kind regards

---

<div class="post-metadata">

**Author:** ![thomas.mueller](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/thomas.mueller/32/3184_2.png) [@thomas.mueller](https://community.transifex.com/u/thomas.mueller)\
**Post date:** [October 25, 2024, 6:25am UTC](https://community.transifex.com/t/xcstrings-again/4252/3 "2024-10-25T06:25:01Z")

</div>

Hi,

I tried mutliple different lang\_map settings - they are simply not applied from what I can tell.  
One try: lang\_map = nb\_NO: nb-NO, nn\_NO: nn-NO, pt\_PT: pt-PT, pt\_BR: pt-BR

Thanks a lot,

Thomas

---

<div class="post-metadata">

**Author:** ![chrisb](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/chrisb/32/2377_2.png) [@chrisb](https://community.transifex.com/u/chrisb)\
**Post date:** [October 31, 2024, 11:37am UTC](https://community.transifex.com/t/xcstrings-again/4252/4 "2024-10-31T11:37:30Z")

</div>

Dear Thomas,

I hope you are well.  
We have tried to reproduce the issue you have mentioned but could not.

Is it possible that you share with us at [support@transifex.com](mailto:support@transifex.com) the original source file , that you first uploaded to Transifex? Have you done any mapping via xcode, besides your tries with lang\_map via our Go Cli?

Is the xcstrings file at any point used to export anything new from inside xcode after it has been downloaded from Transifex?

Looking forward to your response. Feel free to share all details directly to [support@transifex.com](mailto:support@transifex.com)

Kind regards

---

<div class="post-metadata">

**Author:** ![thomas.mueller](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/thomas.mueller/32/3184_2.png) [@thomas.mueller](https://community.transifex.com/u/thomas.mueller)\
**Post date:** [November 5, 2024, 11:30pm UTC](https://community.transifex.com/t/xcstrings-again/4252/5 "2024-11-05T23:30:04Z")

</div>

Hey Chris,

thanks for your support!  
All files are in the linked GitHub repository - what else can I provide?

As per git history this is the version which was uploaded to Transifex first: [ios-sdk/ownCloudSDK/Resources/Localizable.xcstrings at 52994ee2cdbd6bd7d5611f78c25949d01f9d04e4 · owncloud/ios-sdk · GitHub](https://github.com/owncloud/ios-sdk/blob/52994ee2cdbd6bd7d5611f78c25949d01f9d04e4/ownCloudSDK/Resources/Localizable.xcstrings)

Let me know if you need any more information.

THX a lot

---

<div class="post-metadata">

**Author:** ![thomas.mueller](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/thomas.mueller/32/3184_2.png) [@thomas.mueller](https://community.transifex.com/u/thomas.mueller)\
**Post date:** [November 5, 2024, 11:34pm UTC](https://community.transifex.com/t/xcstrings-again/4252/6 "2024-11-05T23:34:11Z")

</div>

And with the first tx pull nb-NO and nb\_NO appeared - from this day on the file was basically broken and could no longer be pushed back to transifex.

> <https://github.com/owncloud/ios-sdk/blob/f814237dd71f850aad0b1d86f6c1060307508fcd/ownCloudSDK/Resources/Localizable.xcstrings>

---

<div class="post-metadata">

**Author:** ![chrisb](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/chrisb/32/2377_2.png) [@chrisb](https://community.transifex.com/u/chrisb)\
**Post date:** [November 6, 2024, 1:28pm UTC](https://community.transifex.com/t/xcstrings-again/4252/7 "2024-11-06T13:28:40Z")

</div>

Dear Thomas,

Apologies that this took a while.  
We managed to reproduce the issue. It is not the client itself that caused the addition of the Transifex locales. In our tests, the client on local directories and outside Github repos did not cause the same behavior.

This is still under investigation. It is a combination of the file format and locale mappings used while syncing to Github.

In regards to the failure to upload back to Transifex. This is expected. You will need to manually remove one of the locales nn\_NO or nn-NO so that it will be uploaded. I recommend removing the nn\_NO locale from the file, as I presume you need the nn-NO mapping for using this in your project. Same for the rest mapped locales.

Then, you can upload it to Transifex. Do not use locale mapping. Transifex will map by itself the nn\_NO locale with the files nn-NO. Rest of the locale mappings will follow same logic. If everything goes well all similar locales will map automatically.

Give it a try, and let us know if you see any issues again.

---

<div class="post-metadata">

**Author:** ![thomas.mueller](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/thomas.mueller/32/3184_2.png) [@thomas.mueller](https://community.transifex.com/u/thomas.mueller)\
**Post date:** [November 8, 2024, 1:35pm UTC](https://community.transifex.com/t/xcstrings-again/4252/8 "2024-11-08T13:35:46Z")

</div>

Hi Chris,

thanks a lot for your feedback!

To clarify - we are purly using the tx cli tool to push and pull. The github action we are using in our workflows are calling tx. So we are not using the transifex github integration (which btw does not support xcstrings…)

We for sure can change the file content and remove nn\_NO - but on the next pull we get it back. So we need to implement some jq-fu. Let’s see.

But may I ask why nn\_NO and nn-NO is of any issue when we push the source which is en? Kind of weird …

Thanks a lot & enjoy the upcoming weekend,

Thomas

---

<div class="post-metadata">

**Author:** ![chrisb](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/chrisb/32/2377_2.png) [@chrisb](https://community.transifex.com/u/chrisb)\
**Post date:** [November 8, 2024, 1:47pm UTC](https://community.transifex.com/t/xcstrings-again/4252/9 "2024-11-08T13:47:10Z")

</div>

Dear Thomas,

No misconception here. I understand that you are not using the github integration and only the cli to push and pull.

I also made tests alone with cli. Since the issue is not reproducable when the cli is used outside Github, I then checked what happens with github repo in the “picture”. So the error is observed once github repo is in the loop.

For the project to work again normally please make sure to have a clean file (meaning an xcstrings file with only nn-NO, pt-BR inside like the original you had uploaded).

> But may I ask why nn\_NO and nn-NO is of any issue when we push the source which is en? Kind of weird …

XCstrings is a kind of unique file format because you have everything in one file. Source strings and translations. That is why you get the error, because translations are inside no matter what. And the erroneous file right now includes both nn\_NO and nn-NO.

So, at this point you will need to clean up the last version of the file you have and please , make sure to make a new upload to the project on Transifex. Because, right now both files on Transifex and on Github side, have these additional locales. They have been corrupted.

I would recommend to erase the resource from Transifex and make a new upload. After that you can again try to push pull without and language mappings and let us know if you again face anything like that.

Kind regards

---

<div class="post-metadata">

**Author:** ![thomas.mueller](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/thomas.mueller/32/3184_2.png) [@thomas.mueller](https://community.transifex.com/u/thomas.mueller)\
**Post date:** [November 8, 2024, 3:55pm UTC](https://community.transifex.com/t/xcstrings-again/4252/10 "2024-11-08T15:55:28Z")

</div>

Hi Chris,

we just successfully pushed the source language [[fix/transifex-duplicate-keys] Remove duplicate locale keys before pu… · owncloud/ios-sdk@1f12f5c · GitHub](https://github.com/owncloud/ios-sdk/actions/runs/11745317936/job/32722454424)

Thanks,

Thomas

---

<div class="post-metadata">

**Author:** ![colvera](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/colvera/32/3187_2.png) [@colvera](https://community.transifex.com/u/colvera)\
**Post date:** [November 8, 2024, 4:28pm UTC](https://community.transifex.com/t/xcstrings-again/4252/11 "2024-11-08T16:28:00Z")

</div>

Hi @thomas.mueller

My name is Carlos from Transifex Support; I’ll step in while Christos is OOO. I’m glad to read that you can successfully push the source language.

In case you need any further assitance please feel free to write us again,

Best regards,  
Carlos

---

<div class="post-metadata">

**Author:** ![brentnaomi](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/brentnaomi/32/3271_2.png) [@brentnaomi](https://community.transifex.com/u/brentnaomi)\
**Post date:** [November 13, 2024, 5:42am UTC](https://community.transifex.com/t/xcstrings-again/4252/12 "2024-11-13T05:42:22Z")

</div>

> [@thomas.mueller](#):
>
> We are facing a few more issues with xcstrings lately:
> 
> 1. We have nb\_NO as language in Transifex. When pulling the xcstrings file we see nb\_NO and nb-NO. Where is this duplication coming from?
> 2. When pushing this file then back to transifex we get errors: “owncloud-ios.sdk - failed to upload of resource ‘o:owncloud-org:p:owncloud-ios:r:sdk’ - parse\_error: Multiple different entries for language code: nb\_no or NB\_NO”
> 3. lang\_map does not seem to work - we only want to see nb-NO which is the language code how xcode understands them

Consistent Language Codes: Make sure that the language codes you use for your project are the same. Update all references to utilize the same code and stick to a single format, either nb\_NO or nb-NO.

Update the configuration for lang\_map: Make sure your lang\_map setting is formatted appropriately by checking it again. For instance:

Lang\_map = nb\_NO: nb-NO, nn\_NO: nn-NO in plaintext  
Speak with Transifex Support: It would be preferable to contact Transifex support for help if the problem continues. They can help fix the duplication problem and offer more detailed instructions.

---

<div class="post-metadata">

**Author:** ![chrisb](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/chrisb/32/2377_2.png) [@chrisb](https://community.transifex.com/u/chrisb)\
**Post date:** [February 5, 2025, 11:32am UTC](https://community.transifex.com/t/xcstrings-again/4252/13 "2025-02-05T11:32:08Z")

</div>

Dear Thomas,

I am glad to report that a fix has been deployed for this issue.  
Give it a go and use again locale mappings if you wish in a test file.  
We remain at your disposal in case you observe anything else out of the ordinary.

Kind regards
