Added localization support to the html.header file.

As of this commit; the localization of gitinspector is pretty much
complete.
This commit is contained in:
Adam Waldenberg 2013-06-26 00:37:55 +02:00
parent a498603a50
commit a952921c32
2 changed files with 26 additions and 15 deletions

View File

@ -69,7 +69,19 @@ def output_header():
logo_file.close()
logo = base64.b64encode(logo)
print(html_header.format(version.__version__, jquery_js, tablesorter_js, flot_js, pie_js, logo.decode("utf-8", "replace")))
print(html_header.format(version = version.__version__,
jquery = jquery_js,
jquery_tablesorter = tablesorter_js,
jquery_flot = flot_js,
jquery_flot_pie = pie_js,
logo = logo.decode("utf-8", "replace"),
logo_text = _("The output has been generated by {0}; the statistical analysis tool " +
"for git repositories.").format(
"<a href=\"http://gitinspector.googlecode.com\">gitinspector</a>"),
show_minor_authors = _("Show minor authors"),
hide_minor_authors = _("Hide minor authors"),
show_minor_rows = _("Show rows with minor work"),
hide_minor_rows = _("Hide rows with minor work")))
elif __selected_format__ == "xml":
print("<gitinspector>")
print("\t<version>" + version.__version__ + "</version>")

View File

@ -2,11 +2,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<title>Generated by gitinspector {0}</title>
<script type="application/javascript">{1}</script>
<script type="application/javascript">{2}</script>
<script type="application/javascript">{3}</script>
<script type="application/javascript">{4}</script>
<title>Generated by gitinspector {version}</title>
<script type="application/javascript">{jquery}</script>
<script type="application/javascript">{jquery_tablesorter}</script>
<script type="application/javascript">{jquery_flot}</script>
<script type="application/javascript">{jquery_flot_pie}</script>
<script type="application/javascript">
$(document).ready(function() {{
var row = 0;
@ -67,12 +67,12 @@
return $(this).parent().parent().parent().find("tbody tr:hidden").length > 0;
}}).each(function() {{
$(this).addClass("hoverable");
this.innerHTML = "Show minor authors &or;";
this.innerHTML = "{show_minor_authors} &or;";
}}).toggle(function() {{
this.innerHTML = "Hide minor authors &and;";
this.innerHTML = "{hide_minor_authors} &and;";
$(this).parent().parent().parent().find("tbody tr").show().each(colorRows);
}}, function() {{
this.innerHTML = "Show minor authors &or;";
this.innerHTML = "{show_minor_authors} &or;";
$(this).parent().parent().parent().find("tbody tr td:last-child").filter(function() {{
return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE;
}}).parent().hide();
@ -83,13 +83,13 @@
if ($("div#timeline table.git tbody tr:hidden").length > 0) {{
$("div#timeline table.git tbody tr:visible").each(colorRows);
$("div#timeline").prepend("<div class=\"button\">Show rows with minor work &or;</div>");
$("div#timeline").prepend("<div class=\"button\">{show_minor_rows} &or;</div>");
$("div#timeline div.button").toggle(function() {{
this.innerHTML = "Hide rows with minor work &and;"
this.innerHTML = "{hide_minor_rows} &and;";
$("div#timeline table.git tbody tr").show().each(colorRows);
}}, function() {{
this.innerHTML = "Show rows with minor work &or;";
this.innerHTML = "{show_minor_rows} &or;";
filterTimeLine();
$("div#timeline table.git tbody tr:visible").each(colorRows);
}});
@ -229,7 +229,6 @@
</head>
<body>
<div><div class="box logo">
<img src="data:image/png;base64,{5}" />
<p>The output has been generated by <a href="http://gitinspector.googlecode.com">gitinspector</a>;
the statistical analysis tool for git repositories.<p>
<img src="data:image/png;base64,{logo}" />
<p>{logo_text}<p>
</div></div>