title: How to manually set up localization for google chrome app（language-switcher）
body: <p>I develop a google chrome app using java-script. i want my app could have a language switcher to switch from English to Chinese. When i look at my app, i realize i am using chrome.18n  where there is a folder called _locales and en/messages.json.  so, i create zh/messages.json under _locales. now the problem is coming. how can the language switcher switch locales from en/messages.json to zh/messages.json?????
  my here is my localization.js </p>
  
  <pre><code>function localize() {
    var localized = 0;
  
    var translate = function(messageID) {
      localized++;
      console.log(chrome.i18n.getMessage(messageID));
      return chrome.i18n.getMessage(messageID);
    };
  
    $('[i18n]:not(.i18n-replaced').each(function() {
      var element = $(this);
  
      element.html(translate(element.attr('i18n')));
      element.addClass('i18n-replaced');
    });
  
    $('[i18n_title]:not(.i18n_title-replaced').each(function() {
      var element = $(this);
  
      element.attr('title', translate(element.attr('i18n_title')));
      element.addClass('i18n_title-replaced');
    });
  
    $('[i18n_value]:not(.i18n_value-replaced').each(function() {
      var element = $(this);
  
      element.val(translate(element.attr('i18n_value')));
      element.addClass('i18n_value-replaced');
    });
  
    $('[i18n_placeholder]:not(.i18n_placeholder-replaced').each(function() {
      var element = $(this);
  
      element.attr('placeholder', translate(element.attr('i18n_placeholder')));
      element.addClass('i18n_placeholder-replaced');
    });
  
  
  return localized;
  </code></pre>