About | Features | Technologies | Requirements | Starting | License | Author
Fluttermultilanguage is a sample project of Flutter application mobile and desktop that provides easy language change experience for users. Based on the Simple App State Management tutorial and built-in localization, offers settings menu where users can easily switch between different languages to cater to their preferences.
✔️ Change the app language 1;
✔️ Toggle between Light and Dark theme 2;
✔️ Access the Settings menu to customize language and theme preferences 3;\
This project utilizes the following technologies:
Before getting started, ensure that you have the following installed:
# Clone this project
$ git clone https://github.com/samuelmendespy/fluttermultilanguage
# Navigate to the project directory
$ cd fluttermultilanguage
# Install the required dependencies
$ flutter pub get
# Run the app on a physical device or emulator
$ flutter run
This app sample project generates localized messages based on arb files found in the lib/src/localization
directory.
-lib
- main.dart (Loads settings and start the app.dart - MyApp widget )
- src
- app.dart (Is the root widget with theme and localization configs.)
- settings
- settings_service.dart (Handles the user settings)
- settings_controller.dart ( Connects UI and SettingsService)
- settings_view.dart (Two dropdowmenus. Change language and theme mode)
- localization (l10n folder. Translations forsupported languages)
- sample_feature (sample list with 3 items)
To customize the app according to your needs, open the project in your favorite code editor and start exploring the codebase.
For a more detailed guide on localization, currency, time zones, and more, refer to the tutorial on Internationalizing Flutter apps
This project is under license from MIT. For more details, see the LICENSE file.
Fluttermultilanguage follows the principles of Semantic Versioning. The current version of the app is 1.0.1+1.
For more information about Flutter development, check out the comprehensive online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Fluttermultilanguage supports localization to cater to users in different regions. To add support for additional languages, follow these steps:
- Ensure your app is ready for translation or MVP (Minimum Viable Product) stage.
- Locate the code that needs translation.
- Open the corresponding app_en.arb file in the lib/src/localization directory. This file contains the default English translations.
- Insert a new line to add the translation key and your text. Format :
{
"key": "Your text",
"loginMessage": "Welcome!",
"logoutMessage": "Come back soon!"",
"appTitle": "My flutter_application_2",
"@appTitle": {
"description": "The title of the application"
}
}
- Repeat steps 2-4 to add all the text that requires translation. Make copies of the English arb file and rename them based on the language and country code (e.g., app_fr.arb for French, app_ja_JP.arb for Japanese, etc.).
You can see more language codes following the link http://www.lingoes.net/en/translator/langcode.htm
Translate and localize the strings in each language file. For a more detailed guide on localization, currency, time zones, and more, refer to the tutorial on Internationalizing Flutter apps.
LEARN MORE : The official guide Internationalizing Flutter apps and read about Flutter development on the online documentation, which offers tutorials,samples, guidance on mobile development, and a full API reference.