To localize the app name in a Flutter project, you'll need to modify the Android and iOS sections of your code. This process is not related to Flutter itself, but rather to the specific platforms your app is running on.
To begin, you'll need to add translations of your app name for each language you want to support in both the Android and iOS sections of your project. These translations should be included in the appropriate resource files for each platform (e.g., strings.xml for Android and InfoPlist.strings for iOS).
It's important to note that the app name will change based on the user's device language, not the app's language. So if a user switches their device's language setting from English to French, for example, the app name will automatically update to its French translation.
By following these steps, you can ensure that your Flutter app's name is properly localized and easily accessible to users in their preferred language.
Navigate to the android\app\src\main\res\values.
Add file strings.xml inside the values folder.
Update the strings.xml file.
Copy values folder for each locale you want to add and update strings.xml files with the translated app name.
Update android:label within android\app\src\main\AndroidManifest.xml file.
Run the app and see how app name changes when device language changes.
Update CFBundleDisplayName within ios\Runner\Info.plist file.
Create a new directory within the Runner directory called Resources.
Within the Resources directory, create a new file called InfoPlist.strings. This file will contain the translations of your app name.
For each locale you want to support, create a new directory within the Resources directory with the name of the language (e.g., en.lproj for English).
Within each language directory, create a new file called InfoPlist.strings and add the following code:
Run the app and see how app name changes when device language changes.