Skip to content

Commit d1530f8

Browse files
author
tpagel
committed
Add gettext to headlines
1 parent 84e16a9 commit d1530f8

14 files changed

+1901
-1645
lines changed

data.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ function getKnowledge($elementImplementation)
8080
}
8181
$knowledge = $sum / $areaCount;
8282
}
83-
8483
return $knowledge;
8584
}
8685

@@ -94,7 +93,7 @@ function build_table_tooltip($array, $headerWeight = 2)
9493

9594
$html = "";
9695
$html .= "<h" . $headerWeight . ">Risiken und Maßnahmen</h$headerWeight>";
97-
$html .= "<div><b>Risiko:</b> " . $array['risk'] . "</div>";
96+
$html .= "<div><b>" . gettext("Risiko") . ":</b> " . $array['risk'] . "</div>";
9897
$html .= "<div><b>Gegenmaßnahme:</b> " . $array['measure'] . "</div>";
9998
$html .= "<hr />";
10099
$html .= "<h$headerWeight>Nutzen und Schwere der Implementierung</h$headerWeight>";
@@ -116,4 +115,4 @@ function getElementByName($dimensions, $name)
116115
}
117116
}
118117
}
119-
}
118+
}

data/culture.php

+151-162
Large diffs are not rendered by default.

data/deployment.php

+269-247
Large diffs are not rendered by default.

data/information.php

+291-277
Large diffs are not rendered by default.

data/infrastructure.php

+226-191
Large diffs are not rendered by default.

data/test.php

+690-668
Large diffs are not rendered by default.

head.php

+111-96
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,135 @@
11
<!DOCTYPE html >
22
<html moznomarginboxes mozdisallowselectionprint>
33
<head>
4-
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
4+
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
55

6-
<!-- Latest compiled and minified CSS -->
7-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
8-
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
6+
<!-- Latest compiled and minified CSS -->
7+
<link rel="stylesheet"
8+
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
9+
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
10+
crossorigin="anonymous">
911

10-
<!-- Optional theme -->
11-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
12-
integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
12+
<!-- Optional theme -->
13+
<link rel="stylesheet"
14+
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
15+
integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r"
16+
crossorigin="anonymous">
1317

14-
<!-- Latest compiled and minified JavaScript -->
15-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
16-
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
17-
crossorigin="anonymous"></script>
18+
<!-- Latest compiled and minified JavaScript -->
19+
<script
20+
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
21+
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
22+
crossorigin="anonymous"></script>
1823

19-
<link href="http://nvd3.org/assets/css/common.css" rel="stylesheet">
20-
<link href="http://nvd3.org/assets/css/nv.d3.css" rel="stylesheet">
24+
<link href="http://nvd3.org/assets/css/common.css" rel="stylesheet">
25+
<link href="http://nvd3.org/assets/css/nv.d3.css" rel="stylesheet">
2126

22-
<script src="http://nvd3.org/assets/js/lib/bootstrap.min.js"></script>
23-
<script src="http://nvd3.org/assets/lib/d3.v3.js"></script>
24-
<script src="http://nvd3.org/assets/js/nv.d3.js"></script>
27+
<script src="http://nvd3.org/assets/js/lib/bootstrap.min.js"></script>
28+
<script src="http://nvd3.org/assets/lib/d3.v3.js"></script>
29+
<script src="http://nvd3.org/assets/js/nv.d3.js"></script>
2530

26-
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/default.min.css">
27-
<link rel="stylesheet" href="spiderweb.css">
31+
<link rel="stylesheet"
32+
href="http://yandex.st/highlightjs/7.3/styles/default.min.css">
33+
<link rel="stylesheet" href="spiderweb.css">
2834

29-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
30-
<title><?php echo $title ?></title>
35+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
36+
<title><?php echo $title ?></title>
3137

32-
<!-- Latest compiled and minified CSS -->
33-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
34-
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"/>
38+
<!-- Latest compiled and minified CSS -->
39+
<link rel="stylesheet"
40+
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
41+
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
42+
crossorigin="anonymous" />
3543

3644

37-
<link href="print.css" rel="spiderweb.css"/>
38-
<link href="print.css" rel="stylesheet"/>
45+
<link href="print.css" rel="spiderweb.css" />
46+
<link href="print.css" rel="stylesheet" />
3947
</head>
4048

4149
<?php
4250
include_once "bib.php";
4351

