Exploring the intl package
The intl
package provides functionality for internationalization and localization of Dart applications. This not only includes the important aspect of translating interface text into other languages but also includes the formatting of text (not every language is formatted from left to right), dates and numbers.
Locating strings to translate
The interface of an application largely consists of buttons, with a few other labels and controls. A phrasebook of the application's interface language can be created using Intl.message
and stored as static functions in the PhraseBook
class, which can be found in the interfacetrans.dart
file. This organizes all the strings that are to be set on the interface elements at runtime using ...
Get Dart: Scalable Application Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.