Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering DART

You're reading from   Mastering DART Master the art of programming high-performance applications with Dart

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher Packt
ISBN-13 9781783989560
Length 346 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Sergey Akopkokhyants Sergey Akopkokhyants
Author Profile Icon Sergey Akopkokhyants
Sergey Akopkokhyants
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Beyond Dart's Basics 2. Advanced Techniques and Reflection FREE CHAPTER 3. Object Creation 4. Asynchronous Programming 5. The Stream Framework 6. The Collection Framework 7. Dart and JavaScript Interoperation 8. Internalization and Localization 9. Client-to-server Communication 10. Advanced Storage 11. Supporting Other HTML5 Features 12. Security Aspects Index

Using translated messages


Now, it's time to generate a set of Dart libraries that contain translated versions of our messages—one per locale from the ARB files prepared before. We use the generate_from_arb program from the intl package:

pub run intl:generate_from_arb --output-dir=web web/registration_form.dart web/translate_en.arb web/translate_de.arb

The program generates the message_de.dart, message_en.dart, and messages_all.dart files in the specified web directory. Each message_<locale_tag>.dart file contains the MessageLookup class that implements MessageLookupByLibrary. The MessageLookup class has a getter method localeName, a set of static functions that are returned translated on the specific locale text messages, and final constant messages that contain the name of all the static methods. The messages_all.dart file combines all the lookups in one place to make them available for the localization code from the Intl library. The single available public method of the message_all...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image