forked from carpentries-i18n/i18n
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:swcarpentry-ja/i18n into ja
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters