Flutter is a relatively young yet quite full of promise and functional allure platform. Due to its simplicity, similar to web apps development, and quick performance equal to native applications, this open-source framework has gained many dedicated users over the last few years, which resulted in quite a few Flutter apps.
To reach an even bigger amount of global customers and make sure anyone whose native language isn’t English can fully enjoy everything this tool has to offer, Flutter localization and internationalization for your apps are necessary. Let’s take a closer look at what that is and how it’s supposed to be done.
Introduction to Flutter Localization and Flutter Internationalization
User experience appropriately remains one of the top objectives and responsibilities among both designers and developers, which means accomodating a platform to the local or multilingual needs of your users has to be a priority.
If you’re looking for an effective and user-friendly cross-platform solution, Flutter is arguably one of the best frameworks you can find on the market right now. This mobile, web, and desktop app development tool helps the result of your development work look and perform great on any device.
The Flutter in-app localization mechanism is slightly different from those of other native apps. Its native localization package contains multiple localization points for widgets. Check out this document for the list of currently supported locales.
To ensure an easier Flutter internationalization and localization processes, you need to pay attention to your layouts and text design while you are still writing your app’s original version. There are available classes and widgets for that, as well as already internationalized libraries.
Differentiating Between Internationalization and Localization
Despite having seemingly similar connotations, internationalization and localization are not interchangeable terms. However, they are quite complementary in app development and are used one right after the other to ensure a smoother app adaptation.
In computing, these two terms are also known as i18n and l10n, respectively. These abbreviations are made of the first and the last letter of the word, between which is the number that is actually the number of letters between them.
The main difference between internationalization and localization is that internationalization is done by developers and localization - by translators that know the linguistic and stylistic differences between chosen languages.
Internationalization is the preparatory process of customizing your code that is set up before localizing the app to make it susceptible to modifications. It consists of methodologies and strategic groundwork that helps avoid or solve such potential problems, as encoding difficulties, lack of hardware support in certain countries, or not enough space for alternatively sized text.
Localization is a series of steps that help add support for different languages, regions, and scripts. It is the subsequent process of utilizing all the previous adjustments and adapting the app to cultural, stylistic, linguistic, structural, or even legal requirements of another language.
Internationalization and Localization Examples
The most widespread Flutter localization example and method nowadays is the one using the official supplementary Intl translation package with Intl library from the Dart team. The most essential thing you have to do before internationalization is to set apart the source code from the bits of text you need to translate.
The internationalization framework will usually use the Application Resource Bundle file format based on JSON and the Localizations widget inside MaterialApp. The JSON file will later contain the translated strings. LocalizationsDelegate class will notify the MaterialApp and help you create a class containing dynamic string properties or functions for every translatable text of your app.
You should also prepare the design of the pages you’re about to edit and translate. The text may be shorter or longer than the original source, it may contain non-cyrillic letters, be right-to-left, or require contextual shaping. Other important elements to be aware of:
- Plural definitions and quantity names;
- Genders of both individuals, animate, and inanimate objects;
- Standart and phone numbers;
- Currency values;
- Date and time formats - different order of writing and separating time;
- Units of measurement - metric or imperial;
Here are also a few heavily code-based instructions and examples for you to choose from if you decide to internationalize and localize your Flutter app by yourself:
- Flutter internationalization example and guide by Flutter itself;
- This helpful tutorial from Localise;
- This guide that’s a part of a large Flutter development series;
- The guide from Phrase’s blog.
If you’re a Flutter app development company, then you definitely realize the importance of localizing and internationalizing your apps when you have users from different countries. Among all the distinct ways to do it that are currently circling the Internet, there should be a method or two that will better suit your needs. If you have any questions, don’t hesitate and click this link to contact us.