Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird iOS warning: "ITMS-90176: Unrecognized Locale" #31

Open
dylmye opened this issue Dec 4, 2024 · 4 comments
Open

Weird iOS warning: "ITMS-90176: Unrecognized Locale" #31

dylmye opened this issue Dec 4, 2024 · 4 comments

Comments

@dylmye
Copy link

dylmye commented Dec 4, 2024

Hi! Thanks for this great package. I am trying to use it in an Expo app, and have set up the plugin like so:

[
  "react-native-localization-settings",
  {
    "languages": ["en", "fr"]
  }
]

When I build and submit to App Store, I get this message:

Although delivery was successful, you may want to correct the following issues in your next delivery. Once you've corrected the issues, upload a new binary to App Store Connect.

ITMS-90176: Unrecognized Locale - - The locale names used in localization directories at [Payload/SetlistSherlock.app/base.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.

When I download the build from EAS this is what that directory looks like:

image

In Xcode this is how localisation looks after running expo prebuild:

image

Is there anything I'm doing wrong here? If it matters I'm on latest Expo 52 and using new architecture. Thanks in advance :)

@medomy
Copy link

medomy commented Dec 17, 2024

@dylmye ,, Have you found a solution for this issue I'm kinda facing the same one now

@dylmye
Copy link
Author

dylmye commented Dec 17, 2024

@medomy nope :(

@bugrafelekoglu
Copy link

I also got this warning on my latest submission. Using Expo 52.

@teojiesern
Copy link

I've created a PR that should solve the issue, attached the patch to be used before the PR gets merged in

diff --git a/node_modules/react-native-localization-settings/plugin/build/ios.js b/node_modules/react-native-localization-settings/plugin/build/ios.js
index f9a3315..3a04fed 100644
--- a/node_modules/react-native-localization-settings/plugin/build/ios.js
+++ b/node_modules/react-native-localization-settings/plugin/build/ios.js
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
 exports.withIosLanguages = void 0;
 const config_plugins_1 = require("@expo/config-plugins");
 const generateLocalizableContent = (languages) => `{
-  "sourceLanguage" : "Base",
+  "sourceLanguage" : "${languages[0]}",
   "strings" : {
     "react-native-localization-settings" : {
       "extractionState" : "manual",
       "localizations" : {
-        "base" : {"stringUnit" : {"state" : "translated","value" : ""}},
         ${languages
     .map((lang) => `"${lang}" : {"stringUnit" : {"state" : "translated","value" : ""}},`)
     .join('\n        ')}
@@ -23,7 +22,7 @@ const withIosLanguages = (config, { languages = [] } = {}) => {
         const projectObject = project.pbxProjectSection()[project.getFirstProject().uuid];
         if (projectObject) {
             // Add known regions to the project
-            projectObject.knownRegions = ['Base', ...languages];
+            projectObject.knownRegions = languages;
             // Write the Localizable.xcstrings file
             config_plugins_1.IOSConfig.XcodeProjectFile.createBuildSourceFile({
                 project,
diff --git a/node_modules/react-native-localization-settings/plugin/src/ios.ts b/node_modules/react-native-localization-settings/plugin/src/ios.ts
index 6caae2a..e6d0313 100644
--- a/node_modules/react-native-localization-settings/plugin/src/ios.ts
+++ b/node_modules/react-native-localization-settings/plugin/src/ios.ts
@@ -5,12 +5,11 @@ import {
 } from '@expo/config-plugins';
 
 const generateLocalizableContent = (languages: string[]) => `{
-  "sourceLanguage" : "Base",
+  "sourceLanguage" : "${languages[0]}",
   "strings" : {
     "react-native-localization-settings" : {
       "extractionState" : "manual",
       "localizations" : {
-        "base" : {"stringUnit" : {"state" : "translated","value" : ""}},
         ${languages
           .map(
             (lang) =>
@@ -32,7 +31,7 @@ export const withIosLanguages: ConfigPlugin<{
       project.pbxProjectSection()[project.getFirstProject().uuid];
     if (projectObject) {
       // Add known regions to the project
-      projectObject.knownRegions = ['Base', ...languages];
+      projectObject.knownRegions = languages;
 
       // Write the Localizable.xcstrings file
       IOSConfig.XcodeProjectFile.createBuildSourceFile({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants