Crossing Boundaries with Flutter: Streamlining App Localization

App localization is your top tool to differentiate yourself in your industry and respective app market space. Your consumers ultimately invest in what they can clearly understand and participate in — making app localization one of your top priorities if you want to become an established global industry leader. 

Flutter is a powerful tool for cross-platform app development, fueling localization and optimization efforts through a series of user-friendly widgets, layouts, and more. 

In this article, we’ll be showing you the critical role that localization can play in Flutter applications, the process of localization in Flutter’s systems, and how a TMS can help — giving you a helpful how-to guide that you can leverage to break through the $496 billion app industry

The Crucial Role of Localization in Flutter Applications

Flutter is used for some of the top apps on the market today. Some examples and companies include GooglePay, ByteDance (parent company of TikTok), Realtor.com, and Square. 

Part of the reason why these companies are so successful is due to the role that localization plays in flutter applications. Some of the perks that can be associated with proper internationalization and localization techniques include: 

  • Increased consumer trust. When international consumers are able to fully interact and use a product in their own native language, businesses open the door for greater consumer confidence and an increased ability to earn. 
  • Greater profitability and longevity. These two positive implications are direct results of increased consumer trust. While you will always have competition in your respective space, quality localization via Flutter is one of the best ways to differentiate yourself and clearly set you apart as the best option in the global market. 

Implementing localization opportunities in Flutter template options and the overall process saves significant time later on in the build. Saved time results in saved cost and a greater overall rate of production efficiency and success. 

The Process of Flutter Localization

To begin the localization process, devs can download the latest version of Flutter, and the Flutter localization package. You might also want to download Dart and Intl 0.17:0 or later, as this can allow you to create custom localization elements (which can be helpful when it comes to dates and numbers). 

Once this is done, you can get started. The starter code will be located in your lib/main.dart area.

1. Begin using the widgets and make the skeletal structure for your app

This, in many cases, will look like: 