44-
function getTableHeader()
45-
{
46-
$headers = array("Dimension", "Unter-Dimension", "Ebene 1: Grundverständnis von Sicherheitspraktiken", "Ebene 2: Erweitertes Verständnis von Sicherheitspraktiken", "Ebene 3: Hohes Verständnis von Sicherheitspraktiken", "Ebene 4: Sehr hohes Verständnis von Sicherheitspraktiken bei Skalierung");
47-
$headerContent = "<thead class=\"thead-default\"><tr>";
48-
foreach ($headers as $header) {
49-
$headerContent .= "<th>$header</th>";
50-
}
51-
return $headerContent . "</tr></thead>";
52+
// I18N support information here
53+
$language = 'en';
54+
putenv ( "LANG=$language" );
55+
setlocale ( LC_ALL, $language );
56+
57+
// Set the text domain as 'messages'
58+
$domain = 'messages';
59+
bindtextdomain ( $domain, "locale" );
60+
textdomain ( $domain );
61+
function getTableHeader() {
62+
$headers = array (
63+
gettext ( "Dimension" ),
64+
gettext ( "Sub-Dimension" ),
65+
gettext ( "Level 1: Basic understanding of security practices" ),
66+
gettext ( "Level 2: Understanding of security practices" ),
67+
gettext ( "Level 3: High understanding of security practices" ),
68+
gettext ( "Level 4: Advanced understanding of security practives at scale" )
69+
);
70+
$headerContent = "<thead class=\"thead-default\"><tr>";
71+
foreach ( $headers as $header ) {
72+
$headerContent .= "<th>$header</th>";
73+
}
74+
return $headerContent . "</tr></thead>";
5275
}
53-
54-
function getInfos($dimensions)
55-
{
56-
$text = "Anzahl der Elemente: " . getElementCount($dimensions);
57-
return $text;
76+
function getInfos($dimensions) {
77+
$text = "Anzahl der Elemente: " . getElementCount ( $dimensions );
78+
return $text;
5879
}
59-
60-
function getElementCount($dimensions)
61-
{
62-
$count = 0;
63-
foreach ($dimensions as $dimension => $subdimensions) {
64-
foreach ($subdimensions as $subdimension => $element) {
65-
$count = $count + count($element);
66-
echo "$subdimension" . count($element) . "<br>";
67-
}
68-
}
69-
return $count;
80+
function getElementCount($dimensions) {
81+
$count = 0;
82+
foreach ( $dimensions as $dimension => $subdimensions ) {
83+
foreach ( $subdimensions as $subdimension => $element ) {
84+
$count = $count + count ( $element );
85+
echo "$subdimension" . count ( $element ) . "<br>";
86+
}
87+
}
88+
return $count;
7089
}
71-
function getTable($dimensions)
72-
{
73-
$tableContent = "";
74-
$tableContent .= getTableHeader();
75-
foreach ($dimensions as $dimension => $subdimensions) {
76-
foreach ($subdimensions as $subdimension => $element) {
77-
$tableContent .= "<tr>";
78-
$tableContent .= "<td>";
79-
$tableContent .= "$dimension";
80-
$tableContent .= "</td>";
81-
82-
$tableContent .= "<td>";
83-
$tableContent .= "$subdimension";
84-
$tableContent .= "</td>";
85-
86-
for ($i = 1; $i <= 4; $i++) {
87-
$tableContent .= "<td><ul>";
88-
foreach ($element as $elementName => $content) {
89-
$content = getContentForLevelFromSubdimensions($i, $content, $elementName);
90-
if ($content != "") {
91-
$elementLink = "detail.php?dimension=" . urlencode($dimension) . "&subdimension=" . urlencode($subdimension) . "&element=" . urlencode($elementName);
92-
$tableContent .= "<a href='$elementLink' data-dimension='$dimension' data-subdimension='$subdimension' data-element='$elementName'";
93-
if (elementIsSelected($elementName)) {
94-
$tableContent .= "class='selected'";
95-
}
96-
$tableContent .= "><li>" . $content . "</li></a>";
97-
}
98-
}
99-
$tableContent .= "</ul></td>";
100-
}
101-
102-
$tableContent .= "</tr>";
103-
}
104-
105-
}
106-
$table = '<table class="table table-striped"><caption>Generisches DevOps-Sicherheits-Reifegradmodell</caption>';
107-
$table .= $tableContent;
108-
$table .= "</table>";
109-
return $table;
90+
function getTable($dimensions) {
91+
$tableContent = "";
92+
$tableContent .= getTableHeader ();
93+
foreach ( $dimensions as $dimension => $subdimensions ) {
94+
foreach ( $subdimensions as $subdimension => $element ) {
95+
$tableContent .= "<tr>";
96+
$tableContent .= "<td>";
97+
$tableContent .= "$dimension";
98+
$tableContent .= "</td>";
99+
100+
$tableContent .= "<td>";
101+
$tableContent .= "$subdimension";
102+
$tableContent .= "</td>";
103+
104+
for($i = 1; $i <= 4; $i ++) {
105+
$tableContent .= "<td><ul>";
106+
foreach ( $element as $elementName => $content ) {
107+
$content = getContentForLevelFromSubdimensions ( $i, $content, $elementName );
108+
if ($content != "") {
109+
$elementLink = "detail.php?dimension=" . urlencode ( $dimension ) . "&subdimension=" . urlencode ( $subdimension ) . "&element=" . urlencode ( $elementName );
110+
$tableContent .= "<a href='$elementLink' data-dimension='$dimension' data-subdimension='$subdimension' data-element='$elementName'";
111+
if (elementIsSelected ( $elementName )) {
112+
$tableContent .= "class='selected'";
113+
}
114+
$tableContent .= "><li>" . $content . "</li></a>";
115+
}
116+
}
117+
$tableContent .= "</ul></td>";
118+
}
119+
120+
$tableContent .= "</tr>";
121+
}
122+
}
123+
$table = '<table class="table table-striped"><caption>' . gettext ( "Generic DevOps Security Maturity Model" ) . '</caption>';
124+
$table .= $tableContent;
125+
$table .= "</table>";
126+
return $table;
110127
}
111-
112-
function getContentForLevelFromSubdimensions($level, $subdimension, $elementName)
113-
{
114-
if ($level != $subdimension["level"]) {
115-
return "";
116-
}
117-
$tooltip = "<div class='popoverdetails'>" . build_table_tooltip($subdimension) . "</div>";
118-
return "<div data-toggle=\"popover\" data-title=\"$elementName\" data-content=\"$tooltip\" type=\"button\" >" . $elementName . "</div>";
128+
function getContentForLevelFromSubdimensions($level, $subdimension, $elementName) {
129+
if ($level != $subdimension ["level"]) {
130+
return "";
131+
}
132+
$tooltip = "<div class='popoverdetails'>" . build_table_tooltip ( $subdimension ) . "</div>";
133+
return "<div data-toggle=\"popover\" data-title=\"$elementName\" data-content=\"$tooltip\" type=\"button\" >" . $elementName . "</div>";
119134
}
120135

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
$itle = "Tabellenübersicht";
2+
$title = gettext("Implementation Point Overview");
33
include_once "head.php";
44
?>
55
<body>

locale/de/LC_MESSAGES/messages.mo

Whitespace-only changes.

locale/de/LC_MESSAGES/messages.po

Whitespace-only changes.

locale/en/LC_MESSAGES/messages.mo

346 Bytes
Binary file not shown.

locale/en/LC_MESSAGES/messages.po

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PACKAGE VERSION\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2017-05-28 15:33+0200\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <[email protected]>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=CHARSET\n"
18+
"Content-Transfer-Encoding: 8bit\n"
19+
20+
#: data.php:97
21+
msgid "Risiko"
22+
msgstr ""
23+
24+
#: data/culture.php:3
25+
msgid "Review by any new Version"
26+
msgstr ""
27+
28+
#: data/culture.php:14
29+
msgid "Information security tragets are communicated"
30+
msgstr ""
31+
32+
#: data/culture.php:25
33+
msgid "Creation of easy abuse stories"
34+
msgstr ""
35+
36+
#: data/culture.php:36
37+
msgid "Creation of advanced abuse stories"
38+
msgstr ""
39+
40+
#: data/culture.php:50
41+
msgid "Conduction of simple threat modelling"
42+
msgstr ""
43+
44+
#: data/culture.php:61
45+
msgid "Conduction of advanced threat modelling"
46+
msgstr ""
47+
48+
#: data/culture.php:72
49+
msgid "Each team has a security champion"
50+
msgstr ""
51+
52+
#: data/culture.php:83
53+
msgid ""
54+
"Conduction of collaborative security checks with develoeprs and system "
55+
"administrators"
56+
msgstr ""
57+
58+
#: data/culture.php:94
59+
msgid "Security-Lessoned-Learned"
60+
msgstr ""
61+
62+
#: data/culture.php:105
63+
msgid "Reward of good communication"
64+
msgstr ""
65+
66+
#: data/culture.php:116
67+
msgid "One security expert for each team"
68+
msgstr ""
69+
70+
#: data/culture.php:127
71+
msgid "Conduction of collaborate team security checks"
72+
msgstr ""
73+
74+
#: data/culture.php:138
75+
msgid "Conduction of war games"
76+
msgstr ""
77+
78+
#: data/culture.php:152 data/culture.php:153
79+
msgid "Culture and Organisation"
80+
msgstr ""

messages.mo

380 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)