Skip to content

Commit

Permalink
Merge branch 'master' of github.com:swcarpentry-ja/i18n into ja
Browse files Browse the repository at this point in the history
  • Loading branch information
TomKellyGenetics committed Oct 24, 2018
2 parents 8a0aee5 + 0e05fc2 commit f588000
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
34 changes: 34 additions & 0 deletions helpers/dashboard.jinja.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<html>
<head></head>

<body>

{% for repository in repositories['repository'].unique() -%}
<div> {{ repository }} </div>
<table>
<tr>
<td> language </td> <td> Translated Messages</td><td> Translated Source Words</td><td> Translated Target Words</td><td> Fuzzy Messages</td><td> Fuzzy Source Words</td><td> Untranslated Messages</td><td> Untranslated Source Words</td><td> Total Message</td><td> Total Source Words</td><td> Review Messages</td><td> Review Source Words</td>
</tr>
{% for index, language in repositories[ repositories['repository'] == repository].iterrows() -%}
<tr>
<td> {{ language['language'] }} </td>
<td> {{ language['Translated Messages'] }} </td>
<td> {{ language['Translated Source Words'] }} </td>
<td> {{ language['Translated Target Words'] }} </td>
<td> {{ language['Fuzzy Messages'] }} </td>
<td> {{ language['Fuzzy Source Words'] }} </td>
<td> {{ language['Untranslated Messages'] }} </td>
<td> {{ language['Untranslated Source Words'] }} </td>
<td> {{ language['Total Message'] }} </td>
<td> {{ language['Total Source Words'] }} </td>
<td> {{ language['Review Messages'] }} </td>
<td> {{ language['Review Source Words'] }} </td>
</tr>

{% endfor %}
</table>
{% endfor %}


</body>
</html>
16 changes: 16 additions & 0 deletions helpers/dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pandas as pd
from jinja2 import Template

tr_stats = pd.read_csv('output.csv')
tr_stats = tr_stats.rename(columns=lambda x: x.strip())
tr_stats['repository'] = tr_stats.Filename.str[3:-6]
tr_stats['language'] = tr_stats.Filename.str[-5:-3]

tr_stats = tr_stats.sort_values(by=['repository', 'Translated Messages'])


with open('dashboard.jinja.html') as file_:
template = Template(file_.read())

with open('dashboard.html', 'w') as out_:
out_.write(template.render(repositories=tr_stats))
3 changes: 3 additions & 0 deletions helpers/statslesson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ for lang in $( ls locale ); do
msgfmt --statistics --check po/${lesson}.${lang}.po &>> gh-pages/index.html
done
done
# pocount --full po/${lesson}.${lang}.po would work too and give more details
# or --csv


git add gh-pages/*
git commit -m "update from $(date)"
Expand Down

0 comments on commit f588000

Please sign in to comment.