colaxy_localization 0.1.0+1
colaxy_localization: ^0.1.0+1 copied to clipboard
'A pkg in Coin Galaxy.'
colaxy_localization #
A comprehensive Flutter/Dart localization tool that automates the generation of app store metadata and native app name localizations for both iOS and Android platforms. Part of the Coin Galaxy (Colaxy) ecosystem.
Features #
- 🌍 Multi-language Support: Manages localizations for multiple languages including Chinese (Simplified/Traditional), Japanese, English, Turkish, Portuguese, Spanish, Korean, Vietnamese, and Russian
- 📱 Native App Name Localization: Automatically generates localized app names for both iOS (
InfoPlist.strings) and Android (strings.xml) - 🚀 Fastlane Integration: Generates all required metadata files for Fastlane deployment to App Store and Google Play
- ✅ Validation: Built-in character limit validation for all metadata fields
- 🔄 Android Manifest Management: Automatically updates
AndroidManifest.xmlto use localized app names - 🍎 iOS Info.plist Management: Updates iOS
Info.plistwith supported locales and display names - 📝 Store Metadata Generation: Generates app descriptions, release notes, keywords, promotional text, and more
Installation #
Add to your pubspec.yaml:
dependencies:
colaxy_localization: ^0.1.0
Then run:
dart pub get
Project Structure #
Your Flutter/Dart project should have the following structure:
your_project/
├── assets/
│ └── localizations/
│ ├── en-US.json
│ ├── zh-CN.json
│ ├── ja-JP.json
│ └── ... (other locale files)
├── android/
│ └── app/
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ └── res/
│ ├── values/
│ │ └── strings.xml
│ ├── values-zh-rCN/
│ │ └── strings.xml
│ └── ... (other locale folders)
├── ios/
│ └── Runner/
│ ├── Info.plist
│ ├── zh-Hans.lproj/
│ │ └── InfoPlist.strings
│ └── ... (other .lproj folders)
└── fastlane/
└── metadata/
├── android/
│ ├── en-US/
│ ├── zh-CN/
│ └── ...
└── ios/ (or platform-specific)
├── en-US/
├── zh-Hans/
└── ...
Localization JSON Format #
Each locale file (e.g., assets/localizations/en-US.json) should contain the following fields:
{
"app_name": "MyApp",
"store_app_name": "MyApp - Subtitle",
"store_description": "Full description of your app (max 4000 chars)",
"store_release_note": "What's new in this version",
"store_android_short_description": "Short desc (max 80 chars)",
"store_ios_subtitle": "iOS subtitle (max 30 chars)",
"store_ios_keywords": "keyword1,keyword2,keyword3",
"store_ios_promotional_text": "Promotional text (max 170 chars)",
"store_ios_support_url": "https://support.example.com",
"store_ios_privacy_url": "https://privacy.example.com"
}
Field Specifications #
| Field | Platform | Max Length | Description |
|---|---|---|---|
app_name |
iOS, Android | 30 | Native app name displayed on device |
store_app_name |
App Store, Play Store | 30 | App name in stores |
store_description |
iOS, Android | 4000 | Full app description |
store_release_note |
iOS, Android | - | What's new |
store_android_short_description |
Android | 80 | Short description for Play Store |
store_ios_subtitle |
iOS | 30 | App subtitle for App Store |
store_ios_keywords |
iOS | 100 | Comma-separated keywords |
store_ios_promotional_text |
iOS | 170 | Promotional text |
store_ios_support_url |
iOS | 255 | Support URL |
store_ios_privacy_url |
iOS | 255 | Privacy policy URL |
Note: iOS keywords cannot contain blacklisted words: "google", "apple", "android", "ios"
Usage #
As a Library #
import 'package:colaxy_localization/colaxy_localization.dart';
void main() {
// Get all locale units from assets/localizations
final localeApp = LocaleApp();
final localeUnits = localeApp.getLocaleUnits();
// Generate all localization files
for (final unit in localeUnits) {
unit.fitAllToFastlane();
}
print('Localization files generated successfully!');
}
Using the Command-line Tool #
Run the generator from your project root:
dart run colaxy_localization:gen
This will:
- Read all JSON files from
assets/localizations/ - Generate Android
strings.xmlfiles for each locale - Generate iOS
InfoPlist.stringsfiles for each locale - Update
AndroidManifest.xmlto reference localized app names - Update iOS
Info.plistwith supported locales - Generate all Fastlane metadata files
Supported Locales #
iOS Locale Mapping #
| Standard Locale | iOS Locale |
|---|---|
zh-CN |
zh-Hans |
zh-TW |
zh-Hant |
ja-JP |
ja |
en-US |
en-US |
tr-TR |
tr |
pt-PT |
pt-PT |
es-ES |
es-ES |
ko-KR |
ko |
vi-VN |
vi |
ru-RU |
ru |
Android Locale Mapping #
| Standard Locale | Android Locale |
|---|---|
zh-CN |
zh-rCN |
zh-TW |
zh-rTW |
ja-JP |
ja |
tr-TR |
tr |
pt-PT |
pt-rPT |
es-ES |
es-rES |
ko-KR |
ko |
vi-VN |
vi |
ru-RU |
ru |
Advanced Features #
Minimum Version Support #
Add a minimum_version field to your pubspec.yaml:
name: my_app
version: 1.2.0
minimum_version: 1.0.0
This will automatically append minimum version information to store descriptions:
- Android:
[Minimum supported app version: 1.0.0] - iOS:
[:mav: 1.0.0]
Main Locale Detection #
- If only one locale file exists, it's automatically set as the main locale
- If multiple locales exist,
en-USis used as the main locale - The main locale updates the default app name in native configuration files
Generated Files #
Android #
android/app/src/main/res/values/strings.xml(default)android/app/src/main/res/values-{locale}/strings.xml(localized)fastlane/metadata/android/{locale}/title.txtfastlane/metadata/android/{locale}/full_description.txtfastlane/metadata/android/{locale}/short_description.txtfastlane/metadata/android/{locale}/changelogs/default.txt
iOS #
ios/Runner/Info.plist(updated with supported locales)ios/Runner/{locale}.lproj/InfoPlist.stringsfastlane/metadata/{locale}/name.txtfastlane/metadata/{locale}/description.txtfastlane/metadata/{locale}/subtitle.txtfastlane/metadata/{locale}/keywords.txtfastlane/metadata/{locale}/promotional_text.txtfastlane/metadata/{locale}/support_url.txtfastlane/metadata/{locale}/privacy_url.txtfastlane/metadata/{locale}/release_notes.txt
Example #
See the included example in the bin/gen.dart file for a complete working implementation.
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Support #
Related Projects #
Part of the Coin Galaxy (Colaxy) ecosystem - check out other Colaxy packages!