浏览代码

added __("text") function for the gettext class

Victor De la Rocha 18 年前
父节点
当前提交
2f150108c3
共有 3 个文件被更改,包括 51 次插入51 次删除
  1. 17 17
      admin/options.php
  2. 18 18
      admin/settings.php
  3. 16 16
      admin/user.php

+ 17 - 17
admin/options.php 查看文件

32
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33
 	<html xmlns="http://www.w3.org/1999/xhtml">
33
 	<html xmlns="http://www.w3.org/1999/xhtml">
34
 	<head>
34
 	<head>
35
-		<title>gelato :: options</title>
35
+		<title>gelato :: <?=__("options")?></title>
36
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
36
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
37
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
38
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
38
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
55
 	</head>
55
 	</head>
56
 	
56
 	
57
 	<body>
57
 	<body>
58
-		<div id="div-process" style="display:none;">Processing request...</div>
58
+		<div id="div-process" style="display:none;"><?=__("Processing request...")?></div>
59
 		<div id="cont">
59
 		<div id="cont">
60
 			<div id="head">
60
 			<div id="head">
61
-				<h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: home">gelato cms</a></h1>
61
+				<h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: <?=__("home")?>">gelato cms</a></h1>
62
 				<ul id="nav">
62
 				<ul id="nav">
63
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="Take me to the tumblelog">Back to the Tumblelog</a></li>
63
+					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?=__("Take me to the tumblelog")?>"><?=__("Back to the Tumblelog")?></a></li>
64
 			  	</ul>
64
 			  	</ul>
65
 			</div>
65
 			</div>
66
 			<div id="main">				
66
 			<div id="main">				
67
 				
67
 				
68
 				<div class="box">
68
 				<div class="box">
69
 					<ul class="menu manage">
69
 					<ul class="menu manage">
70
-					<h3>Tumblelog options</h3>
71
-					<li><a href="index.php">Post</a></li>
72
-					<li><a href="admin.php">Users</a></li>
73
-					<li><a href="settings.php">Settings</a></li>
74
-					<li class="selected"><a>Options</a></li>
70
+					<h3><?=__("Tumblelog options")?></h3>
71
+					<li><a href="index.php"><?=__("Post")?></a></li>
72
+					<li><a href="admin.php"><?=__("Users")?></a></li>
73
+					<li><a href="settings.php"><?=__("Settings")?></a></li>
74
+					<li class="selected"><a><?=__("Options")?></a></li>
75
 					</ul>
75
 					</ul>
76
 					<p>&nbsp;</p>
76
 					<p>&nbsp;</p>
77
 <?php
77
 <?php
78
 					if (isset($_GET["modified"])) {
78
 					if (isset($_GET["modified"])) {
79
 						if ($_GET["modified"]=="true") {
79
 						if ($_GET["modified"]=="true") {
80
-							echo "<div class=\"exito\" id=\"divMessages\">The configuration has been modified successfully.</div>";
80
+							echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
81
 						}
81
 						}
82
 					}					
82
 					}					
83
 					if (isset($_GET["error"])) {
83
 					if (isset($_GET["error"])) {
84
 						if ($_GET["error"]==1) {
84
 						if ($_GET["error"]==1) {
85
-							echo "<div class=\"error\" id=\"divMessages\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
85
+							echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
86
 						}
86
 						}
87
 					}
87
 					}
88
 ?>
88
 ?>
91
 						<form action="options.php" method="post" id="options_form" autocomplete="off" class="newpost">							
91
 						<form action="options.php" method="post" id="options_form" autocomplete="off" class="newpost">							
92
 							<fieldset>								
92
 							<fieldset>								
93
 								<ul>																	
93
 								<ul>																	
94
-									<li><label for="rich_text">Rich text editor:</label>
94
+									<li><label for="rich_text"><?=__("Rich text editor:")?></label>
95
 										<select name="rich_text" id="rich_text">										
95
 										<select name="rich_text" id="rich_text">										
96
-											<option value="1" <?php if($conf->richText) echo "selected"; ?>>Active</option>
97
-											<option value="0" <?php if(!$conf->richText) echo "selected"; ?>>Deactive</option>
96
+											<option value="1" <?php if($conf->richText) echo "selected"; ?>><?=__("Active")?></option>
97
+											<option value="0" <?php if(!$conf->richText) echo "selected"; ?>><?=__("Deactive")?></option>
98
 										</select>
