Skip to content

Remove dependency on top #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9cc6f49
Get CPU info from /proc/stat instead of top - first attempt
May 11, 2016
b29297f
Rookie python error
May 11, 2016
3044b8c
Somehow code got into comments.
May 11, 2016
8cf9fce
Use real separator instead of a constant.
May 11, 2016
a008b2c
It seems we have to add all the CPUs together.
May 11, 2016
8456e47
Initialise your variables!
May 12, 2016
2fc1a93
Didn't fix code after copying. Wrong variable name.
May 12, 2016
ab20885
CPU to 2 decimal places
May 12, 2016
78f5d44
import math
May 12, 2016
fa6a589
First attempt at translation using Tornado-Babel.
May 13, 2016
823c8cc
Missing import of TornadoBabelMixin
May 13, 2016
9ccf49e
Maybe this will work for the mixin
May 13, 2016
6826459
Ok. This is apparently the correct way to import TornadoBabelMixin
May 13, 2016
0b6c1f7
Properly refer to tornado.web.RequestHandler
May 13, 2016
31acaae
Refer to locale.load_gettext_translations correctly.
May 13, 2016
97ca438
Revert end to their correct jinja2 endif and endfor
May 13, 2016
5fbad78
Added i18n script to aid translation process.
h6w Jun 16, 2016
fa1e950
Translation complete. Untested.
h6w Jun 16, 2016
d21c4da
Add '_' to kwargs to make the translation work.
Jun 19, 2016
3bde943
Filter out README, binary data, translations, and git dirs from i18n …
h6w Nov 13, 2016
222f43a
Add js to babel i18n translation process.
h6w Nov 13, 2016
a1d2006
Removed inline comments as per answer at http://stackoverflow.com/que…
h6w Nov 13, 2016
c4a513d
Merge branch 'i18n' of https://github.com/h6w/DNSmasqWeb into i18n
h6w Nov 13, 2016
6b36b85
Merge branch 'i18n'
h6w Nov 13, 2016
080e8c1
Convert from /usr/bin/python to more flexible /usr/bin/env python
h6w Nov 13, 2016
f5d217a
Ignore compiled python *.pyc
h6w Nov 14, 2016
a5d6427
Python concat operator mistake.
h6w Nov 14, 2016
ed5df65
Python concat operator mistake.
h6w Nov 14, 2016
4d3b643
Correct reference to class variable.
h6w Nov 14, 2016
ca349a5
Add timezone as an option in config.
h6w Nov 14, 2016
7c7c5be
Fix reference to object var. Correct sample timezone. Make run.py exe…
h6w Nov 28, 2016
f594d18
No need to escape function call from within jinja2 expression. Give d…
h6w Nov 28, 2016
aedf467
Fix more references to self vars.
h6w Nov 28, 2016
0e78a6a
More incorrect escaping.
h6w Nov 28, 2016
2f61e8c
Correct some translations.
h6w Nov 28, 2016
b9f25d1
More cleaning up translations.
h6w Nov 28, 2016
cb5794c
More translation fixes.
h6w Nov 28, 2016
e9da213
Correct CPU name to Hostname
h6w Nov 28, 2016
b6ad227
Correct system message to Host Information
h6w Nov 28, 2016
f7dee47
Correct typo run_sevice to run_service
h6w Nov 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
xk_config/xk_setting.py
6 changes: 6 additions & 0 deletions babel.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[python: **.py]
[jinja2: **/xk_html/**.html]
[jinja2: **/js/**.js]
encoding = utf-8
[extractors]
jinja2 = jinja2.ext:babel_extract
51 changes: 51 additions & 0 deletions i18n
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

langs_avail=`ls -1 translations`

## Update the babel translation
usage () {
echo "Update the internationalisation."
echo "Usage: $0 (update|edit|commit) ([lang]|all)*"
echo " todo - find non-ascii characters outside translation files"
echo " update - gets new var from source and updates messages.pot"
echo " edit - edits each translations/..../*.po with ${EDITOR}"
echo " commit - reads messages.pot and outputs translations/..../*.po"
echo "[lang] - specify the language to manipulate, one of:"
echo " ${langs_avail[@]}"
echo "Specifying no language defaults to \"all\"."
exit 1
}

if [ $# -gt 2 ] || [ $# -lt 1 ]; then
usage
elif [ $# -eq 1 ] || [ $2 == 'all' ]; then
declare -a langs
langs=$langs_avail
else
declare -a langs
langs=( $2 )
fi

ACTION="$1"
case $ACTION in
todo)
grep -I -r --exclude=README.md --exclude-dir=translations --exclude-dir=.git --color='auto' -P -n '[^\x00-\x7F]' ./
;;
update)
pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot .
pybabel update -i messages.pot -d translations
;;
edit)
editor="${VISUAL:-vi}"
for lang in ${langs[@]}; do
${editor} "translations/${lang}/LC_MESSAGES/messages.po"
done
;;
commit)
pybabel compile -d translations
;;
*)
echo "Unknown action $ACTION"
exit 1
;;
esac
Loading