mjawurek fc08681d89 A first attempt at internationalization of WebGoat. For complete internationalization WebGoat needs two things:
1. Every text passage/label that appears in lessons must independent of the current language set for WebGoat.
2. Every lesson plan and solutions must be translated for each supported language.
Number 1 is achieved by using webgoat/util/WebgoatI18N.java and by having every output routed through this piece of code. You no longer say hints.add("Lesson Hint 1"); or ....addElement("Shopping Cart")) but you in the lesson you say hints.add(WebGoatI18N.get("Lesson Hint1")) or ....addElement(WebGoatI18N.get("Shopping Cart"). Then WebGoatI18N looks up the corresponding string for the language set as the current lanuage and returns it.
Number 2 is achieved by having subdirectories in lesson_plans corresponding to every language. That means, a lesson that has been translated to Spanish and German will be found in lesson_plans/English and lesson_plans/Spanish and lesson_plans/German.

This is how WebGoat finds out about available languages: in Course.java in loadResources() it looks for lesson plans.
Unlike before, now a lesson plan can be found multiple times in different "language" directories. So for every directory the lesson plan is found in, WebGoat associates this language with the lesson and also lets WebGoatI18N load the appropriate WebGoatLabels_$LANGAUGE$.properties file which contains the translations of labels.
So this is what you have to do for a new language:
First of all, you have to copy and translate every lesson plan that you need in the new language, and then you also have to create a WebGoatLabels_$LANGUAGE$.properties file with that labels that will be used in these lessons. Atm WebGoat crashes throws an exception when a label is missing but this can be sorted out quickly. 

git-svn-id: http://webgoat.googlecode.com/svn/trunk@389 4033779f-a91e-0410-96ef-6bf7bf53c507
2009-10-26 15:58:15 +00:00

289 lines
3.9 KiB
CSS

body{
min-width: 800px;
font-family: Arial,sans-serif;
color: #333333;
line-height: 1.166;
margin: 0px;
padding: 0px;
}
a:link, a:visited, a:hover {
color: #666666;
text-decoration: none;
}
a:hover {
text-decoration: underline;
color: red;
}
h1, h2, h3, h4, h5, h6 {
font-family: Arial,sans-serif;
margin: 0px;
padding: 0px;
}
h1{
font-family: Verdana,Arial,sans-serif;
font-size: 120%;
color: #333333;
}
h2{
font-size: 114%;
color: #333333;
}
h3{
font-size: 100%;
color: #334d55;
}
h4{
font-size: 100%;
font-weight: normal;
color: #333333;
}
h5{
font-size: 100%;
color: #334d55;
}
ul{
list-style-type: square;
}
ul ul{
list-style-type: disc;
}
ul ul ul{
list-style-type: none;
}
#navBar{
margin: 0 79% 0 0;
padding: 0px;
background-color: #999999;
}
#twoCol{
margin: 0;
padding-left: 13px;
}
#siteName{
margin: 0px;
padding: 0px 0px 10px 10px;
}
#lessonName{
padding: 5px 0px 10px 10px;
}
#globalNav{
color: #cccccc;
padding: 0px 10px;
white-space: nowrap;
}
#globalNav img{
display: block;
}
#globalNav a {
font-size: 10px;
padding: 0px 4px 0px 0px;
}
.lessonContent{
padding: 10px 10px 10px 10px;
font-size: 10px;
}
.lessonText h3{
padding: 30px 0px 5px 0px;
text-align: center;
}
.lessonText img{
float: left;
padding: 0px 10px 0px 0px;
margin: 0 5px 5px 0;
}
#bottom{
color: #999999;
clear: both;
font-size: 10px;
padding-top: 5px;
}
#navBar ul a:link, #navBar ul a:visited {}
#navBar ul {
list-style: none;
margin: 0;
padding: 0;
}
/* hack to fix IE/Win's broken rendering of block-level anchors in lists */
#navBar li {}
/* fix for browsers that don't need the hack */
html>body #navBar li {}
#top{
height:136px;
background-image: url(../images/header/header.jpg);
width: 800px;
}
#top_challenge{
height:136px;
width: 800px;
}
#topLinks{
position: relative;
margin: 0px;
padding: 0px;
font-size: small;
}
#topLinks h3{
padding: 10px 0px 2px 10px;
}
#topLinks a:link{
padding: 2px 0px 2px 10px;
width: 100%;voice-family: "\"}\"";
voice-family:inherit;
width: auto;
}
#topLinks a:visited{
border-top: 1px solid #cccccc;
padding: 2px 0px 2px 10px;
}
#topLinks a:hover{
background-color: #FFFFFF;
padding: 5px 2px 2px 10px;
}
#menuSpacer {
float: left;
width: 225px;
}
#lessonArea {
float: right;
width: 540px;
height: 100%;
padding: 10px;
}
#wrap {
width: 800px;
word-wrap:break-word; /* Fixes IE wrapping issue */
}
#topRight {
position:absolute;
left:485px;
top:0px;
width:320px;
height:23px;
z-index:3;
float: right;
}
#topRightInner {
position:absolute;
left:450px;
top:10px;
width:300px;
height:23px;
z-index:4;
float: right;
}
.info {
color: red;
font-weight: bold;
}
#reset {
text-align: right;
font-weight: bold;
float: right;
display: inline;
margin-bottom: 10px;
}
#training {
text-align: left;
font-weight: bold;
display: inline;
float: left;
margin-bottom: 10px;
}
#training_wrap {
width: 540px;
}
#hint{}
#parameter{}
#cookie{}
#message{
margin-bottom: 20px;
margin-top: 10px;
}
#lessonPlans {
border: 1px solid #000000;
background-color: #FFFFFF;
margin: 15px;
padding: 25px;
padding-bottom: 75px;
}
#credits {
float: right;
}
#start {
height: 390px;
width: 700px;
padding: 10px 50px 10px 50px;
font-size: 15px;
}
#warning {
border: 1px solid #666666;
padding: 10px;
font-size: 10px;
color: #FF3300;
width: 600px;
margin-left: 100px;
margin-right: 100px;
}
#team {
width: 580px;
margin-right: 50px;
margin-left: 50px;
padding-top: 5px;
padding-right: 10px;
padding-bottom: 5px;
padding-left: 10px;
}
.style1 {
font-size: 11px;
font-weight: bold;
}
.style2 {
font-size: 10px;
}