98
 										</select>
99
 									</li>
99
 									</li>
100
 									<li><label for="rich_text">URL friendly:</label>
100
 									<li><label for="rich_text">URL friendly:</label>
101
 										<select name="url_friendly" id="url_friendly">
101
 										<select name="url_friendly" id="url_friendly">
102
-											<option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>>Active</option>
103
-											<option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>>Deactive</option>
102
+											<option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>><?=__("Active")?></option>
103
+											<option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>><?=__("Deactive")?></option>
104
 										</select>
104
 										</select>
105
 									</li>
105
 									</li>
106
 								</ul>
106
 								</ul>
107
 							</fieldset>
107
 							</fieldset>
108
 							<p>
108
 							<p>
109
-								<input type="submit" name="btnsubmit" id="btnsubmit" value="Modify" class="submit"/>
109
+								<input type="submit" name="btnsubmit" id="btnsubmit" value="<?=__("Modify")?>" class="submit"/>
110
 							</p>
110
 							</p>
111
 						</form>	
111
 						</form>	
112
 								
112
 								

+ 18 - 18
admin/settings.php 查看文件

32
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33
 	<html xmlns="http://www.w3.org/1999/xhtml">
33
 	<html xmlns="http://www.w3.org/1999/xhtml">
34
 	<head>
34
 	<head>
35
-		<title>gelato :: settings</title>
35
+		<title>gelato :: <?=__("settings")?></title>
36
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
36
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
37
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
38
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
38
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
55
 	</head>
55
 	</head>
56
 	
56
 	
57
 	<body>
57
 	<body>
58
-		<div id="div-process" style="display:none;">Processing request...</div>
58
+		<div id="div-process" style="display:none;"><?=__("Processing request...")?></div>
59
 		<div id="cont">
59
 		<div id="cont">
60
 			<div id="head">
60
 			<div id="head">
61
-				<h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: home">gelato cms</a></h1>
61
+				<h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: <?=__("home")?>">gelato cms</a></h1>
62
 				<ul id="nav">
62
 				<ul id="nav">
63
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="Take me to the tumblelog">Back to the Tumblelog</a></li>
63
+					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?=__("Take me to the tumblelog")?>"><?=__("Back to the Tumblelog")?></a></li>
64
 			  	</ul>
64
 			  	</ul>
65
 			</div>
65
 			</div>
66
 			<div id="main">				
66
 			<div id="main">				
67
 				
67
 				
68
 				<div class="box">
68
 				<div class="box">
69
 					<ul class="menu manage">
69
 					<ul class="menu manage">
70
-					<h3>Tumblelog configuration</h3>
71
-					<li><a href="index.php">Post</a></li>
72
-					<li><a href="admin.php">Users</a></li>
73
-					<li><a href="options.php">Options</a></li>
74
-					<li class="selected"><a>Settings</a></li>
70
+					<h3><?=__("Tumblelog configuration")?></h3>
71
+					<li><a href="index.php"><?=__("Post")?></a></li>
72
+					<li><a href="admin.php"><?=__("Users")?></a></li>
73
+					<li><a href="options.php"><?=__("Options")?></a></li>
74
+					<li class="selected"><a><?=__("Settings")?></a></li>
75
 					</ul>
75
 					</ul>
76
 					<p>&nbsp;</p>
76
 					<p>&nbsp;</p>
77
 <?php
77
 <?php
78
 					if (isset($_GET["modified"])) {
78
 					if (isset($_GET["modified"])) {
79
 						if ($_GET["modified"]=="true") {
79
 						if ($_GET["modified"]=="true") {
80
-							echo "<div class=\"exito\" id=\"divMessages\">The configuration has been modified successfully.</div>";
80
+							echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
81
 						}
81
 						}
82
 					}					
82
 					}					
83
 					if (isset($_GET["error"])) {
83
 					if (isset($_GET["error"])) {
84
 						if ($_GET["error"]==1) {
84
 						if ($_GET["error"]==1) {
85
-							echo "<div class=\"error\" id=\"divMessages\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
85
+							echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
86
 						}
86
 						}
87
 					}
87
 					}
88
 ?>
88
 ?>
91
 						<form action="settings.php" method="post" id="settings_form" autocomplete="off" class="newpost">							
91
 						<form action="settings.php" method="post" id="settings_form" autocomplete="off" class="newpost">							
