1

We developed an app using Flutter and Apple refused it because the app is in Brazilian Portuguese language but the permission dialogs like use location permission or notifications permissions are in English.

We tried installing the flutter_localizations package and changing the info.plist. These are the changes we made:

Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'My App',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: AppStateContainer.of(context).page,
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: [Locale('pt', 'BR'),],
    );
  }

On info.plist:

<key>CFBundleLocalizations</key>
    <array>
        <string>pt_BR</string>
    </array>

None of these steps worked. On iOS the permission dialogs are still in English. The iOS device that we are testing is in Portuguese and the region is Brazil.

ParuFrade
  • 21
  • 1
  • 4

3 Answers3

1

Few easy steps:

  1. Open Xcode
  2. Create a Strings file in ios/Runner called "InfoPlist.strings"
  3. Click on Runner then info. Here you see "Localizations", add Brazilian Portuguese and select the new file you created before. This will generate two different files under InfoPlist.strings, one for English and one for Brazilian Portuguese.

Now in each of these file you have to add the KEY and the VALUE in that language, for example in InfoPlist.strings (English):

NSCameraUsageDescription = "Need to upload image for your profile image";

NSLocationAlwaysUsageDescription = "Need to access to location to show you near venues";

Then iOS will automatically look into these files for the localized values. You don't need to do nothing more, so simply look in Info.plist what keys you need to localize and copy those in the new files.

Luca Oropallo
  • 474
  • 4
  • 12
0

Permission dialog in iOS use string in Info.plist not text on Flutter code. So you must localize the your Info.plist file.

In your case. Do these steps:

  1. Open xCode project on iOs folder of your Flutter project
  2. Select the project, then Info.
  3. In the Localization section, add new language. pt_BR on your app.
  4. You will see a dialog that ask to chose file for localization. Select Info.plist.
  5. Open Info.plist for pt-Br. Add or localize these tags:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>your pt-Br text</string>
<key>NSLocationUsageDescription</key>
<string>your pt-Br text</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>your pt-Br text</string>

Check these topics for more details:

https://medium.com/@guerrix/info-plist-localization-ad5daaea732a

How to localise a string inside the iOS info.plist file?

Long Phan
  • 857
  • 7
  • 6
0

Permission dialog in iOS except for the parts that can be customized, the rest of the language is the same as the language selected by the mobile phone system. But when you are in Debug, it may still be in English. Probably because of the Development Language selected in Localizations in Project. But the Release package you send should be the same as the phone system language.