Jeremy Newman : move translatable strings from global theme into global trans table

Jeremy Newman jnewman at wine.codeweavers.com
Tue Jan 19 12:45:30 CST 2016


Module: website
Branch: master
Commit: 415095689f4eee6f309705960b5819e30fb6ffe0
URL:    http://source.winehq.org/git/website.git/?a=commit;h=415095689f4eee6f309705960b5819e30fb6ffe0

Author: Jeremy Newman <jnewman at codeweavers.com>
Date:   Tue Jan 19 11:33:32 2016 -0600

move translatable strings from global theme into global trans table

---

 include/incl.php                            |  3 +++
 site.php                                    |  3 +--
 templates/en/global/layout/content.template | 14 +++++++-------
 templates/en/global/xml/trans/global.xml    | 15 +++++++++++++++
 4 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/include/incl.php b/include/incl.php
index 302d9c1..4a52861 100644
--- a/include/incl.php
+++ b/include/incl.php
@@ -114,4 +114,7 @@ else
     unset($lang);
 }
 
+// load global translation table
+$html->load_trans("global");
+
 ?>
diff --git a/site.php b/site.php
index 77b2a56..29c5159 100644
--- a/site.php
+++ b/site.php
@@ -132,13 +132,12 @@ if (defined("PAGE") and PAGE == "home")
 }
 
 // online mode switch
-if ($config->offline)
+if (!empty($config->offline))
 {
     /*
        OFFLINE
     */
     $html->_error_mode = 1;
-    $PAGE_template = "content_nonav";
     $PAGE_body = $html->template("local", 'global/website_offline');
 }
 else
diff --git a/templates/en/global/layout/content.template b/templates/en/global/layout/content.template
index 05677a2..82d4942 100644
--- a/templates/en/global/layout/content.template
+++ b/templates/en/global/layout/content.template
@@ -38,11 +38,11 @@
     <div id="whq-tabs">
         <div class="whq-tabs-menu">☰</div>
         <ul>
-            <li class="s"><a href="{$base_url}">WineHQ</a></li>
-            <li><a href="http://wiki.winehq.org/">Wiki</a></li>
-            <li><a href="//appdb.winehq.org/">AppDB</a></li>
-            <li><a href="//bugs.winehq.org/">Bugzilla</a></li>
-            <li><a href="//forums.winehq.org/">Forums</a></li>
+            <li class="s"><a href="{$base_url}">{trans($tab_winehq)}</a></li>
+            <li><a href="http://wiki.winehq.org/">{trans($tab_wiki)}</a></li>
+            <li><a href="//appdb.winehq.org/">{trans($tab_appdb)}</a></li>
+            <li><a href="//bugs.winehq.org/">{trans($tab_bugs)}</a></li>
+            <li><a href="//forums.winehq.org/">{trans($tab_forums)}</a></li>
         </ul>
     </div>
     <div class="clear"></div>
@@ -70,9 +70,9 @@
             <span class="glyphicon glyphicon-globe large"></span> {$langCur} (<a href="{$root}/lang">{$langChange}</a>)
         </div>
         <div class="col-xs-6 text-right">
-            Hosted By
+            {trans($hosted_by)}
             <a href="https://www.codeweavers.com/"><img src="{$root}/images/cw_logo_sm.png" alt="CodeWeavers"
-            title="CodeWeavers - Run Windows applications and games on Mac and Linux"></a>
+            title="{trans($hosted_by_alt)}"></a>
         </div>
     </div>
 </div>
diff --git a/templates/en/global/xml/trans/global.xml b/templates/en/global/xml/trans/global.xml
new file mode 100644
index 0000000..42c0496
--- /dev/null
+++ b/templates/en/global/xml/trans/global.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" ?>
+<trans lang="en" table="global">
+
+    <!-- TOP TABS -->
+    <str name="tab_winehq">WineHQ</str>
+    <str name="tab_wiki">Wiki</str>
+    <str name="tab_appdb">AppDB</str>
+    <str name="tab_bugs">Bugzilla</str>
+    <str name="tab_forums">Forums</str>
+
+    <!-- HOSTED BY LINK -->
+    <str name="hosted_by">Hosted By</str>
+    <str name="hosted_by_alt">CodeWeavers - Run Windows applications and games on Mac and Linux</str>
+
+</trans>




More information about the wine-cvs mailing list