diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9d43114 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,58 @@ +Welcome To Open Falcon Portal +========================= + +Hi! Nice to see you here! + +If you'd like to ask a question +=============================== + +Please see [this web page ](http://book.open-falcon.com/) for community information, which includes falcon's wiki/FAQ and [IRC contacts](http://book.open-falcon.com/zh/authors.html). + +The github issue tracker is not the best place for questions for various reasons, but IRC is very helpful places for those things. + +If you'd like to contribute code +================================ + +The project takes contributions through [github pull requests](https://help.github.com/articles/using-pull-requests) + +It is usually a good idea to [join the QQ group](http://jq.qq.com/?_wv=1027&k=g8tvOZ) to discuss any large features prior to submission, and this especially helps in avoiding duplicate work or efforts where we decide, upon seeing a pull request for the first time, that revisions are needed. (This is not usually needed for frentend development, but can be nice for large changes). + +If you'd like to file a bug +=========================== + +I'd also read the community page above, but in particular, make sure you copy [this issue template](https://github.com/open-falcon/portal/blob/master/ISSUE_TEMPLATE.md) into your ticket description. This template helps us organize tickets faster and prevents asking some repeated questions, so it's very helpful to us and we appreciate your help with it. + +Also please make sure you are testing on the latest released version of Falcon modules or the development branch. + +Thanks! + +If you'd like to contribute translations +======================================== + +Portal project is based on Flask framework, we use the Flask-Babel extension to enable muti-language display support. + +If you would like to help with the translation(i18n) works, whether correcting a typo or improving a section, or maybe even add a new language support, follow instractions bellow and submit a github pull request, it would be nice of you to read [this guide](http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xiv-i18n-and-l10n) before action. + + $ # activate python + $ source env/bin/activate + + $ # run like this to add a new language translation file , otherwise skip this step + $ python scripts/tr_init.py en_GB + + $ # update translation file + $ python scripts/tr_uptate.py + + $ # translate all msgids, and ensure there is no fuzzy line left. + $ vi web/translations/es/LC_MESSAGES/messages.po + + $ # update LANGUAGES in frame.config + $ vi frame/config.py + + # # compile to use + $ python scripts/tr_compile.py + + $ # have a test~ + $ python wsgi.py + + $ # create a pull request + diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..6a73276 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,39 @@ +##### Issue Type: + +Can you help us out in labelling this by telling us what kind of ticket this this? You can say: + - Bug Report + - Feature Idea + - Feature Pull Request + - New Module Pull Request + - Bugfix Pull Request + - Documentation Report + - Docs Pull Request + +##### Module Version: + +Let us know what version of Falcon module you are using. Please supply the verbatim output from running “./control version”. If you're filing a ticket on a version of module which is not the latest, we'd greatly appreciate it if you could retest on the latest version first. We don't expect you to test against the development branch most of the time, but we may ask for that if you have cycles. Thanks! + +##### Module Configuration: + +What have you changed about your Falcon module installation? What configuration settings have you changed/added/removed? Compare your cfg.json against a clean version from Github and let us know what's different. + +##### Environment: + +What OS are you running Falcon from and what OS are you monitoring? Examples include RHEL 5/6, Centos 5/6, Ubuntu 12.04/13.10, *BSD, Solaris. If this is a generic feature request or it doesn’t apply, just say “N/A”. Not all tickets may be about operating system related things and we understand that. + +##### Summary: + +Please summarize your request in this space. You will earn bonus points for being succinct, but please add enough detail so we can understand the request. Thanks! + +##### Steps To Reproduce: + +If this is a bug ticket, please enter the steps you use to reproduce the problem in the space below. If this is a feature request, please enter the steps you would use to use the feature. If it is necessary, add some screenshot to explain your issue would be great. Much appreciated! + +##### Expected Results: + +Please enter your expected results in this space. When running the steps supplied above in the previous section, what did you expect to happen? If showing example output, please indent your output by four spaces so it will render correctly in GitHub's viewer thingy. + +##### Actual Results: + +Please enter your actual results in this space. When running the steps supplied above, what actually happened? If you are showing example output, please indent your output by four spaces so it will render correctly in GitHub. Thanks again! + diff --git a/README.md b/README.md index 02abd70..fb83c87 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ falcon portal # use douban pypi $ ./env/bin/pip install -r pip_requirements.txt -i http://pypi.douban.com/simple + # compile translation cache + $ ./env/bin/python scripts/tr_compile.py ## Init database and config diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 0000000..f0234b3 --- /dev/null +++ b/babel.cfg @@ -0,0 +1,3 @@ +[python: **.py] +[jinja2: **/templates/**.html] +extensions=jinja2.ext.autoescape,jinja2.ext.with_ diff --git a/control b/control index 654a0b1..54ee153 100755 --- a/control +++ b/control @@ -55,6 +55,12 @@ function kill9() { function restart() { stop sleep 2 + check_pid + running=$? + if [ $running -gt 0 ];then + kill9 $(cat $pidfile) + sleep 2 + fi start } diff --git a/frame/config.py b/frame/config.py index b22e272..56e14f2 100644 --- a/frame/config.py +++ b/frame/config.py @@ -11,6 +11,15 @@ DB_PASS = "" DB_NAME = "falcon_portal" +# -- i18n config -- +BABEL_DEFAULT_LOCALE = 'zh_CN' +BABEL_DEFAULT_TIMEZONE = 'Asia/Shanghai' +# aviliable translations +LANGUAGES = { + 'en': 'English', + 'zh_CN': 'Chinese-Simplified' +} + # -- cookie config -- SECRET_KEY = "4e.5tyg8-u9ioj" SESSION_COOKIE_NAME = "falcon-portal" diff --git a/pip_requirements.txt b/pip_requirements.txt index 7d76e9f..c8c6448 100644 --- a/pip_requirements.txt +++ b/pip_requirements.txt @@ -1,4 +1,5 @@ Flask==0.10.1 +Flask-Babel==0.9 Jinja2==2.7.2 Werkzeug==0.9.4 gunicorn==19.3.0 diff --git a/scripts/tr_compile.py b/scripts/tr_compile.py new file mode 100755 index 0000000..4c83e4e --- /dev/null +++ b/scripts/tr_compile.py @@ -0,0 +1,8 @@ +#!env/bin/python +import os +import sys +if sys.platform == 'win32': + pybabel = 'env\\Scripts\\pybabel' +else: + pybabel = 'env/bin/pybabel' +os.system(pybabel + ' compile -d web/translations') diff --git a/scripts/tr_init.py b/scripts/tr_init.py new file mode 100755 index 0000000..df0ab29 --- /dev/null +++ b/scripts/tr_init.py @@ -0,0 +1,15 @@ +#!env/bin/python +import os +import sys +if sys.platform == 'win32': + pybabel = 'env\\Scripts\\pybabel' +else: + pybabel = 'env/bin/pybabel' +if len(sys.argv) != 2: + print "usage: tr_init " + sys.exit(1) +os.system(pybabel + + ' extract -F babel.cfg -k lazy_gettext -o messages.pot web') +os.system(pybabel + + ' init -i messages.pot -d web/translations -l ' + sys.argv[1]) +os.unlink('messages.pot') diff --git a/scripts/tr_update.py b/scripts/tr_update.py new file mode 100755 index 0000000..029b2fd --- /dev/null +++ b/scripts/tr_update.py @@ -0,0 +1,10 @@ +#!env/bin/python +import os +import sys +if sys.platform == 'win32': + pybabel = 'env\\Scripts\\pybabel' +else: + pybabel = 'env/bin/pybabel' +os.system(pybabel + ' extract -F babel.cfg -k lazy_gettext -o messages.pot web') +os.system(pybabel + ' update -i messages.pot -d web/translations') +os.unlink('messages.pot') diff --git a/web/__init__.py b/web/__init__.py index 4dd816d..23a0c60 100644 --- a/web/__init__.py +++ b/web/__init__.py @@ -5,10 +5,20 @@ import datetime import urllib from flask import Flask, request, g, session, make_response, redirect +from flask.ext.babel import Babel from frame.api import uic app = Flask(__name__) app.config.from_object("frame.config") +babel = Babel(app) + +@babel.localeselector +def get_locale(): + return request.accept_languages.best_match(app.config.get('LANGUAGES').keys()) + +@babel.timezoneselector +def get_timezone(): + return app.config.get('BABEL_DEFAULT_TIMEZONE') # config log log_formatter = '%(asctime)s\t[%(filename)s:%(lineno)d] [%(levelname)s: %(message)s]' @@ -37,7 +47,7 @@ def before_request(): for ignore_pre in IGNORE_PREFIX: if p.startswith(ignore_pre): return - + g.locale = get_locale() if 'user_name' in session and session['user_name']: g.user_name = session['user_name'] else: @@ -60,4 +70,4 @@ def redirect_to_sso(): return resp -from web.controller import home, group, plugin, host, expression, api, template, strategy, nodata, cluster \ No newline at end of file +from web.controller import home, group, plugin, host, expression, api, template, strategy, nodata, cluster diff --git a/web/templates/cluster/creator.html b/web/templates/cluster/creator.html index e42c2ca..9aa5506 100644 --- a/web/templates/cluster/creator.html +++ b/web/templates/cluster/creator.html @@ -50,4 +50,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/cluster/list.html b/web/templates/cluster/list.html index b1daf91..af8256f 100644 --- a/web/templates/cluster/list.html +++ b/web/templates/cluster/list.html @@ -8,23 +8,23 @@
- 新建 + {{ _('Create') }}
- 当前HostGroup:{{ group.grp_name }} + {{ _('current hostgroup:') }}:{{ group.grp_name }}
- - - - - + + + + + @@ -56,7 +56,7 @@ {% else %} - + {% endfor %} @@ -65,4 +65,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/expression/add.html b/web/templates/expression/add.html index 4cfc1be..d600b55 100644 --- a/web/templates/expression/add.html +++ b/web/templates/expression/add.html @@ -8,11 +8,11 @@
-
{% if data.expression.id %}modify{% else %}add{% endif %} expression
+
{% if data.expression.id %}{{ _('modify') }}{% else %}{{ _('add') }}{% endif %} {{ _('expression') }}
+ placeholder="{{ _('e.g.') }} each(metric=qps srv=falcon)">{{ data.expression.expression }}
@@ -86,10 +86,10 @@
- +
@@ -99,4 +99,4 @@ }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/expression/list.html b/web/templates/expression/list.html index 28e5fc4..b519296 100644 --- a/web/templates/expression/list.html +++ b/web/templates/expression/list.html @@ -4,13 +4,13 @@
+ placeholder="{{ _('search...') }}" onkeydown="if(event.keyCode==13)query_expression()">
- mine + {{ _('mine') }} @@ -70,4 +70,4 @@ $("#mine").click(query_expression); }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/expression/view.html b/web/templates/expression/view.html index 0233b71..13214cc 100644 --- a/web/templates/expression/view.html +++ b/web/templates/expression/view.html @@ -4,7 +4,7 @@
-
expression detail
+
{{ _('expression detail') }}
{% set left = '{' %} @@ -37,4 +37,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/group/advanced.html b/web/templates/group/advanced.html index a8f1efa..7fcab74 100644 --- a/web/templates/group/advanced.html +++ b/web/templates/group/advanced.html @@ -3,24 +3,24 @@
-

