13.2. Using static string internationalization

This approach uses a set of property files containing key/value pairs, one for each locale. It’s called the static approach because the GWT compiler uses a technique called static analysis to ensure the output includes only those values in use in the application. This has two benefits:

  • Your download doesn’t include unused values, minimizing code size.
  • You’ll have no missing values at runtime, removing potential for errors.

Not only are unused values removed, but the compiler also produces an output per locale used that contains only the set of strings for that locale. That is to say, a French locale output (or permutation, as it’s known) wouldn’t have to carry the text for English and Persian ...

Get GWT in Action, Second Edition 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.