jcraane / kmm-resources

Gradle plugin for generating localizable resources for Android, iOS and Web in a Kotlin Multiplatform (Mobile) project for use in the UI, android, iOS and shared framework code.
Apache License 2.0
28 stars 6 forks source link

AppStore Deployment Issues with translations including regions #8

Closed mikelburkhart closed 3 years ago

mikelburkhart commented 3 years ago

We are attempting to deploy our app leveraging KMM resources via TestFlight to the Apple App Store and are receiving the following error message when attempting to deploy it:

10:10:23 [2021-09-08 11:10:23 EDT]

DBG-X: parameter Error= [Error ITMS-90176: "Unrecognized Locale - The locale names used in localization directories at ( "Payload/HCL Verse.app/Frameworks/MobileCommon.framework/pt-rBR.lproj", "Payload/HCL Verse.app/Frameworks/MobileCommon.framework/zh-rHK.lproj", "Payload/HCL Verse.app/Frameworks/MobileCommon.framework/zh-rTW.lproj" ) are invalid. iTunes supports BCP47 but not the UN M.49 specification. Refer to the Language and Locale Designations guide at https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html for more information on naming your language-specific directories."]

I'm attaching our stings.yaml file and you'll notice that our translations with regions include the -r in them such as pt-rBR as expected for Android but apparently iOS doesn't like this model and wants just pt-BR with no "r" in it. Hoping you can provide another update to ensure that translations with regions in them will get filtered for iOS to remove the "r" as required by Apple. yaml.zip

jcraane commented 3 years ago

Thanks for reporting. Did not know about that restriction. Just to be clear, the region pt-rBR should be translated in iOS to pt-BR?

Is that also required for the zh-rHK (becomes zh-HK) and zh-rTW (becomes zh-TW) locales in there? Perhaps there are more but I should check that separately.

mikelburkhart commented 3 years ago

Yes, your statements are all correct. The "r" needs to be removed from those for iOS files. It appears that the pattern is if there is a "-r" in the locale name then change it to just "-" instead when generating the iOS files but leave it with "-r" for Android.

jcraane commented 3 years ago

One small question: the replacement of the locales, is that in the directory structure like in the attached screenshot? Thanks.

Screen Shot 2021-09-08 at 21 50 42
mikelburkhart commented 3 years ago

Yes, that is the problem the -r in the directory names. Sorry for the confusion, I kept saying files above, and in this case its directories

jcraane commented 3 years ago

Ok, the issue is clear now! I am going to create a fix for this.

jcraane commented 3 years ago

I pubished version 1.0.0-alpha09 which should resolve this issue. Locales with pattern aa-rAA are replaced to aa-AA for IOS resource folders. If there are still issues with this please let me know. (I am unable to create an iOS release at the moment myself)

mikelburkhart commented 3 years ago

I have verified the fix locally and also confirmed that the error is gone when attempting to upload to TestFlight. Thanks again!