Check Mobile App
Read now
Start a Project

Multi-Language support in Flutter

Save

Multi-language support is an important feature to globalize the application and increase the user audience. Language is a factor that connects people and the same principle is applied to app development also. When a customer sees their native language, it creates an emotional bond with the app.

FACT

English continues to represent the most common language on the Internet, almost 75% of app users do not speak English, which leaves a considerable big market available for multilingual apps.

 

Flutter by default only provides the US English localization. For supporting other languages, the application must specify additional properties and include the package called flutter_localizations. As of November 2020, this package supports 78 languages.

Check the below code for practical implementation.

Add the below package as a dependency to your pubspec.yaml file:

In the next step, import the flutter_localizations library and specify localizationsDelegates and supportedLocales for MaterialApp:

Adding the localized messages

Once the flutter_localizations package is added, use the following instructions to add localized text to your application.

  • Add the intl package to the pubspec.yaml file:

  • Enable the generate flag in the pubspec.yaml file:

  • Add the new yaml file to the root directory of the Flutter project called l10n.yaml with the following content:

  • In ${FLUTTER_PROJECT}/lib/l10n, add the app_es.arb template file.

  • Now after running the app. A file will be generated in ${FLUTTER_PROJECT}/flutter_gen/gen_l10n after which we will start using the localization in the app.

In this way, we can support multi-languages in flutter apps.

 

Refernece

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

The support is fast and do everything in their power to make it perfect. If you need customization it's also done right away. I had massive research to select Mobikul and now I'm sure it was the right one.

Igor Souza

Igor Souza

Talk to Sales

Global

Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home