How To Localize Your Flutter App

Chatura Dilan Perera
1 min readMar 20, 2019

--

One of the things that I struggle with Flutter first was how to localize the application. But it was very easy with Flutter I18n plugin for Intelli J Idea or Android Studio.

  1. First you have to do is go ahead and install the Flutter I18n Plugin

2. Open strings_en.arb file in the project browser and add your localized string there

3. Restart the IDE

4. Add the following code snippet to your material app.

return new MaterialApp(
localizationsDelegates: [S.delegate],
supportedLocales: S.delegate.supportedLocales,
home: new WelcomePage(),
);

5. Add import generated i18n file

import ‘generated/i18n.dart’;

6. Then use the following code as your string

S.of(context).welcome_message)

--

--

Chatura Dilan Perera
Chatura Dilan Perera

Written by Chatura Dilan Perera

Optimistic who loves to explore new technologies

No responses yet