92
 							<fieldset>								
92
 							<fieldset>								
93
 								<ul>							
93
 								<ul>							
94
-									<li><label for="title">Title:</label>
94
+									<li><label for="title"><?=__("Title:")?></label>
95
 										<input type="text" name="title" id="title" value="<?php echo $conf->title;?>" class="txt"/></li>
95
 										<input type="text" name="title" id="title" value="<?php echo $conf->title;?>" class="txt"/></li>
96
-									<li><label for="description">Description:</label>
96
+									<li><label for="description"><?=__("Description:")?></label>
97
 										<input type="text" name="description" id="description" value="<?php echo $conf->description;?>" class="txt"/></li>
97
 										<input type="text" name="description" id="description" value="<?php echo $conf->description;?>" class="txt"/></li>
98
-									<li><label for="url_installation">Installation URL</label>
98
+									<li><label for="url_installation"><?=__("Installation URL")?></label>
99
 										<input type="text" name="url_installation" id="url_installation" value="<?php echo $conf->urlGelato;?>" class="txt"/></li>
99
 										<input type="text" name="url_installation" id="url_installation" value="<?php echo $conf->urlGelato;?>" class="txt"/></li>
100
-									<li><label for="posts_limit">Post limit:</label>
100
+									<li><label for="posts_limit"><?=__("Post limit:")?></label>
101
 										<input type="text" name="posts_limit" id="posts_limit" value="<?php echo $conf->postLimit;?>" class="txt"/></li>
101
 										<input type="text" name="posts_limit" id="posts_limit" value="<?php echo $conf->postLimit;?>" class="txt"/></li>
102
-									<li><label for="lang">Language:</label>
102
+									<li><label for="lang"><?=__("Language:")?></label>
103
 										<select id="lang" name="lang">
103
 										<select id="lang" name="lang">
104
 											<option value="en" selected="selected">english</option>
104
 											<option value="en" selected="selected">english</option>
105
 										</select>
105
 										</select>
106
 									</li>
106
 									</li>
107
-									<li><label for="template">Template:</label>
107
+									<li><label for="template"><?=__("Template:"?></label>
108
 										<select id="template" name="template">
108
 										<select id="template" name="template">
109
 <?php
109
 <?php
110
 										$themes = getThemes();
110
 										$themes = getThemes();
119
 								</ul>
119
 								</ul>
120
 							</fieldset>
120
 							</fieldset>
121
 							<p>
121
 							<p>
122
-								<input type="submit" name="btnsubmit" id="btnsubmit" value="Modify" class="submit"/>
122
+								<input type="submit" name="btnsubmit" id="btnsubmit" value="<?=__("Modify")?>" class="submit"/>
123
 							</p>
123
 							</p>
124
 						</form>	
124
 						</form>	
125
 								
125
 								

+ 16 - 16
admin/user.php 查看文件

53
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
53
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
54
 	<html xmlns="http://www.w3.org/1999/xhtml">
54
 	<html xmlns="http://www.w3.org/1999/xhtml">
55
 	<head>
55
 	<head>
56
-		<title>gelato :: add user</title>
56
+		<title>gelato :: <?php echo __("add user")?></title>
57
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
57
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
58
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
58
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
59
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
59
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
65
 	</head>
65
 	</head>
66
 	
66
 	
67
 	<body>
67
 	<body>
68
-		<div id="div-process" style="display:none;">Processing request...</div>
68
+		<div id="div-process" style="display:none;"><?=__("Processing request...");?></div>
69
 		<div id="cont">
69
 		<div id="cont">
70
 			<div id="head">
70
 			<div id="head">
71
-				<h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: home">gelato cms</a></h1>
71
+				<h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: <?=__("home")?>">gelato cms</a></h1>
72
 				<ul id="nav">
72
 				<ul id="nav">
73
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="Take me to the tumblelog">Back to the Tumblelog</a></li>
73
+					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?=__("Take me to the tumblelog")?>"><?=__("Back to the Tumblelog")?></a></li>
74
 			  	</ul>
74
 			  	</ul>
75
 			</div>
75
 			</div>
76
 			<div id="main">				
76
 			<div id="main">				
77
 				
77
 				
78
 				<div class="box">
78
 				<div class="box">
79
 					<ul class="menu manage">
79
 					<ul class="menu manage">
80
-					<h3>Start session</h3>
81
-					<li><a href="index.php">Post</a></li>
82
-					<li><a href="admin.php">Users</a></li>
83
-					<li class="selected"><a><?php echo ($isEdition) ? "Edit" : "Add"; ?></a></li>
80
+					<h3><?=__("Start session")?></h3>
81
+					<li><a href="index.php"><?=__("Post")?></a></li>
82
+					<li><a href="admin.php"><?=__("Users")?></a></li>
83
+					<li class="selected"><a><?php echo ($isEdition) ? __("Edit") : __("Add"); ?></a></li>
84
 					</ul>
84
 					</ul>
85
 				
85
 				
86
 					<div class="tabla">
86
 					<div class="tabla">
96
 							}