Widget build (BuildContext context) { 

Return MaterialApp(

Title: (INSERT HERE) 

Theme: ThemeData(

primarySwatch: Colors.INSERT COLOR, 

), 

Home: (INSERT NAME) (Title: INSERT NAME) 

Since Flutter is widget-based, we’ll be primarily working out of MaterialApp, using the Home name as a main route. 

2. Get acquainted with the home route 

When we open the main route, we see parameters that can be set for several different elements — such as cards, widgets, and more. 

For example, if you were to place a viewable or interactive card for coffee brewing tips in the UX design of a coffee product app, your code would look something like: 

Expanded( 

Coffee Tips: ListView( 

Brew: <widget> 

TipCard( 

Name: Temperature Control 

Information: It’s best to pull espresso shots no hotter than 120 degrees Fahrenheit. 

Additional Info: This is because too hot of a temperature can scald your brew, and too cold of a temp won’t bring out the full flavor of your beans. 

imagePath: ‘assets/images/coffee_being_brewed.jpg’,

),

Note: We don’t usually recommend manual language swaps in a mobile app, as this is uncommon and difficult to code over time as your language repertoire expands. If you choose to undertake this task, make sure you have human translators and a handy translation management system at the ready to help!

3. Complete package installation steps 

Now, it’s time to complete our final install steps. We can do this by expanding pubspec.yaml. The lines to add for this are: 

Dependencies: 

Flutter: 

SDK: Flutter 

Flutter_localizations: 

SDK: Flutter 

Intl: 0.17.0 (or current version 

Flutter: 

Generate: true 

Uses-material-design: true 

The generate:true line prompts flutter to pull out the automatic code generation in the provided localization packages. This step can save you hours of time later. 

4. Configure your preferences 

It’s time to configure where your localization package can sit, and determine the names of the dart files Flutter will generate for us. To do this, we want to add: 

Arb-dir: lib/l10n

Template-arb-file: app_en.arb

Output localization file: app_localizations.dart 

The default translations are written using the JSON-style syntax. They are housed in the Application Resource Bundle (noted as ARB above) which means that we need a template that automatically corresponds to our primary language of use. 

The next step is to create a housing directory, which is where any needed template translation items are kept. 

We’ll start with: 

appTitle: (INSERT NAME)

…but we don’t want to stop there. Collaborate with your team to determine what other languages need to be added, and begin to build it out. We don’t need to worry about RTL functionality or other elements that can be coded later. For now, we’ll keep it simple. 

appTitle: (SPANISH VERSION OF THE NAME) 

appTitle: (JAPANESE VERSION OF THE NAME) 

Note that you’ll need to provide direct translations to these other alternative code options above for the highest degree of accuracy. There is no limit to what you can add here, so long as it is configured to correspond to our lib/l10napp_<locale>.arb format. 

5. Configure the main.dart file 

The first step to do this is to import our main.dart file to our code sandbox. We do this via: 

Import ‘package:flutter/material.dart’; 

Import ‘package:flutter_localizations/flutter_localizations.dart’;

Import ‘screens/hero_list.dart’;

We can then supplement by adding our props to the constructor variable, “MaterialApp.” This will look like: 

Class MyApp extends StatelessWidget { 

@override

Widget build (BuildContext context) { 

Return MaterialApp 

Title: (INSERT NAME) 

localizationsDelegates: [ 

GlobalMaterialLocalizations.delegate,

GlobalWidgetsLocalizations.delegate,

GlobalCupertinoLocalizations.delegate

supportedLocales: [ 

Const Locale (‘en_US’,”), 

Const Locale (‘es_US’,”),*

*don’t forget to use the correct countrycode information!  

Note that all localized values for material, widgets, and Cupertino time/style have been done by the Flutter team, which is part of what makes Flutter such a powerful tool of choice. At the time of this publication, there are over 110 languages and variants supported by the Flutter app. 

At this point, you’re ready to leverage the automatic code generation and personalize your localized user experience. There are plenty of resources available on GitHub to help you do this. 

Before you do that though, we want to make sure that you’re fully aware of the challenges that you might run into on-platform. While Flutter is a powerful tool, it’s still pretty skeletal due to how new it is. Third-party libraries, at the time of this publication, might provide more value than the actual native offerings. As long as you’re aware of the potential need to supplement and update your framework, Flutter can be a powerful localization tool for many.

Source

Introduction to Translation Management Systems in App Localization

If you’re looking to localize and translate your content into different languages, you may benefit from the support that a translation management system can bring. The system can help you to easily automate, streamline, and simplify your process, resulting in more efficient and comprehensive production processes. 

Whether you’re looking to localize your app for the Android store or the Apple App Store, we’re confident that you’d be able to find benefits using a TMS for your Flutter project and localization process. It’s no easy task to consistently localize from one language to a different languagecode (such as Spanish or Japanese) — and the range of available dialects leaves many pitfalls that you can find translating and localizing manually. 

A comprehensive TMS won’t override widget build steps. Instead, it can house them and act as a communication vehicle for all members of the team to work efficiently. This includes everyone, from the project manager to the translator to the dev!

Harness OneSky’s Power for Flutter Localization

Pre-localizing sourcecode and plugin flexibility in your app development process gives you the foundation you need for rapid global expansion. Understanding the process of Flutter intl processes and the localization steps can help to ensure that your app supports users hailing from every part of the world — which is why walking through these tutorial articles is worth your time. 

Flutter offers the flexibility of an API in a user-friendly, widget-based dev format — making it relatively low-code compared to many other competitors. If you’re looking to localize your content from English to other languages, it is one of the premiere tools available to do so. 

If you’re looking for a comprehensive translation management system you can count on, the team at OneSky is here to help. We offer premier management and support solutions for your internationalization, localization, and translation needs — all through our centralized management tool for translation and dev. 

Connect with us today to get started for free. We look forward to supporting you!

Mandy Fong

Head of Sales, OneSky

Popular post

Leave a Reply

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

Resources

Localization Resources
to get you started