批量重命名HostGroup

+

{{ _('Batch rename hostgroup') }}

- +
- +
- - + +
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/group/index.html b/web/templates/group/index.html index e97b0db..166a7c7 100644 --- a/web/templates/group/index.html +++ b/web/templates/group/index.html @@ -4,16 +4,16 @@
+ placeholder="{{ _('search...') }}" onkeydown="if(event.keyCode==13)query_user()">
- mine + {{ _('mine') }} {% if data.is_root or data.community %}
- + @@ -24,9 +24,9 @@
endpointmetrictagscreatoroperation{{ _('endpoint') }}{{ _('metric') }}{{ _('tags') }}{{ _('creator') }}{{ _('operation') }}
no records{{ _('no records') }}
- - - + + + @@ -35,13 +35,13 @@ {% else %} - + {% endfor %}
namecreatoroperation{{ _('hostgroup') }}{{ _('creator') }}{{ _('operation') }}
{{ v.grp_name }} {{ v.create_user }} - templates + {{ _('templates') }} ¦ - hosts + {{ _('hosts') }} ¦ - plugins + {{ _('plugins') }} ¦ - aggregator + {{ _('aggregator') }} {% if v.writable(g.user_name) %} ¦ @@ -55,7 +55,7 @@
no records
{{ _('no records') }}
@@ -73,4 +73,4 @@ $("#mine").click(query_user); }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/group/templates.html b/web/templates/group/templates.html index 1d306a4..8a3ed2c 100644 --- a/web/templates/group/templates.html +++ b/web/templates/group/templates.html @@ -7,20 +7,18 @@
-
templates
+
{{ _('related templates list') }}
- {{ group.grp_name }} - binding - + {{ _('current hostgroup:') }}{{ group.grp_name }}
- - - + + + @@ -42,7 +40,7 @@ {% else %} - + {% endfor %} @@ -52,16 +50,16 @@
- +
@@ -72,4 +70,4 @@ }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/host/add.html b/web/templates/host/add.html index 5945260..8872d12 100644 --- a/web/templates/host/add.html +++ b/web/templates/host/add.html @@ -21,11 +21,11 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/host/groups.html b/web/templates/host/groups.html index 316cb0b..d8ea7f9 100644 --- a/web/templates/host/groups.html +++ b/web/templates/host/groups.html @@ -3,18 +3,18 @@
-
binding groups
+
{{ _('binding groups') }}
- host: {{ host.hostname }} + {{ _('current host:') }} {{ host.hostname }}
templatecreatoroperation{{ _('template') }}{{ _('creator') }}{{ _('operation') }}
no records{{ _('no records') }}
- - - + + + @@ -32,7 +32,7 @@ {% else %} - + {% endfor %} @@ -42,7 +42,7 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/host/index.html b/web/templates/host/index.html index a7563f5..b353642 100644 --- a/web/templates/host/index.html +++ b/web/templates/host/index.html @@ -8,14 +8,14 @@
+ placeholder="{{ _('search...') }}" onkeydown="if(event.keyCode==13)query_host()">
- maintaining + {{ _('maintaining') }}
@@ -34,10 +34,10 @@ - - - - + + + + @@ -48,14 +48,14 @@ {% else %} - + {% endfor %} @@ -67,20 +67,20 @@ @@ -95,7 +95,7 @@ {{ blocks.pager('/group/'+data.group.id.__str__()+'/hosts?q='+data.query+'&maintaining='+data.maintaining+'&xbox='+g.xbox, data.total, data.limit, data.page) }}
-
total: {{ data.total }}, page size:
+
{{ _('total') }}: {{ data.total }}, {{ _('page size') }}:
groupcreatoroperation{{ _('group') }}{{ _('creator') }}{{ _('operation') }}
no records{{ _('no records') }}
hostnamemaintain beginmaintain endrelation{{ _('hostname') }}{{ _('maintain begin') }}{{ _('maintain end') }}{{ _('relation') }}
{{ v.maintain_begin | fmt_time }} {{ v.maintain_end | fmt_time }} - groups + {{ _('hostgroup') }} ¦ - templates + {{ _('templates') }}
no records{{ _('no records') }}
- +
- +
- +
- +
- - - + + + @@ -34,7 +34,7 @@ {% else %} - + {% endfor %} @@ -44,7 +44,7 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/layout.html b/web/templates/layout.html index 57446b3..a303720 100644 --- a/web/templates/layout.html +++ b/web/templates/layout.html @@ -41,15 +41,15 @@

