Commits

Wang Dingwei committed ab211f6

Finished zh_CN translation

Comments (0)

Files changed (36)

 syntax: glob
-*.db
 *.pyc
 *.log
 *~
 *.swp
-build
+*.db
 dist
 TESTDIR
 OIE_LISTS
 *.csv
 doc\html
 doc\build
-*egg-info\*
-
 syntax: regexp

.hgtags

-ebb9b8380125c02a7e4d1789408ed9101352bf3b 0.1
-fa6f8f9310226ce2f99b6acc480ec9c381cbce81 0.2
-dee8bab6d8bd25d9929c6b889d8be531e284498a 0.4
 recursive-include rqs/templates *
 recursive-include rqs/static *
-
+recursive-include rqs/translations *
+graft rqs/logs
+recursive-exclude rqs/logs *.log
+[python: **.py]
+[jinja2: **/templates/**.html]
+extensions=jinja2.ext.autoescape,jinja2.ext.with_
+# Translations template for PROJECT.
+# Copyright (C) 2011 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2011-08-03 10:52+0800\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: rqs/templates/404.html:3
+msgid "404 -- Page Not Found"
+msgstr ""
+
+#: rqs/templates/404.html:6
+msgid "You've come to the wrong place."
+msgstr ""
+
+#: rqs/templates/500.html:3
+msgid "500 -- Internal Error"
+msgstr ""
+
+#: rqs/templates/500.html:6
+msgid "The following error has been found:"
+msgstr ""
+
+#: rqs/templates/by_line.html:3
+msgid "Query By Line"
+msgstr ""
+
+#: rqs/templates/by_line.html:73
+msgid "Export Excel"
+msgstr ""
+
+#: rqs/templates/by_mo.html:3
+msgid "Query By MO"
+msgstr ""
+
+#: rqs/templates/by_mo.html:57
+msgid "MO doesn't exist!"
+msgstr ""
+
+#: rqs/templates/by_rack.html:3
+msgid "Units status for"
+msgstr ""
+
+#: rqs/templates/by_rack.html:3
+#, python-format
+msgid "Line %s"
+msgstr ""
+
+#: rqs/templates/by_rack.html:3
+#, python-format
+msgid "Rack %s"
+msgstr ""
+
+#: rqs/templates/by_svctag.html:3
+msgid "Query By Service Tag"
+msgstr ""
+
+#: rqs/templates/by_svctag.html:18 rqs/templates/preload_unit.html:14
+msgid "Unit Information"
+msgstr ""
+
+#: rqs/templates/checkin.html:28 rqs/templates/checkout.html:19
+#: rqs/templates/layout.html:55 rqs/templates/layout.html:60
+#: rqs/templates/layout.html:65 rqs/templates/preload_query.html:17
+msgid "Submit"
+msgstr ""
+
+#: rqs/templates/checkout.html:3
+msgid "Unit Checkout"
+msgstr ""
+
+#: rqs/templates/index.html:3 rqs/templates/layout.html:4
+#: rqs/templates/layout.html:20
+msgid "Rack Query System"
+msgstr ""
+
+#: rqs/templates/layout.html:34
+msgid "Modify"
+msgstr ""
+
+#: rqs/templates/layout.html:36
+msgid "Check out"
+msgstr ""
+
+#: rqs/templates/layout.html:37
+msgid "Check in"
+msgstr ""
+
+#: rqs/templates/layout.html:38
+msgid "Update Rack"
+msgstr ""
+
+#: rqs/templates/layout.html:39
+msgid "Export Data"
+msgstr ""
+
+#: rqs/templates/layout.html:40 rqs/templates/preload_query.html:3
+#: rqs/templates/preload_times.html:3
+msgid "Preload Times"
+msgstr ""
+
+#: rqs/templates/layout.html:42
+msgid "Query"
+msgstr ""
+
+#: rqs/templates/layout.html:44
+msgid "By PD Line:"
+msgstr ""
+
+#: rqs/templates/layout.html:57
+msgid "By Service Tag:"
+msgstr ""
+
+#: rqs/templates/layout.html:62
+msgid "By MO:"
+msgstr ""
+
+#: rqs/templates/layout.html:72
+msgid "RQS &mdash; Created by ME6900 TE, &copy;Wistron 2011"
+msgstr ""
+
+#: rqs/templates/preload_query.html:14
+msgid "By service tag:"
+msgstr ""
+
+#: rqs/templates/preload_query.html:19
+msgid "All Delayed"
+msgstr ""
+
+#: rqs/templates/preload_times.html:14
+msgid "Times"
+msgstr ""
+
+#: rqs/templates/preload_unit.html:3
+msgid "Preload Times by Unit"
+msgstr ""
+
+#: rqs/templates/preload_unit.html:26
+msgid "Unit already checkout from runin area. Check from SFCS."
+msgstr ""
+
+#: rqs/templates/preload_unit.html:29
+msgid "Preload times"
+msgstr ""
+
+#: rqs/templates/update_rack.html:3
+msgid "Update Unit Rack"
+msgstr ""
+
+#: rqs/views/change_rack.py:12
+msgid "Input Service Tag and Rack Info."
+msgstr ""
+
+#: rqs/views/change_rack.py:23
+#, python-format
+msgid "Updated %s rack to %s"
+msgstr ""
+
+#: rqs/views/change_rack.py:25
+#, python-format
+msgid "Unit %s not in database"
+msgstr ""
+
+#: rqs/views/checkout.py:13
+msgid "Please enter service tag."
+msgstr ""
+
+#: rqs/views/frontend.py:14
+msgid "Please use the left columns to submit an action."
+msgstr ""
+

production_settings.py

     SECRET_KEY = 'development'
     SOAP_CLIENT = Client('http://172.30.60.152/Basic.WebService/WebService.asmx?WSDL')
     USE_WSDL = True
+    
+    DEFAULT_MAIL_SENDER = 'rqs@wistron.com'
     MAIL_SERVER = 'wksmail.wistron.com'
     MAIL_USERNAME = ''
     MAIL_PASSWORD = ''
 	
     CACHE_TYPE = "simple"
     CACHE_DEFAULT_TIMEOUT = 10
+    
+    BABEL_DEFAULT_LOCALE = "zh_CN"
 
+    ADMINS = ('joel_wang@wistron.com')
+
+    DEBUG_LOG = 'logs/debug.log'
+    ERROR_LOG = 'logs/error.log'
+    
+    
 class DebugConfig(ProdConfig):
     DEBUG = True
 
-Rack Query System is a web frontend for Burning test records. It's written in Flask and largely immitated the flask examples. 
+========================
+Rack Query System (RQS)
+========================
 
-Requirements
-------------
+Rack Query System 是 Runin 测试区的机台查询系统。
 
-* Flask
-* SQLAlchemy
-* Flask SQLAlchemy extension
-* MySQLdb (if you want to use mysql)
-* suds (for real time queries)
 
-
-Usage
+安装
 -----
 
-Currently it supports the following query methods:
+执行 `python setup.py install` 即可。确认已安装下面的软件包:
 
-* By PD line
-* By Service Tag, MO, or the unit serial number
-* Unit checkin(only for test purposes), checkout, and rack change.
+  * Flask -- Web 框架
+  * SQLAlchemy -- ORM
+  * Flask-SQLAlchemy -- Flask ORM 扩展
+  * Flask-Babel -- Flask 多语言支持扩展
+  * MySQLdb -- Python MySQL 支持
+  * suds -- Python SOAP 支持
 
-There are a lot of todos:
+建议使用 virtualenv 做隔离的虚拟环境。
 
-* More features
-* CSS and theming, it's too ugly now.
-* Try out different deployments
 
-Well, that's it for now. :)
+测试
+-----
+
+执行 `python run.py` 即可。你可以用它调用 debug 或者生产环境的配置。
+
+debug 模式下你可以通过浏览器错误页面进行调试。
+
+错误 log 会放在安装目录的 rqs/logs 目录下。供分析使用。
+
+
+部署
+-----
+
+可以通过 wsgi 部署,app.wsgi 如下:
+
+    import sys, os
+    
+    app_path = os.path.dirname(os.path.abspath(__file__))
+    if app_path not in sys.path:
+        sys.path.append(app_path)
+
+    from rqs import create_app
+    from production_settings import production_settings
+
+    application = create_app(production_settings)
+
+所有的配置都在 production_settings.py 中。你可以按需求修改。
+
+详见部署说明。
+
+
+

rqs/application.py

 
 from logging.handlers import SMTPHandler, RotatingFileHandler
 
-from flask import Flask, g, render_template
+from flask import Flask, g, render_template, request
+from flaskext.babel import Babel, gettext as _
 
 from rqs.extensions import db, cache
+
 from config import DefaultConfig
 from rqs import views
 
         app.config.from_object(config)
 
     app.config.from_envvar('APP_CONFIG', silent=True)
-
-
+    
+	
 def configure_modules(app, modules):
     
     for module, url_prefix in modules:
 
     db.init_app(app)
     cache.init_app(app)
-
+    babel = Babel(app)
+    
 
 def configure_template_filters(app):
     
 
 """
 
+from suds.client import Client
 from datetime import timedelta
 
 class DefaultConfig(object):
-    """
-    This is more like a debug configuration.
-    """
 
-    DEBUG = True
-    TESTING = False
-
+    DEBUG = False
+    SQLALCHEMY_DATABASE_URI = 'mysql://root:ndk800@localhost/runindatabase'
+    SQLALCHEMY_ECHO = False
+    
+    PDLINES = ['FA1', 'FA2', 'FA3', 'FA5', 'FA7', 'EA3', 'EA4', 'EA5']
+    TIMEOUT = timedelta(0, 3600 * 3.5)
+    MAXAGE = 3600 * 3.5
+    RUNIN_STAGES = ['TS', 'TT', 'TW', 'TO', 'TV']
+    
     SECRET_KEY = 'development'
+    SOAP_CLIENT = Client('http://172.30.60.152/Basic.WebService/WebService.asmx?WSDL')
+    USE_WSDL = True
     
-    SQLALCHEMY_DATABASE_URI = 'sqlite:///test.db'
-    SQLALCHEMY_ECHO = True
-
-    PDLINES = ['FA1', 'FA2', 'FA3', 'FA5', 'FA7', 'EA3', 'EA4', 'EA5']
-    TIMEOUT = timedelta(0, 12600)
-    MAXAGE = 14400
-    SOAP_CLIENT = None  # or a suds.client.Client(url) object
+    DEFAULT_MAIL_SENDER = 'rqs@wistron.com'
+    MAIL_SERVER = 'wksmail.wistron.com'
+    MAIL_USERNAME = ''
+    MAIL_PASSWORD = ''
+	
+    CACHE_TYPE = "simple"
+    CACHE_DEFAULT_TIMEOUT = 10
+    
+    BABEL_DEFAULT_LOCALE = "zh_CN"
 
     ADMINS = ('joel_wang@wistron.com')
 
-    DEFAULT_MAIL_SENDER = 'rqs@wistron.com'
-
     DEBUG_LOG = 'logs/debug.log'
     ERROR_LOG = 'logs/error.log'
 
-    CACHE_TYPE = "simple"
-    CACHE_DEFAULT_TIMEOUT = 120
-
 
 class TestingConfig(DefaultConfig):
     TESTING = True

rqs/logs/empty.txt

+Dummy file. Can be deleted anytime.

rqs/templates/404.html

 {% extends "layout.html" %}
 {% block title %}
-    404 -- Page Not Found
+    {{ _("404 -- Page Not Found") }}
 {% endblock %}
 {% block body %}
-<p> You've come to the wrong place. </p>
+<p>{{ _("You've come to the wrong place.") }}</p>
 {% endblock %}

rqs/templates/500.html

 {% extends "layout.html" %}
 {% block title %}
-    500 -- Internal Error
+    {{ _("500 -- Internal Error") }}
 {% endblock %}
 {% block body %}
-<p> The following error has been found: </p>
+<p>{{ _("The following error has been found:" ) }} </p>
 <pre>{{ msg }}</pre>
 {% endblock %}

rqs/templates/by_line.html

 {% extends "layout.html" %}
 {% block title %}
-Query By Line -- {{line}}
+{{ _('Query By Line') }}-- {{line}}
 {% endblock %}
 
 {% block body %}
 </span>
 </div>
 {% endfor %}
-<p><a href="{{ url_for('export.export_csv_line', line=line) }}">Export Excel</a></p>
+<p><a href="{{ url_for('export.export_csv_line', line=line) }}">{{ _('Export Excel') }}</a></p>
 
 Runin: <div class="demopos" style="background-color:#F5BCA9">#</div> Preloading: <div class="demopos" style="background-color:#F2F5A9">#</div> Preload OK: <div class="demopos" style="background-color:#BCF5A9">#</div> N/A: <div class="demopos" style="background-color:#E6E6E6">#</div>
 

rqs/templates/by_mo.html

 {% extends "layout.html" %}
 {% block title %}
-    Query By MO -- {{ mo }}
+    {{ _("Query By MO") }} -- {{ mo }}
 {% endblock %}
 
 {% block body %}
 <table class="unit_info">
     <tr><th>ServiceTag</th><th>Delay</th><th>PD_Line</th><th>Rack</th></tr>
     {% for unit in result %}
-    <tr><td><a href="{{url_for('svctag.by_svctag', svctag=unit.ServiceTag)}}">{{unit.ServiceTag}}</a></td>
+    <tr><td><a href="{{url_for('svctag.by_svctag', svctag=unit.ServiceTag)}}">{{ unit.ServiceTag }}</a></td>
       <td><span class="seconds">{{ unit.delay }}</span></td>
-        <td>{{unit.PDLINE}}</td>
-        <td>{{unit.Rack}}</td></tr>
+        <td>{{ unit.PDLINE }}</td>
+        <td>{{ unit.Rack }}</td></tr>
     {% endfor %}
 </table>
 
 {% else %}
-<p>MO doesn't exist!</p>
+<p>{{ _("MO doesn't exist!") }}</p>
 
 {% endif %}
 

rqs/templates/by_rack.html

 {% extends "layout.html" %}
 {% block title %}
-Units status for Line {{line}}, Rack {{rack}}<p>
+{{ _("Units status for") }} {{_("Line %s") % line}}, {{ _("Rack %s") % rack }}<p>
 {% endblock %}
 {% block body %}
 

rqs/templates/by_svctag.html

 {% extends "layout.html" %}
 {% block title %}
-    Query By Service Tag -- {{svctag}}
+    {{ _("Query By Service Tag") }} -- {{svctag}}
 {% endblock %}
 {% block body %}
 
 </script>
 
 <h2>{{ self.title() }}</h2> 
-<p>Unit Information </p>
+<p>{{ _("Unit Information") }} </p>
   <table class="unit_info">
     <tr class="Odd"><td>Service Tag</td><td>{{ unit.ServiceTag }}</td></tr>
     <tr><td>MO</td><td>{{ unit.MO }}</td></tr>
     <tr class="Odd"><td>Model</td><td>{{ unit.Model }}</td></tr>
-    <tr><td>Line</td><td>{{ unit.PDLINE }}</td></tr>
+    <tr><td>Line</td><td>{{ unit.RuninLine }}</td></tr>
     <tr class="Odd"><td>Rack</td><td>{{ unit.Rack }}</td></tr>
     <tr><td>Run-in Start</td><td>{{ unit.InputTime }}</td></tr>
     <tr class="Odd"><td>Age(HH:MM)</td><td class='seconds'>{{ unit.age }}</td></tr>

rqs/templates/checkin.html

 {% extends "layout.html" %}
 {% block title %}
-Unit Checkin
+_("Unit Checkin")
 {% endblock %}
 
 {% block body %}
       <li>Rack: <input type='text' name='rack' size='10'>
       <li>Time: <input type='text' name='time', size='20'>
     </ul>
-    <input type='submit' id='submit', value='Submit'><p>
+    <input type='submit' id='submit', value={{_("Submit")}}><p>
   </form>
 </div>
 {% endblock %}

rqs/templates/checkout.html

 {% extends "layout.html" %}
 {% block title %}
-Unit Checkout
+{{ _("Unit Checkout") }}
 {% endblock %}
 
 {% block body %}
   <h2>{{ self.title() }}</h2>
 
   <form action='/checkout/' method='POST' onsubmit="return svctagCheck(this);">
-    <input type='text' class='svctag' name='svctag' ='Submit' size='8'>
-    <input type='submit' id='submit' value="Submit">
+    <input type='text' class='svctag' name='svctag' size='8'>
+    <input type='submit' id='submit' value={{_("Submit")}}>
   </form>
   <p>{{ msg }}</p>
 </div>

rqs/templates/index.html

 {% extends "layout.html" %}
 {% block title %}
-    Rack Query System
+    {{ _("Rack Query System") }}
 {% endblock %}
 {% block body %}
 <p>{{ msg }}</p>

rqs/templates/layout.html

 <!doctype html>
 <html>
   <head>
-    <title>Rack Query System</title>
+    <title>{{ _("Rack Query System") }}</title>
     <link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}" />
     <!--[if IE 6]>
     <link rel=stylesheet type=text/css href="{{ url_for('static', filename='style_ie6.css') }}" />
 
       <div id="topsection">
         <div class="innertube">
-          <h1><a href="{{url_for('frontend.default_view')}}">Rack Query System</a></h1>
+          <h1><a href="{{url_for('frontend.default_view')}}">{{ _("Rack Query System") }}</a></h1>
         </div>
       </div>
 
 
       <div id="sidecolumn">
         <div class="innertube">
-          <h3>Edit</h3>
+          <h3>{{ _("Modify") }}</h3>
           <ul>
-            <li><a href="{{ url_for('checkout.check_out')}}" target="_blank">Check out</a></li>
-            <li><a href="{{ url_for('checkin.check_in')}}" target="_blank">Check in</a></li>
-            <li><a href="{{ url_for('change_rack.update_rack') }}" target="_blank">Update Rack</a></li>
-            <li><a href="{{ url_for('export.export_csv') }}" target="_blank">Export Data</a></li>
-			<li><a href="{{ url_for('preload.frontend') }}" target="_blank">Preload Times</a></li>
+            <li><a href="{{ url_for('checkout.check_out')}}" target="_blank">{{ _("Check out") }}</a></li>
+            <li><a href="{{ url_for('checkin.check_in')}}" target="_blank">{{ _("Check in") }}</a></li>
+            <li><a href="{{ url_for('change_rack.update_rack') }}" target="_blank">{{ _("Update Rack") }}</a></li>
+            <li><a href="{{ url_for('export.export_csv') }}" target="_blank">{{ _("Export Data") }}</a></li>
+			<li><a href="{{ url_for('preload.frontend') }}" target="_blank">{{ _("Preload Times") }}</a></li>
           </ul>
-          <h3>Query</h3>
+          <h3>{{ _("Query") }}</h3>
           <dl>
-            <dt>By PD Line:</dt> 
+            <dt>{{ _("By PD Line:") }}</dt> 
             <dd><form action="/line/" method="POST">
               <select name="line">
                 {% for pd in lines %}
                 {% endif %}
                 {% endfor %}
               </select>
-              <input type="submit" value="Submit">
+              <input type="submit" value={{_("Submit")}}>
             </form></dd>
-            <dt>By Service Tag:</dt> 
+            <dt>{{ _("By Service Tag:") }}</dt> 
             <dd><form action="/svctag/" method="POST" onsubmit="return svctagCheck(this);">
               <input type="" name="svctag" size="8">
-              <input type="submit" value="Submit">
+              <input type="submit" value={{_("Submit")}}>
             </form></dd>
-            <dt>By MO: </dt>
+            <dt>{{ _("By MO:") }}</dt>
             <dd><form action="/mo/" method="POST">
               <input type="" name="mo" size="12">
-              <input type="submit" value="Submit">
+              <input type="submit" value={{_("Submit")}}>
             </form></dd>
           </dl>
         </div>
       </div>
 
       <div id="footer">
-        RQS &mdash; Created by ME6900 TE, &copy;Wistron 2011
+        {{ _("RQS &mdash; Created by ME6900 TE, &copy;Wistron 2011") }}
       </div>
 
     </div>

rqs/templates/preload_query.html

 {% extends "layout.html" %}
 {% block title %}
-Preload Times
+{{ _("Preload Times") }}
 {% endblock %}
 
 {% block body %}
 <h2>{{ self.title() }}</h2>
 
 <dl>
-<dt>By service tag:</dt>
+<dt>{{ _("By service tag:") }}</dt>
 <dd><form action='.' method='POST'>
 <input name="svctag" size="8">
-<input type="submit" value="Submit">
+<input type="submit" value={{_("Submit")}}>
 </form></dd>
-<dt><a href="{{ url_for('.getall') }}">All Delayed</a></dt>
+<dt><a href="{{ url_for('.getall') }}">{{ _("All Delayed") }}</a></dt>
 </dl>
 
 {% endblock %}

rqs/templates/preload_times.html

 {% extends "layout.html" %}
 {% block title %}
-Preload Times
+{{ _("Preload Times") }}
 {% endblock %}
 
 {% block body %}
 <script>
 </script>
 
-<h2>{{ self.title() }}</h2>
+<h2>{{ _(self.title()) }}</h2>
 
 <table>
-<tr><th>Service Tag</th><th>Times</th></tr>
+<tr><th>Service Tag</th><th>{{ _("Times") }}</th></tr>
 {% for svctag, times in result %}
 <tr><td><a href="{{ url_for('.getone', svctag=svctag) }}">{{ svctag }}</a></td><td>{{ times }}</td></tr>
 {% endfor %}

rqs/templates/preload_unit.html

 {% extends "layout.html" %}
 {% block title %}
-Preload Times by Unit
+{{ _("Preload Times by Unit") }}
 {% endblock %}
 
 {% block body %}
 <h2>{{ self.title() }}</h2>
 
 {% if unit %}
-<h3>Unit Information </h3>
+<h3>{{ _("Unit Information") }} </h3>
   <table class="unit_info">
     <tr class="Odd"><td>Service Tag</td><td>{{ unit.ServiceTag }}</td></tr>
     <tr><td>MO</td><td>{{ unit.MO }}</td></tr>
     <tr><td>Stage</td><td>{{ unit.stage }}</td></tr>
  </table>
  {% else %}
- <p> Unit already checkout from runin area. Check from SFCS.</p>
+ <p> {{ _("Unit already checkout from runin area. Check from SFCS.") }}</p>
  {% endif %}
 
-<h3>Preload times</h3>
+<h3>{{ _("Preload times") }}</h3>
 <ul>
 {% for p in result %}
 <li>{{ p.Downloadtime }}</li>

rqs/templates/update_rack.html

 {% extends "layout.html" %}
 {% block title %}
-Update Unit Rack
+{{ _("Update Unit Rack") }}
 {% endblock %}
 
 {% block body %}
 </script>
 
 <div style="margin-left: 100px;">
-  <h2>{{ self.title() }}</h2>
+  <h2>{{ _(self.title()) }}</h2>
 
   <form action='/change_rack/' method='POST' onsubmit="return svctagCheck(this);">
     <dl>

rqs/translations/zh_CN/LC_MESSAGES/messages.mo

Binary file added.

rqs/translations/zh_CN/LC_MESSAGES/messages.po

+# Chinese (China) translations for PROJECT.
+# Copyright (C) 2011 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2011-08-03 10:52+0800\n"
+"PO-Revision-Date: 2011-07-25 17:15+0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: zh_CN <LL@li.org>\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: rqs/templates/404.html:3
+msgid "404 -- Page Not Found"
+msgstr "404 -- 页面不存在"
+
+#: rqs/templates/404.html:6
+msgid "You've come to the wrong place."
+msgstr "抱歉,这里什么都没有。"
+
+#: rqs/templates/500.html:3
+msgid "500 -- Internal Error"
+msgstr "500 -- 程序错误"
+
+#: rqs/templates/500.html:6
+msgid "The following error has been found:"
+msgstr "发现如下错误:"
+
+#: rqs/templates/by_line.html:3
+msgid "Query By Line"
+msgstr "按线别查询"
+
+#: rqs/templates/by_line.html:73
+msgid "Export Excel"
+msgstr "导出 Excel"
+
+#: rqs/templates/by_mo.html:3
+msgid "Query By MO"
+msgstr "按 MO 查询"
+
+#: rqs/templates/by_mo.html:57
+msgid "MO doesn't exist!"
+msgstr "MO 不存在!"
+
+#: rqs/templates/by_rack.html:3
+msgid "Units status for"
+msgstr "机台信息——"
+
+#: rqs/templates/by_rack.html:3
+#, python-format
+msgid "Line %s"
+msgstr "线别 %s"
+
+#: rqs/templates/by_rack.html:3
+#, python-format
+msgid "Rack %s"
+msgstr "杠别 %s"
+
+#: rqs/templates/by_svctag.html:3
+msgid "Query By Service Tag"
+msgstr "按 Service Tag 查询"
+
+#: rqs/templates/by_svctag.html:18 rqs/templates/preload_unit.html:14
+msgid "Unit Information"
+msgstr "机台信息"
+
+#: rqs/templates/checkin.html:28 rqs/templates/checkout.html:19
+#: rqs/templates/layout.html:55 rqs/templates/layout.html:60
+#: rqs/templates/layout.html:65 rqs/templates/preload_query.html:17
+msgid "Submit"
+msgstr "提交"
+
+#: rqs/templates/checkout.html:3
+msgid "Unit Checkout"
+msgstr "机台 checkout"
+
+#: rqs/templates/index.html:3 rqs/templates/layout.html:4
+#: rqs/templates/layout.html:20
+msgid "Rack Query System"
+msgstr "Rack 查询系统"
+
+#: rqs/templates/layout.html:34
+msgid "Modify"
+msgstr "修改"
+
+#: rqs/templates/layout.html:36
+msgid "Check out"
+msgstr "机台 checkout"
+
+#: rqs/templates/layout.html:37
+msgid "Check in"
+msgstr "机台 checkin"
+
+#: rqs/templates/layout.html:38
+msgid "Update Rack"
+msgstr "更新机台杠别"
+
+#: rqs/templates/layout.html:39
+msgid "Export Data"
+msgstr "导出数据"
+
+#: rqs/templates/layout.html:40 rqs/templates/preload_query.html:3
+#: rqs/templates/preload_times.html:3
+msgid "Preload Times"
+msgstr "Preload 次数"
+
+#: rqs/templates/layout.html:42
+msgid "Query"
+msgstr "查询"
+
+#: rqs/templates/layout.html:44
+msgid "By PD Line:"
+msgstr "按线别查询"
+
+#: rqs/templates/layout.html:57
+msgid "By Service Tag:"
+msgstr "按 Service Tag 查询"
+
+#: rqs/templates/layout.html:62
+msgid "By MO:"
+msgstr "按 MO 查询"
+
+#: rqs/templates/layout.html:72
+msgid "RQS &mdash; Created by ME6900 TE, &copy;Wistron 2011"
+msgstr "RQS &mdash; ME6900 TE 作品, &copy;Wistron 2011"
+
+#: rqs/templates/preload_query.html:14
+msgid "By service tag:"
+msgstr "按 Service Tag 查询"
+
+#: rqs/templates/preload_query.html:19
+msgid "All Delayed"
+msgstr "所有 delay 机台"
+
+#: rqs/templates/preload_times.html:14
+msgid "Times"
+msgstr "次数"
+
+#: rqs/templates/preload_unit.html:3
+msgid "Preload Times by Unit"
+msgstr "Preload 次数"
+
+#: rqs/templates/preload_unit.html:26
+msgid "Unit already checkout from runin area. Check from SFCS."
+msgstr "机台已经从 runin 区 checkout,请通过 SFCS 查询流程。"
+
+#: rqs/templates/preload_unit.html:29
+msgid "Preload times"
+msgstr "Preload 次数"
+
+#: rqs/templates/update_rack.html:3
+msgid "Update Unit Rack"
+msgstr "更新机台杠别"
+
+#: rqs/views/change_rack.py:12
+msgid "Input Service Tag and Rack Info."
+msgstr "输入 Service Tag 和 杠别信息。"
+
+#: rqs/views/change_rack.py:23
+#, python-format
+msgid "Updated %s rack to %s"
+msgstr "%S 的 rack 更新至 %s"
+
+#: rqs/views/change_rack.py:25
+#, python-format
+msgid "Unit %s not in database"
+msgstr "机台 %s 的信息不在数据库中"
+
+#: rqs/views/checkout.py:13
+msgid "Please enter service tag."
+msgstr "请输入 Service Tag."
+
+#: rqs/views/frontend.py:14
+msgid "Please use the left columns to submit an action."
+msgstr "请使用左边的查询功能进行操作。"
+

rqs/views/change_rack.py

 from flask import Blueprint, session, request, render_template
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.model import db, Unit
 
 
 @change_rack.route('/', methods=['GET', 'POST'])
 def update_rack():
-    msg = "Input Service Tag and Rack Info."
+    msg = _("Input Service Tag and Rack Info.")
     if request.method == 'POST':
         svctag = request.form['svctag']
         line = request.form['line']
             unit.PDLINE = line
             db.session.merge(unit)
             db.session.commit()
-            msg = "Updated %s rack to %s" % (svctag, rack)
+            msg = _("Updated %s rack to %s" % (svctag, rack))
         else:
-            msg = "Unit %s not in database" % svctag
+            msg = _("Unit %s not in database" % svctag)
             return render_template('500.html', msg=msg)
     
     return render_template('update_rack.html',

rqs/views/checkin.py

 from flask import Blueprint, session, request, render_template
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.model import db, Unit
 

rqs/views/checkout.py

         render_template, g, flash
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.model import db, Unit
 
 
 @checkout.route('/', methods=['GET', 'POST'])
 def check_out():
-    msg = "Please enter service tag."
+    msg = _("Please enter service tag.")
     if request.method == 'POST':
         svctag = request.form['svctag']
         try:

rqs/views/export.py

 from flask import Blueprint, g, send_file
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.model import db, Unit
 from rqs.util import getstages, sec2hhmm

rqs/views/frontend.py

 from flask import Blueprint, session, render_template
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.extensions import cache
 
 @cache.cached()
 def default_view():
     "The default query method is by line"
-    message = "Please use the left columns to submit an action."
+    message = _("Please use the left columns to submit an action.")
     lines = app.config['PDLINES']
     if 'default_line' not in session:
         session['default_line'] = lines[0]

rqs/views/line.py

         render_template, g, flash, abort
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.model import db, Unit
 from rqs.extensions import cache
         render_template, g
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.model import Unit
 

rqs/views/preload.py

         render_template, g, flash, abort
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.model import Preload, Unit
 from rqs.extensions import cache

rqs/views/svctag.py

         render_template, g
 
 from flask import current_app as app
+from flaskext.babel import gettext as _
 
 from rqs.model import Unit
 from rqs.util import get_stage
         'Flask',
         'Flask-SQLAlchemy',
         'Flask-Cache',
+        'Flask-Babel',
         'sqlalchemy',
         'suds',
     ],