This package allows you to add configurations and language support to your apps.
- Create a translations file at
your_flutter_project/assets/translations/en_us.yaml
.
greetings:
HelloWorld: Hello World!
- Access the translations in your app:
final translationFileReader = TranslationFileReader(
translationsDirPath: ['translations'],
fileType: ConfigFileType.YAML,
fileReader: (filePath) => rootBundle.loadString(filePath),
);
await translationFileReader.read('en_us'.toLowerCase());
print('greetings.HelloWorld'.tr());
Tip: File names are case sensitive on most Linux based systems like Firebase Hosting. Make sure to use the correct case for your file paths. As a rule of thumb, always use lowercase file paths.
🔜 Documentation and video tutorials are coming soon. Feel free to contact me for more information.
dependencies:
xyz_config: any # or the latest version
Contributions are welcome. Here are a few ways you can help:
- Report bugs and make feature requests.
- Add new features.
- Improve the existing code.
- Help with documentation and tutorials.
This project is released under the MIT License. See LICENSE for more information.
Author: Robert Mollentze
Email: robmllze@gmail.com