launcher_name_plus
Localize your Flutter app's launcher name (the name under the app icon) on Android and iOS from pubspec.yaml.
This is a maintained, drop-in successor of launcher_name, which has not been updated since 1.0.2 (2023). It uses the same launcher_name configuration and writes the same files. Bada Labs uses it to ship over 100 localized app flavors.
What's different from launcher_name 1.0.2
- Special characters work. Names with
',",\,&,<or a leading@/?are escaped. In 1.0.2 a name likeL'applicationbroke the Android resource build. - No race conditions. Every file is written before the command exits.
- Failures fail. A missing
pubspec.yaml,launcher_namesection ordefaultentry exits with a non-zero code, so CI and release scripts stop instead of shipping the wrong name. - Pure Dart. No Flutter SDK dependency.
For names without special characters, the output is byte-for-byte identical to 1.0.2.
Migrating from launcher_name
- In
dev_dependencies, replacelauncher_namewithlauncher_name_plus. - Replace
dart run launcher_name:mainwithdart run launcher_name_plus:main.
Your launcher_name: section stays as it is.
Usage
1. Configure
dev_dependencies:
launcher_name_plus: ^1.0.3
launcher_name:
default: "My App" # required: used for languages without their own entry
ko: "내 앱"
ja: "マイアプリ"
fr: "L'application"
Keys are language codes (two or three lowercase letters, see ISO 639-1).
2. Run
From your app root:
dart run launcher_name_plus:main
What it writes
Android
android/app/src/main/res/values/strings.xmlwith the default name, andvalues-<lang>/strings.xmlfor each language.android:labelinAndroidManifest.xmlbecomes@string/appName.
iOS
ios/Runner/Resources/InfoPlist.stringswith the default name, and<lang>.lproj/InfoPlist.stringsfor each language.CFBundleDisplayNameinInfo.plistbecomes${PRODUCT_NAME}, so the localized strings take over.- Add the
ios/Runner/Resourcesfolder to the Runner target in Xcode once, so the.lprojfolders are bundled.
Removing a language
When you drop a language from launcher_name, its generated folder is deleted on the next run. Only folders that hold nothing but the generated file are touched, so values-night or folders with your own resources are left alone.
Scope
This package fixes bugs and keeps up with Dart, Flutter, Android and iOS changes. New features are considered conservatively to keep it small and dependable.
Credits
Based on launcher_name by OJ Creator, under the BSD 3-Clause license. Maintained by Bada Labs.
Libraries
- launcher_name_plus
- Localizes a Flutter app's launcher name on Android and iOS from the
launcher_namesection ofpubspec.yaml.