- welcome, {{ g.user_name }} + {{ _('welcome') }}, {{ g.user_name }}

@@ -59,4 +59,4 @@

-
{% if data.nodata.id %}modify{% else %}add{% endif %} nodata
+
{% if data.nodata.id %}{{ _('modify') }}{% else %}{{ _('add') }}{% endif %} {{ _('nodata') }}
- +
@@ -71,18 +71,18 @@
- +
- +
- + @@ -103,11 +103,11 @@
- Back + {{ _('Back') }}
diff --git a/web/templates/nodata/list.html b/web/templates/nodata/list.html index 78d8c83..625135a 100644 --- a/web/templates/nodata/list.html +++ b/web/templates/nodata/list.html @@ -22,13 +22,13 @@
+ placeholder="{{ _('search...') }}" onkeydown="if(event.keyCode==13)query_nodata()">
- mine + {{ _('mine') }} {% else %}
- no records + {{ _('no records') }} {% endfor %}
@@ -77,4 +77,4 @@ $("#mine").click(query_nodata); }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/plugin/list.html b/web/templates/plugin/list.html index bc8cf23..0fc803e 100644 --- a/web/templates/plugin/list.html +++ b/web/templates/plugin/list.html @@ -3,20 +3,18 @@
-
plugins
+
{{ _('plugins') }}
- {{ group.grp_name }} - binding - + {{ _('current hostgroup:') }}{{ group.grp_name }}

