localingo 1.0.0
localingo: ^1.0.0 copied to clipboard
Automatic localization package for Flutter with CLI tool for generating translations using Free Translate API. Features type-safe keys, runtime locale switching, and beautiful terminal UI.
),
],
),
),
);
} }
### Placeholders & Dynamic Text
Your `en.json`:
```json
{
"greeting": "Hello, {name}!",
"items_count": "{count} items in cart"
}
Usage:
// With LocaleKeys (type-safe)
Text(LocaleKeys.greeting.replaceAll('{name}', 'John'))
Text(LocaleKeys.itemsCount.replaceAll('{count}', '5'))
// Or using the old way with string keys
Text('greeting'.tr().replaceAll('{name}', 'John'))
📖 API Reference #
LocaleKeys (Auto-Generated) #
Type-safe constants generated from your en.json:
class LocaleKeys {
static String get appName => 'app_name'.tr();
static String get welcome => 'welcome'.tr();
static String get greeting => 'greeting'.tr();
// ... all your keys
}
Usage:
// Use directly (recommended)
Text(LocaleKeys.appName)
// Or use string keys directly
Text('app_name'.tr())
🔧 Troubleshooting #
Q: Translation failed with timeout error?
- A: The free API may be rate-limited. Wait a moment and try again. The package has automatic retry logic.
Q: Some translations look wrong?
- A: Auto-translation is good but not perfect. Review and edit generated JSON files manually for production apps.
Q: Can I edit generated translations?
- A: Yes! Edit the generated
ar.json,fr.json, etc. files directly. Re-running the CLI won't overwrite them unless you delete them first.
Q: Do I need an API key?
- A: No! Multilingo is 100% free with no API keys required.
🤝 Contributing #
We welcome contributions from developers around the world! 🌍
- Fork the repository ), ], ), ), ); } }
### Placeholders & Dynamic Text
Your `en.json`:
```json
{
"greeting": "Hello, {name}!",
"items_count": "{count} items in cart"
}
Usage:
// With LocaleKeys (type-safe)
Text(LocaleKeys.greeting.replaceAll('{name}', 'John'))
Text(LocaleKeys.itemsCount.replaceAll('{count}', '5'))
// Or using the old way with string keys
Text('greeting'.tr().replaceAll('{name}', 'John'))
📖 API Reference #
LocaleKeys (Auto-Generated) #
Type-safe constants generated from your en.json:
class LocaleKeys {
static String get appName => 'app_name'.tr();
static String get welcome => 'welcome'.tr();
static String get greeting => 'greeting'.tr();
// ... all your keys
}
Usage:
// Use directly (recommended)
Text(LocaleKeys.appName)
// Or use string keys directly
Text('app_name'.tr())
🔧 Troubleshooting #
Q: Translation failed with timeout error?
- A: The free API may be rate-limited. Wait a moment and try again. The package has automatic retry logic.
Q: Some translations look wrong?
- A: Auto-translation is good but not perfect. Review and edit generated JSON files manually for production apps.
Q: Can I edit generated translations?
- A: Yes! Edit the generated
ar.json,fr.json, etc. files directly. Re-running the CLI won't overwrite them unless you delete them first.
Q: Do I need an API key?
- A: No! Multilingo is 100% free with no API keys required.
🤝 Contributing #
We welcome contributions from developers around the world! 🌍
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📞 Support & Community #
⭐ Support Localingo #
Enjoying Localingo?
Click the link below and tap the 👍 LIKE button on pub.dev — it really helps!
👉 https://pub.dev/packages/localingo
Made with ❤️ in Egypt 🇪🇬 | Spreading across the world 🌍
Breaking language barriers, one app at a time