96
 							}
97
 ?>
97
 ?>
98
 							<li>
98
 							<li>
99
-								<label for="login">user:</label>
99
+								<label for="login"><?=__("user:")?></label>
100
 									<input class="txt" name="login" id="login" type="text" autocomplete="off" value="<?php echo isset($register["login"])?$register["login"]:"";?>" />
100
 									<input class="txt" name="login" id="login" type="text" autocomplete="off" value="<?php echo isset($register["login"])?$register["login"]:"";?>" />
101
 <?php
101
 <?php
102
 							if (!$isEdition) {
102
 							if (!$isEdition) {
112
 								<div id="target" style="display:none;"></div>
112
 								<div id="target" style="display:none;"></div>
113
 							</li>
113
 							</li>
114
 							<li>
114
 							<li>
115
-								<label for="pass">password:</label>
115
+								<label for="pass"><?=__("password:")?></label>
116
 									<input class="txt" name="password" id="password" type="password" />
116
 									<input class="txt" name="password" id="password" type="password" />
117
 							</li>
117
 							</li>
118
 							<li>
118
 							<li>
119
-								<label for="repass">retype password:</label>
119
+								<label for="repass"><?=__("retype password:")?></label>
120
 									<input class="txt" name="repass" id="repass" type="password" />
120
 									<input class="txt" name="repass" id="repass" type="password" />
121
 							</li>
121
 							</li>
122
 							<li>
122
 							<li>
123
-								<label for="name">name:</label>
123
+								<label for="name"><?=__("name:")?></label>
124
 									<input class="txt" name="name" id="name" type="text" value="<?php echo isset($register["name"])?$register["name"]:"";?>" />
124
 									<input class="txt" name="name" id="name" type="text" value="<?php echo isset($register["name"])?$register["name"]:"";?>" />
125
 							</li>
125
 							</li>
126
 							<li>
126
 							<li>
127
-								<label for="email">e-mail:</label>
127
+								<label for="email"><?=__("e-mail:")?></label>
128
 									<input class="txt" name="email" id="email" type="text" value="<?php echo isset($register["email"])?$register["email"]:"";?>" />
128
 									<input class="txt" name="email" id="email" type="text" value="<?php echo isset($register["email"])?$register["email"]:"";?>" />
129
 							</li>
129
 							</li>
130
 							<li>
130
 							<li>
131
-								<label for="website">website:</label>
131
+								<label for="website"><?=__("website:")?></label>
132
 									<input class="txt" name="website" id="website" type="text" value="<?php echo isset($register["website"])?$register["website"]:"";?>" />
132
 									<input class="txt" name="website" id="website" type="text" value="<?php echo isset($register["website"])?$register["website"]:"";?>" />
133
 							</li>								
133
 							</li>								
134
 							<li>
134
 							<li>
135
-								<label for="about">about:</label><br />
135
+								<label for="about"><?=__("about:")?></label><br />
136
 									<textarea rows="5" cols="50" name="about" id="about" tabindex="7"><?php echo isset($register["about"])?$register["about"]:"";?></textarea>									
136
 									<textarea rows="5" cols="50" name="about" id="about" tabindex="7"><?php echo isset($register["about"])?$register["about"]:"";?></textarea>									
137
 							</li>								
137
 							</li>								
138
 							<li>
138
 							<li>
139
-								<input name="btnAdd" type="submit" value="<?php echo ($isEdition) ? "Modify" : "Add"; ?> user" />
139
+								<input name="btnAdd" type="submit" value="<?php echo ($isEdition) ? __("Modify") : __("Add"); ?> user" />
140
 							</li>
140
 							</li>
141
 						</ul>
141
 						</ul>
142
 						</fieldset>
142
 						</fieldset>