nameparentcreator{{ _('name') }}{{ _('parent') }}{{ _('creator') }}
no records{{ _('no records') }}
- - - + + + @@ -38,7 +36,7 @@ {% else %} - + {% endfor %} @@ -47,16 +45,16 @@
-
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/template/groups.html b/web/templates/template/groups.html index 279eb3e..9cbb71a 100644 --- a/web/templates/template/groups.html +++ b/web/templates/template/groups.html @@ -3,9 +3,9 @@
-
host groups
+
{{ _('host groups') }}
- template: {{ data.tpl.tpl_name }} + {{ _('current template:') }} {{ data.tpl.tpl_name }}
@@ -49,4 +49,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/template/list.html b/web/templates/template/list.html index 4c460a7..b4eadea 100644 --- a/web/templates/template/list.html +++ b/web/templates/template/list.html @@ -4,16 +4,16 @@
+ placeholder="{{ _('search...') }}" onkeydown="if(event.keyCode==13)query_template()">
- mine + {{ _('mine') }}
-
plugin dircreatoroperation{{ _('plugin dir') }}{{ _('creator') }}{{ _('operation') }}
no records{{ _('no records') }}
- - - - + + + + @@ -63,7 +63,7 @@ {% else %} - + {% endfor %} @@ -84,4 +84,4 @@ }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/template/update.html b/web/templates/template/update.html index 3aa7525..a26a374 100644 --- a/web/templates/template/update.html +++ b/web/templates/template/update.html @@ -47,12 +47,12 @@
nameparentcreatoroperation{{ _('template name') }}{{ _('parent') }}{{ _('creator') }}{{ _('operation') }}
no records{{ _('no records') }}
- - - - - - + + + + + + @@ -84,7 +84,7 @@ {% else %} - + {% endfor %} @@ -138,7 +138,7 @@ @@ -186,7 +186,7 @@ @@ -198,4 +198,4 @@ make_select2_for_metric("#metric"); }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/template/view.html b/web/templates/template/view.html index a482d6e..5596f28 100644 --- a/web/templates/template/view.html +++ b/web/templates/template/view.html @@ -10,7 +10,7 @@
metric/tags/noteconditionmaxPrunoperation{{ _('metric/tags [note]') }}{{ _('condition') }}{{ _('max') }}{{ _('P') }}{{ _('run_at') }}{{ _('operation') }}
no records{{ _('no records') }}
- - - - - + + + + + @@ -60,7 +60,7 @@ {% else %} - + {% endfor %} @@ -111,4 +111,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/translations/en/LC_MESSAGES/messages.po b/web/translations/en/LC_MESSAGES/messages.po new file mode 100644 index 0000000..0803b19 --- /dev/null +++ b/web/translations/en/LC_MESSAGES/messages.po @@ -0,0 +1,308 @@ +# English translations for PROJECT. +# Copyright (C) 2016 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2016. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2016-01-13 00:55+0800\n" +"PO-Revision-Date: 2016-01-12 12:45+0800\n" +"Last-Translator: iambocai \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.2.0\n" + +#: web/templates/layout.html:44 +msgid "HostGroups" +msgstr "HostGroups" + +#: web/templates/layout.html:45 +msgid "Templates" +msgstr "Templates" + +#: web/templates/layout.html:46 +msgid "Expressions" +msgstr "Expressions" + +#: web/templates/layout.html:47 +msgid "Nodatas" +msgstr "Nodatas" + +#: web/templates/layout.html:52 +msgid "welcome" +msgstr "welcome" + +#: web/templates/cluster/list.html:11 +msgid "Create" +msgstr "Create" + +#: web/templates/cluster/list.html:16 web/templates/group/templates.html:12 +#: web/templates/plugin/list.html:8 +msgid "current hostgroup:" +msgstr "current hostgroup:" + +#: web/templates/cluster/list.html:23 +msgid "endpoint" +msgstr "endpoint" + +#: web/templates/cluster/list.html:24 web/templates/nodata/add.html:74 +msgid "metric" +msgstr "metric" + +#: web/templates/cluster/list.html:25 web/templates/nodata/add.html:80 +msgid "tags" +msgstr "tags" + +#: web/templates/cluster/list.html:26 web/templates/group/index.html:28 +#: web/templates/group/templates.html:20 web/templates/host/groups.html:16 +#: web/templates/host/templates.html:17 web/templates/plugin/list.html:16 +#: web/templates/template/list.html:29 +msgid "creator" +msgstr "creator" + +#: web/templates/cluster/list.html:27 web/templates/group/index.html:29 +#: web/templates/group/templates.html:21 web/templates/host/groups.html:17 +#: web/templates/plugin/list.html:17 web/templates/template/list.html:30 +#: web/templates/template/update.html:55 +msgid "operation" +msgstr "operation" + +#: web/templates/cluster/list.html:59 web/templates/expression/list.html:56 +#: web/templates/group/index.html:58 web/templates/group/templates.html:43 +#: web/templates/host/groups.html:35 web/templates/host/index.html:58 +#: web/templates/host/templates.html:37 web/templates/nodata/list.html:63 +#: web/templates/plugin/list.html:39 web/templates/template/list.html:66 +#: web/templates/template/update.html:87 web/templates/template/view.html:63 +msgid "no records" +msgstr "no records" + +#: web/templates/expression/add.html:11 web/templates/nodata/add.html:49 +msgid "modify" +msgstr "modify" + +#: web/templates/expression/add.html:11 web/templates/nodata/add.html:49 +msgid "add" +msgstr "add" + +#: web/templates/expression/add.html:11 +msgid "expression" +msgstr "expression" + +#: web/templates/expression/add.html:15 web/templates/plugin/list.html:48 +msgid "e.g." +msgstr "e.g." + +#: web/templates/expression/add.html:89 web/templates/group/advanced.html:18 +#: web/templates/nodata/add.html:106 +msgid "Submit" +msgstr "Submit" + +#: web/templates/expression/add.html:92 web/templates/group/templates.html:62 +#: web/templates/host/add.html:28 web/templates/host/groups.html:45 +#: web/templates/host/templates.html:47 web/templates/nodata/add.html:110 +#: web/templates/plugin/list.html:56 +msgid "Back" +msgstr "Back" + +#: web/templates/expression/list.html:7 web/templates/group/index.html:7 +#: web/templates/host/index.html:11 web/templates/nodata/list.html:25 +#: web/templates/template/list.html:7 +msgid "search..." +msgstr "search..." + +#: web/templates/expression/list.html:13 web/templates/group/index.html:13 +#: web/templates/nodata/list.html:31 web/templates/template/list.html:13 +msgid "mine" +msgstr "mine" + +#: web/templates/expression/view.html:7 +msgid "expression detail" +msgstr "expression detail" + +#: web/templates/group/advanced.html:6 +msgid "Batch rename hostgroup" +msgstr "Batch rename hostgroup" + +#: web/templates/group/advanced.html:11 +msgid "old" +msgstr "old" + +#: web/templates/group/advanced.html:15 +msgid "new" +msgstr "new" + +#: web/templates/group/advanced.html:19 +msgid "Cancel" +msgstr "Cancel" + +#: web/templates/group/index.html:16 web/templates/template/list.html:16 +msgid "input name to create" +msgstr "input name to create" + +#: web/templates/group/index.html:27 web/templates/host/index.html:51 +msgid "hostgroup" +msgstr "hostgroup" + +#: web/templates/group/index.html:38 web/templates/host/index.html:53 +msgid "templates" +msgstr "templates" + +#: web/templates/group/index.html:40 +msgid "hosts" +msgstr "hosts" + +#: web/templates/group/index.html:42 web/templates/plugin/list.html:6 +msgid "plugins" +msgstr "plugins" + +#: web/templates/group/index.html:44 +msgid "aggregator" +msgstr "aggregator" + +#: web/templates/group/templates.html:10 +msgid "related templates list" +msgstr "related templates list" + +#: web/templates/group/templates.html:19 +msgid "template" +msgstr "template" + +#: web/templates/group/templates.html:53 +msgid "input template name" +msgstr "input template name" + +#: web/templates/group/templates.html:58 web/templates/plugin/list.html:52 +msgid "Bind" +msgstr "Bind" + +#: web/templates/host/add.html:24 web/templates/host/index.html:28 +msgid "Add Host" +msgstr "Add Host" + +#: web/templates/host/groups.html:6 +msgid "binding groups" +msgstr "binding groups" + +#: web/templates/host/groups.html:8 +msgid "current host:" +msgstr "current host:" + +#: web/templates/host/groups.html:15 +msgid "group" +msgstr "group" + +#: web/templates/host/index.html:18 +msgid "maintaining" +msgstr "maintaining" + +#: web/templates/host/index.html:37 +msgid "hostname" +msgstr "hostname" + +#: web/templates/host/index.html:38 +msgid "maintain begin" +msgstr "maintain begin" + +#: web/templates/host/index.html:39 +msgid "maintain end" +msgstr "maintain end" + +#: web/templates/host/index.html:40 +msgid "relation" +msgstr "relation" + +#: web/templates/host/index.html:70 +msgid "begin" +msgstr "begin" + +#: web/templates/host/index.html:75 +msgid "end" +msgstr "end" + +#: web/templates/host/index.html:80 +msgid "Maintain" +msgstr "Maintain" + +#: web/templates/host/index.html:83 +msgid "Unset" +msgstr "Unset" + +#: web/templates/host/index.html:98 +msgid "total" +msgstr "total" + +#: web/templates/host/index.html:98 +msgid "page size" +msgstr "page size" + +#: web/templates/host/templates.html:6 +msgid "binding templates" +msgstr "binding templates" + +#: web/templates/host/templates.html:15 +msgid "name" +msgstr "name" + +#: web/templates/host/templates.html:16 web/templates/template/list.html:28 +msgid "parent" +msgstr "parent" + +#: web/templates/nodata/add.html:49 +msgid "nodata" +msgstr "nodata" + +#: web/templates/nodata/add.html:54 +msgid "nodata name" +msgstr "nodata name" + +#: web/templates/nodata/add.html:85 +msgid "type" +msgstr "type" + +#: web/templates/plugin/list.html:15 +msgid "plugin dir" +msgstr "plugin dir" + +#: web/templates/template/groups.html:6 +msgid "host groups" +msgstr "host groups" + +#: web/templates/template/groups.html:8 web/templates/template/view.html:13 +msgid "current template:" +msgstr "current template:" + +#: web/templates/template/list.html:27 +msgid "template name" +msgstr "template name" + +#: web/templates/template/update.html:50 web/templates/template/view.html:40 +msgid "metric/tags [note]" +msgstr "metric/tags [note]" + +#: web/templates/template/update.html:51 web/templates/template/view.html:41 +msgid "condition" +msgstr "condition" + +#: web/templates/template/update.html:52 web/templates/template/view.html:42 +msgid "max" +msgstr "max" + +#: web/templates/template/update.html:53 web/templates/template/view.html:43 +msgid "P" +msgstr "P" + +#: web/templates/template/update.html:54 web/templates/template/view.html:44 +msgid "run_at" +msgstr "run_at" + +#: web/templates/template/update.html:141 +#: web/templates/template/update.html:189 +msgid "Save" +msgstr "Save" + diff --git a/web/translations/zh_Hans_CN/LC_MESSAGES/messages.po b/web/translations/zh_Hans_CN/LC_MESSAGES/messages.po new file mode 100644 index 0000000..1438392 --- /dev/null +++ b/web/translations/zh_Hans_CN/LC_MESSAGES/messages.po @@ -0,0 +1,308 @@ +# Chinese (Simplified, China) translations for PROJECT. +# Copyright (C) 2016 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2016. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2016-01-13 00:55+0800\n" +"PO-Revision-Date: 2016-01-08 12:32+0800\n" +"Last-Translator: iambocai \n" +"Language: zh_Hans_CN\n" +"Language-Team: zh_Hans_CN \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 2.2.0\n" + +#: web/templates/layout.html:44 +msgid "HostGroups" +msgstr "机器分组" + +#: web/templates/layout.html:45 +msgid "Templates" +msgstr "监控模板" + +#: web/templates/layout.html:46 +msgid "Expressions" +msgstr "策略表达式" + +#: web/templates/layout.html:47 +msgid "Nodatas" +msgstr "数据补缺" + +#: web/templates/layout.html:52 +msgid "welcome" +msgstr "欢迎你" + +#: web/templates/cluster/list.html:11 +msgid "Create" +msgstr "创建" + +#: web/templates/cluster/list.html:16 web/templates/group/templates.html:12 +#: web/templates/plugin/list.html:8 +msgid "current hostgroup:" +msgstr "当前机器分组:" + +#: web/templates/cluster/list.html:23 +msgid "endpoint" +msgstr "endpoint" + +#: web/templates/cluster/list.html:24 web/templates/nodata/add.html:74 +msgid "metric" +msgstr "监控项" + +#: web/templates/cluster/list.html:25 web/templates/nodata/add.html:80 +msgid "tags" +msgstr "标签" + +#: web/templates/cluster/list.html:26 web/templates/group/index.html:28 +#: web/templates/group/templates.html:20 web/templates/host/groups.html:16 +#: web/templates/host/templates.html:17 web/templates/plugin/list.html:16 +#: web/templates/template/list.html:29 +msgid "creator" +msgstr "创建者" + +#: web/templates/cluster/list.html:27 web/templates/group/index.html:29 +#: web/templates/group/templates.html:21 web/templates/host/groups.html:17 +#: web/templates/plugin/list.html:17 web/templates/template/list.html:30 +#: web/templates/template/update.html:55 +msgid "operation" +msgstr "操作" + +#: web/templates/cluster/list.html:59 web/templates/expression/list.html:56 +#: web/templates/group/index.html:58 web/templates/group/templates.html:43 +#: web/templates/host/groups.html:35 web/templates/host/index.html:58 +#: web/templates/host/templates.html:37 web/templates/nodata/list.html:63 +#: web/templates/plugin/list.html:39 web/templates/template/list.html:66 +#: web/templates/template/update.html:87 web/templates/template/view.html:63 +msgid "no records" +msgstr "没有记录" + +#: web/templates/expression/add.html:11 web/templates/nodata/add.html:49 +msgid "modify" +msgstr "修改" + +#: web/templates/expression/add.html:11 web/templates/nodata/add.html:49 +msgid "add" +msgstr "添加" + +#: web/templates/expression/add.html:11 +msgid "expression" +msgstr "策略表达式" + +#: web/templates/expression/add.html:15 web/templates/plugin/list.html:48 +msgid "e.g." +msgstr "如:" + +#: web/templates/expression/add.html:89 web/templates/group/advanced.html:18 +#: web/templates/nodata/add.html:106 +msgid "Submit" +msgstr "提交" + +#: web/templates/expression/add.html:92 web/templates/group/templates.html:62 +#: web/templates/host/add.html:28 web/templates/host/groups.html:45 +#: web/templates/host/templates.html:47 web/templates/nodata/add.html:110 +#: web/templates/plugin/list.html:56 +msgid "Back" +msgstr "返回" + +#: web/templates/expression/list.html:7 web/templates/group/index.html:7 +#: web/templates/host/index.html:11 web/templates/nodata/list.html:25 +#: web/templates/template/list.html:7 +msgid "search..." +msgstr "搜索..." + +#: web/templates/expression/list.html:13 web/templates/group/index.html:13 +#: web/templates/nodata/list.html:31 web/templates/template/list.html:13 +msgid "mine" +msgstr "只看我创建的" + +#: web/templates/expression/view.html:7 +msgid "expression detail" +msgstr "策略表达式详情" + +#: web/templates/group/advanced.html:6 +msgid "Batch rename hostgroup" +msgstr "批量重命名机器分组名字" + +#: web/templates/group/advanced.html:11 +msgid "old" +msgstr "旧" + +#: web/templates/group/advanced.html:15 +msgid "new" +msgstr "新" + +#: web/templates/group/advanced.html:19 +msgid "Cancel" +msgstr "取消" + +#: web/templates/group/index.html:16 web/templates/template/list.html:16 +msgid "input name to create" +msgstr "输入新名称来创建" + +#: web/templates/group/index.html:27 web/templates/host/index.html:51 +msgid "hostgroup" +msgstr "机器分组" + +#: web/templates/group/index.html:38 web/templates/host/index.html:53 +msgid "templates" +msgstr "监控模板" + +#: web/templates/group/index.html:40 +msgid "hosts" +msgstr "机器" + +#: web/templates/group/index.html:42 web/templates/plugin/list.html:6 +msgid "plugins" +msgstr "插件" + +#: web/templates/group/index.html:44 +msgid "aggregator" +msgstr "集群监控项" + +#: web/templates/group/templates.html:10 +msgid "related templates list" +msgstr "关联监控模板列表" + +#: web/templates/group/templates.html:19 +msgid "template" +msgstr "模板" + +#: web/templates/group/templates.html:53 +msgid "input template name" +msgstr "输入模板名..." + +#: web/templates/group/templates.html:58 web/templates/plugin/list.html:52 +msgid "Bind" +msgstr "绑定" + +#: web/templates/host/add.html:24 web/templates/host/index.html:28 +msgid "Add Host" +msgstr "添加机器" + +#: web/templates/host/groups.html:6 +msgid "binding groups" +msgstr "机器绑定的机器分组" + +#: web/templates/host/groups.html:8 +msgid "current host:" +msgstr "当前机器:" + +#: web/templates/host/groups.html:15 +msgid "group" +msgstr "机器分组" + +#: web/templates/host/index.html:18 +msgid "maintaining" +msgstr "只看处于维护期的机器" + +#: web/templates/host/index.html:37 +msgid "hostname" +msgstr "机器名" + +#: web/templates/host/index.html:38 +msgid "maintain begin" +msgstr "维护开始时间" + +#: web/templates/host/index.html:39 +msgid "maintain end" +msgstr "维护结束时间" + +#: web/templates/host/index.html:40 +msgid "relation" +msgstr "关联" + +#: web/templates/host/index.html:70 +msgid "begin" +msgstr "开始时间" + +#: web/templates/host/index.html:75 +msgid "end" +msgstr "结束时间" + +#: web/templates/host/index.html:80 +msgid "Maintain" +msgstr "设置维护" + +#: web/templates/host/index.html:83 +msgid "Unset" +msgstr "取消维护" + +#: web/templates/host/index.html:98 +msgid "total" +msgstr "共计" + +#: web/templates/host/index.html:98 +msgid "page size" +msgstr "每页" + +#: web/templates/host/templates.html:6 +msgid "binding templates" +msgstr "机器绑定的监控模板" + +#: web/templates/host/templates.html:15 +msgid "name" +msgstr "监控模板名" + +#: web/templates/host/templates.html:16 web/templates/template/list.html:28 +msgid "parent" +msgstr "父模板" + +#: web/templates/nodata/add.html:49 +msgid "nodata" +msgstr "数据补缺" + +#: web/templates/nodata/add.html:54 +msgid "nodata name" +msgstr "名称" + +#: web/templates/nodata/add.html:85 +msgid "type" +msgstr "类型" + +#: web/templates/plugin/list.html:15 +msgid "plugin dir" +msgstr "插件目录" + +#: web/templates/template/groups.html:6 +msgid "host groups" +msgstr "机器分组" + +#: web/templates/template/groups.html:8 web/templates/template/view.html:13 +msgid "current template:" +msgstr "当前监控模板:" + +#: web/templates/template/list.html:27 +msgid "template name" +msgstr "监控模板名" + +#: web/templates/template/update.html:50 web/templates/template/view.html:40 +msgid "metric/tags [note]" +msgstr "监控项/标签 [备注]" + +#: web/templates/template/update.html:51 web/templates/template/view.html:41 +msgid "condition" +msgstr "条件" + +#: web/templates/template/update.html:52 web/templates/template/view.html:42 +msgid "max" +msgstr "最大报警次数" + +#: web/templates/template/update.html:53 web/templates/template/view.html:43 +msgid "P" +msgstr "报警级别" + +#: web/templates/template/update.html:54 web/templates/template/view.html:44 +msgid "run_at" +msgstr "生效时间段" + +#: web/templates/template/update.html:141 +#: web/templates/template/update.html:189 +msgid "Save" +msgstr "保存" +
metric/tags/noteconditionmaxPrun{{ _('metric/tags [note]') }}{{ _('condition') }}{{ _('max') }}{{ _('P') }}{{ _('run_at') }}
no records{{ _('no records') }}