Bläddra i källkod

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

Victor De la Rocha 17 år sedan
förälder
incheckning
2f150108c3
3 ändrade filer med 51 tillägg och 51 borttagningar
  1. 17 17
      admin/options.php
  2. 18 18
      admin/settings.php
  3. 16 16
      admin/user.php

+ 17 - 17
admin/options.php Visa fil

@@ -32,7 +32,7 @@ if ($user->isAdmin()) {
32 32
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33 33
 	<html xmlns="http://www.w3.org/1999/xhtml">
34 34
 	<head>
35
-		<title>gelato :: options</title>
35
+		<title>gelato :: <?=__("options")?></title>
36 36
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37 37
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
38 38
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
@@ -55,34 +55,34 @@ if ($user->isAdmin()) {
55 55
 	</head>
56 56
 	
57 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 59
 		<div id="cont">
60 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 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 64
 			  	</ul>
65 65
 			</div>
66 66
 			<div id="main">				
67 67
 				
68 68
 				<div class="box">
69 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 75
 					</ul>
76 76
 					<p>&nbsp;</p>
77 77
 <?php
78 78
 					if (isset($_GET["modified"])) {
79 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 83
 					if (isset($_GET["error"])) {
84 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,22 +91,22 @@ if ($user->isAdmin()) {
91 91
 						<form action="options.php" method="post" id="options_form" autocomplete="off" class="newpost">							
92 92
 							<fieldset>								
93 93
 								<ul>																	
94
-									<li><label for="rich_text">Rich text editor:</label>
94
+									<li><label for="rich_text"><?=__("Rich text editor:")?></label>
95 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 98
 										</select>
99 99
 									</li>
100 100
 									<li><label for="rich_text">URL friendly:</label>
101 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 104
 										</select>
105 105
 									</li>
106 106
 								</ul>
107 107
 							</fieldset>
108 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 110
 							</p>
111 111
 						</form>	
112 112
 								

+ 18 - 18
admin/settings.php Visa fil

@@ -32,7 +32,7 @@ if ($user->isAdmin()) {
32 32
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33 33
 	<html xmlns="http://www.w3.org/1999/xhtml">
34 34
 	<head>
35
-		<title>gelato :: settings</title>
35
+		<title>gelato :: <?=__("settings")?></title>
36 36
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37 37
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
38 38
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
@@ -55,34 +55,34 @@ if ($user->isAdmin()) {
55 55
 	</head>
56 56
 	
57 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 59
 		<div id="cont">
60 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 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 64
 			  	</ul>
65 65
 			</div>
66 66
 			<div id="main">				
67 67
 				
68 68
 				<div class="box">
69 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 75
 					</ul>
76 76
 					<p>&nbsp;</p>
77 77
 <?php
78 78
 					if (isset($_GET["modified"])) {
79 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 83
 					if (isset($_GET["error"])) {
84 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,20 +91,20 @@ if ($user->isAdmin()) {
91 91
 						<form action="settings.php" method="post" id="settings_form" autocomplete="off" class="newpost">							
92 92
 							<fieldset>								
93 93
 								<ul>							
94
-									<li><label for="title">Title:</label>
94
+									<li><label for="title"><?=__("Title:")?></label>
95 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 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 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 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 103
 										<select id="lang" name="lang">
104 104
 											<option value="en" selected="selected">english</option>
105 105
 										</select>
106 106
 									</li>
107
-									<li><label for="template">Template:</label>
107
+									<li><label for="template"><?=__("Template:"?></label>
108 108
 										<select id="template" name="template">
109 109
 <?php
110 110
 										$themes = getThemes();
@@ -119,7 +119,7 @@ if ($user->isAdmin()) {
119 119
 								</ul>
120 120
 							</fieldset>
121 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 123
 							</p>
124 124
 						</form>	
125 125
 								

+ 16 - 16
admin/user.php Visa fil

@@ -53,7 +53,7 @@ if ($user->isAdmin()) {
53 53
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
54 54
 	<html xmlns="http://www.w3.org/1999/xhtml">
55 55
 	<head>
56
-		<title>gelato :: add user</title>
56
+		<title>gelato :: <?php echo __("add user")?></title>
57 57
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
58 58
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
59 59
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
@@ -65,22 +65,22 @@ if ($user->isAdmin()) {
65 65
 	</head>
66 66
 	
67 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 69
 		<div id="cont">
70 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 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 74
 			  	</ul>
75 75
 			</div>
76 76
 			<div id="main">				
77 77
 				
78 78
 				<div class="box">
79 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 84
 					</ul>
85 85
 				
86 86
 					<div class="tabla">
@@ -96,7 +96,7 @@ if ($user->isAdmin()) {
96 96
 							}
97 97
 ?>
98 98
 							<li>
99
-								<label for="login">user:</label>
99
+								<label for="login"><?=__("user:")?></label>
100 100
 									<input class="txt" name="login" id="login" type="text" autocomplete="off" value="<?php echo isset($register["login"])?$register["login"]:"";?>" />
101 101
 <?php
102 102
 							if (!$isEdition) {
@@ -112,31 +112,31 @@ if ($user->isAdmin()) {
112 112
 								<div id="target" style="display:none;"></div>
113 113
 							</li>
114 114
 							<li>
115
-								<label for="pass">password:</label>
115
+								<label for="pass"><?=__("password:")?></label>
116 116
 									<input class="txt" name="password" id="password" type="password" />
117 117
 							</li>
118 118
 							<li>
119
-								<label for="repass">retype password:</label>
119
+								<label for="repass"><?=__("retype password:")?></label>
120 120
 									<input class="txt" name="repass" id="repass" type="password" />
121 121
 							</li>
122 122
 							<li>
123
-								<label for="name">name:</label>
123
+								<label for="name"><?=__("name:")?></label>
124 124
 									<input class="txt" name="name" id="name" type="text" value="<?php echo isset($register["name"])?$register["name"]:"";?>" />
125 125
 							</li>
126 126
 							<li>
127
-								<label for="email">e-mail:</label>
127
+								<label for="email"><?=__("e-mail:")?></label>
128 128
 									<input class="txt" name="email" id="email" type="text" value="<?php echo isset($register["email"])?$register["email"]:"";?>" />
129 129
 							</li>
130 130
 							<li>
131
-								<label for="website">website:</label>
131
+								<label for="website"><?=__("website:")?></label>
132 132
 									<input class="txt" name="website" id="website" type="text" value="<?php echo isset($register["website"])?$register["website"]:"";?>" />
133 133
 							</li>								
134 134
 							<li>
135
-								<label for="about">about:</label><br />
135
+								<label for="about"><?=__("about:")?></label><br />
136 136
 									<textarea rows="5" cols="50" name="about" id="about" tabindex="7"><?php echo isset($register["about"])?$register["about"]:"";?></textarea>									
137 137
 							</li>								
138 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 140
 							</li>
141 141
 						</ul>
142 142
 						</fieldset>