Flutter Localization the Easy Way – Internationalization with JSONBusiness & Finance LibrariesUpdated on Oct 22, 2019 View more like this | Visit NEW YORK, NY | Contact Mahmudul Hasan |

Flutter localization- Let's face it. When you're building an app which you plan to release to the public, having it in just one language isn't going to cut it. While English is definitely one of the most spoken languages throughout the world, internationalizing your apps is really a must.
Contrary to frameworks like native Android, Flutter doesn't have an absolutely set way of how localization is done. It gives you a lot of freedom which can be good if you know what you're doing, but also extremely confusing if you're just starting out.
In this tutorial, you're going to learn how to localize your apps the simple way by using JSON files to store your strings in multiple languages.
Prepare your project
Before writing Dart code to access the JSON files containing translated strings, you actually need to create the files first and update the pubspec file.
Create the language files
Create a new folder lang in the project root. This folder will hold all of the language files. Because I'm Slovak, I've created two files - en.json and sk.json. If you want to follow along in a different language, feel free to do so, just remember to change any reference to 'sk' to your preferred language.
These files will contain only simple key-value pairs of strings. Using JSON is beneficial, because similar to XML, you can just give it to a translator without them needing to access your code.
en.json
{
"first_string": "Hello! This is the first message.",
"second_string": "If this tutorial helps you, give it a like and subscribe to Reso Coder
Contrary to frameworks like native Android, Flutter doesn't have an absolutely set way of how localization is done. It gives you a lot of freedom which can be good if you know what you're doing, but also extremely confusing if you're just starting out.
In this tutorial, you're going to learn how to localize your apps the simple way by using JSON files to store your strings in multiple languages.
Prepare your project
Before writing Dart code to access the JSON files containing translated strings, you actually need to create the files first and update the pubspec file.
Create the language files
Create a new folder lang in the project root. This folder will hold all of the language files. Because I'm Slovak, I've created two files - en.json and sk.json. If you want to follow along in a different language, feel free to do so, just remember to change any reference to 'sk' to your preferred language.
These files will contain only simple key-value pairs of strings. Using JSON is beneficial, because similar to XML, you can just give it to a translator without them needing to access your code.
en.json
{
"first_string": "Hello! This is the first message.",
"second_string": "If this tutorial helps you, give it a like and subscribe to Reso Coder