Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
..
Failed to load latest commit information.
html Upgraded to 1.12
images Renamed files
javascripts Upgraded to 1.12
stylesheets Upgraded to 1.12
txt Renamed directories
README.md Doc edit
manifest.json Added/updated platform config

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.

Something went wrong with that request. Please try again.