Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
html
images
javascripts
stylesheets
txt
README.md
manifest.json

README.md

Internationalization (i18n)

This template demonstrates how to externalize language strings in the HTML layer using JavaScript templates, properties files, and parameterized content feeds.

Core Concepts

  • Using Markup.js to generate HTML on the fly from strings stored in external text files
  • Using Markup.js to populate the UI with language-specific strings (also stored in external text files)
  • Loading language-specific content by passing a language code to a parameterized content feed

Usage

To change the language, first update the language code on line 1 of app.js. Acceptable values for this demo are "en", "es" and "ja".

Then specify the appropriate locale file in manifest.json (defaults to ./txt/locales/en.txt).

The content feed defined in manifest.json points to Google News RSS. If you create your own copy of this feed in App Cloud Studio, replace hl=en with hl={"lang":"en"}.

Note, native UI components (e.g. navigation icons) cannot be translated at this time.