Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 233bc0b8 authored by Dirk Dougherty's avatar Dirk Dougherty Committed by Dirk Dougherty
Browse files

AI 150370: Add localized content infrastructure in droiddoc templates,...

AI 150370: Add localized content infrastructure in droiddoc templates, javascript, and css.  DocFile.java - instead of FileReader, use InputStreamReader with UTF-8 encoding. ClearPage.java - add UTF-8 output encoding to FileOutputStreamWriter. Note: this change also up-integrates gerrit 2146 (smain).
  BUG=1910893

Automated import of CL 150370
parent 9e202af9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class ClearPage
        OutputStreamWriter stream = null;
        try {
            stream = new OutputStreamWriter(
                            new FileOutputStream(file));
                            new FileOutputStream(file), "UTF-8");
            String rendered = cs.render();
            stream.write(rendered, 0, rendered.length());
        }
+2 −1
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@ public class DocFile
        try {
            File f = new File(filename);
            int length = (int)f.length();
            FileReader reader = new FileReader(f);
            FileInputStream is = new FileInputStream(f);
            InputStreamReader reader = new InputStreamReader(is, "UTF-8");
            char[] buf = new char[length];
            int index = 0;
            int amt;
+29 −20
Original line number Diff line number Diff line
@@ -46,11 +46,20 @@ def:custom_masthead() ?>
      </div>
      <div id="headerRight">
          <div id="headerLinks">
            <!-- 	<img src="<?cs var:toroot ?>assets/images/icon_world.jpg" alt="" />  -->
          <?cs if:template.showLanguageMenu ?>
              <img src="<?cs var:toroot ?>assets/images/icon_world.jpg" alt="" /> 
              <span id="language">
             		<select name="language" onChange="changeLangPref(this.value)">
    							<option value="en">English</option>
    				  	<!--  <option value="ja"></option>  -->
             	<select name="language" onChange="changeLangPref(this.value, true)">
    			<option value="en">English&nbsp;&nbsp;&nbsp;</option>
    			<option value="ja">日本語</option>
    			<?cs # 
			<option value="de">Deutsch</option> 
    			<option value="es">Español</option>
    			<option value="fr">Français</option>
    			<option value="it">Italiano</option>
    			<option value="zh-CN">中文 (简体)</option>
    			<option value="zh-TW">中文 (繁體)</option>
			?>
             	</select>	
             	<script type="text/javascript">
             	  <!--  
@@ -58,6 +67,7 @@ def:custom_masthead() ?>
             	   //-->
             	</script>
             </span>
          <?cs /if ?>
          <a href="http://www.android.com">Android.com</a>
          </div><?cs 
          call:default_search_box() ?>
@@ -151,9 +161,8 @@ def:default_left_nav() ?>
      if (!isMobile) {
        $("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav");
        chooseDefaultNav();
        if ($("#nav-tree").is(':visible')) {
          init_default_navtree("<?cs var:toroot ?>");
        } else {
        if ($("#nav-tree").is(':visible')) init_navtree("nav-tree", "<?cs var:toroot ?>", NAVTREE_DATA);
        else {
          addLoadEvent(function() {
            scrollIntoView("packages-nav");
            scrollIntoView("classes-nav");
+27 −7
Original line number Diff line number Diff line
@@ -9,27 +9,47 @@
         
	<li id="home-link"><a href="<?cs var:toroot ?><?cs if:android.whichdoc != "online" ?>offline.html<?cs else ?>index.html<?cs /if ?>">
		<span class="en">Home</span>
    <span class="ja"></span>
		<span class="de">Startseite</span>
                <span class="ja">ホーム</span>
		<span class="zh-CN">主页</span>
		<span class="zh-TW">首頁</span>
	</a></li>
	<li id="sdk-link"><a href="<?cs var:toroot ?>sdk/<?cs var:sdk.current ?>/index.html">
		<span class="en">SDK</span>
    <span class="ja"></span>
	</a></li>
	<li id="guide-link"><a href="<?cs var:toroot ?>guide/index.html" onClick="return loadLast('guide')">
		<span class="en">Dev Guide</span>
    <span class="ja"></span>
		<span class="de">Handbuch</span>
		<span class="es">Guía</span>
		<span class="fr">Guide</span>
		<span class="it">Guida</span>
                <span class="ja">開発ガイド</span>
		<span class="zh-CN">开发人员指南</span>
		<span class="zh-TW">開發指南</span>
	</a></li>
	<li id="reference-link"><a href="<?cs var:toroot ?>reference/packages.html" onClick="return loadLast('reference')">
		<span class="en">Reference</span>
    <span class="ja"></span>
		<span class="de">Referenz</span>
		<span class="es">Referencia</span>
		<span class="fr">Référence</span>
		<span class="it">Riferimento</span>
                <span class="ja">リファレンス</span>
		<span class="zh-CN">参考</span>
		<span class="zh-TW">參考資料</span>
	</a></li>
	<li><a href="http://android-developers.blogspot.com">
		<span class="en">Blog</span>
    <span class="ja"></span>
                <span class="ja">ブログ</span>
		<span class="zh-CN">博客</span>
		<span class="zh-TW">網誌</span>
	</a></li>
	<li id="community-link"><a href="<?cs var:toroot ?>community/index.html">
		<span class="en">Community</span>
    <span class="ja"></span>
		<span class="es">Comunidad</span>
		<span class="fr">Communauté</span>
                <span class="ja">コミュニティ</span>
		<span class="zh-CN">社区</span>
		<span class="zh-TW">社群</span>
	</a></li>
     
</ul>
+9 −1
Original line number Diff line number Diff line
@@ -238,6 +238,10 @@ hr.blue {
  top:7px;
}

#header li a span+span {
  display:none;
}

/* TAB HIGHLIGHTING */
.home #home-link a,
.publish #publish-link a,
@@ -276,8 +280,12 @@ hr.blue {
  color: #7FA9B5;
}

#headerLinks img {
  vertical-align:middle;
}

#language {
  margin:0 10px;
  margin:0 10px 0 4px;
}

#search {
Loading