O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Internationalizing a Polymer app

What if you want your web app to display information in several languages, depending on the language of the web client user? This recipe will show you how to accomplish this. You can find the code in the project pol_intl.

How to do it...

  1. Add the intl package from the pub package to your app through pubspec.yaml.
  2. The script starts with web\pol_intl.html, where a component with the name localized_text is imported through the following line:
    <link rel="import"href="localized_text.html">

    From this, we know that the component is defined in localized_text.html, and the code behind it is in a file named localized_text.dart. For a discussion of the other tags, see the first recipe.

  3. The structure of the component is outlined ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required