aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-06-20 14:51:33 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-06-20 14:51:33 +0200
commit4c1d3155a3ee4ddb48a0bb4281fe74391db1f016 (patch)
tree67630ddb4253bc68f819d648be34b5c84484c13d /settings
parent76b12c4ae0ea9941b030f0a13786d0ac3fc32f76 (diff)
downloadnextcloud-server-4c1d3155a3ee4ddb48a0bb4281fe74391db1f016.tar.gz
nextcloud-server-4c1d3155a3ee4ddb48a0bb4281fe74391db1f016.zip
make personal settings translatable
Diffstat (limited to 'settings')
-rw-r--r--settings/ajax/changepassword.php12
-rw-r--r--settings/ajax/setlanguage.php8
-rw-r--r--settings/l10n/messages.pot86
-rw-r--r--settings/l10n/xgettextfiles3
-rw-r--r--settings/templates/index.php16
5 files changed, 109 insertions, 16 deletions
diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php
index 1a9ad73610e..f568d3ef876 100644
--- a/settings/ajax/changepassword.php
+++ b/settings/ajax/changepassword.php
@@ -3,33 +3,35 @@
// Init owncloud
require_once('../../lib/base.php');
+$l=new OC_L10N('settings');
+
// We send json data
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_USER::isLoggedIn()){
- echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
+ echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t( "Authentication error" ) )));
exit();
}
// Get data
if( !isset( $_POST["password"] ) && !isset( $_POST["oldpassword"] )){
- echo json_encode( array( "status" => "error", "data" => array( "message" => "You have to enter the old and the new password!" )));
+ echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t( "You have to enter the old and the new password!" ) )));
exit();
}
// Check if the old password is correct
if( !OC_USER::checkPassword( $_SESSION["user_id"], $_POST["oldpassword"] )){
- echo json_encode( array( "status" => "error", "data" => array( "message" => "Your old password is wrong!" )));
+ echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Your old password is wrong!") )));
exit();
}
// Change password
if( OC_USER::setPassword( $_SESSION["user_id"], $_POST["password"] )){
- echo json_encode( array( "status" => "success", "data" => array( "message" => "Password changed" )));
+ echo json_encode( array( "status" => "success", "data" => array( "message" => $l->t("Password changed") )));
}
else{
- echo json_encode( array( "status" => "error", "data" => array( "message" => "Unable to change password" )));
+ echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Unable to change password") )));
}
?>
diff --git a/settings/ajax/setlanguage.php b/settings/ajax/setlanguage.php
index 672836afe0f..f971806f4c6 100644
--- a/settings/ajax/setlanguage.php
+++ b/settings/ajax/setlanguage.php
@@ -3,12 +3,14 @@
// Init owncloud
require_once('../../lib/base.php');
+$l=new OC_L10N('settings');
+
// We send json data
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_USER::isLoggedIn()){
- echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
+ echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Authentication error") )));
exit();
}
@@ -16,9 +18,9 @@ if( !OC_USER::isLoggedIn()){
if( isset( $_POST['lang'] ) ){
$lang=$_POST['lang'];
OC_PREFERENCES::setValue( $_SESSION['user_id'], 'core', 'lang', $lang );
- echo json_encode( array( "status" => "success", "data" => array( "message" => "Language changed" )));
+ echo json_encode( array( "status" => "success", "data" => array( "message" => $l->t("Language changed") )));
}else{
- echo json_encode( array( "status" => "error", "data" => array( "message" => "Invalid request" )));
+ echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Invalid request") )));
}
?>
diff --git a/settings/l10n/messages.pot b/settings/l10n/messages.pot
new file mode 100644
index 00000000000..705d583ee76
--- /dev/null
+++ b/settings/l10n/messages.pot
@@ -0,0 +1,86 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-06-20 14:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../templates/index.php:3
+msgid "Account information"
+msgstr ""
+
+#: ../templates/index.php:5
+msgid "You're currently using"
+msgstr ""
+
+#: ../templates/index.php:5
+msgid "of your"
+msgstr ""
+
+#: ../templates/index.php:5
+msgid "space"
+msgstr ""
+
+#: ../templates/index.php:11
+msgid "Change Password"
+msgstr ""
+
+#: ../templates/index.php:12
+msgid "Your password got changed"
+msgstr ""
+
+#: ../templates/index.php:15
+msgid "Old password:"
+msgstr ""
+
+#: ../templates/index.php:19
+msgid "New password"
+msgstr ""
+
+#: ../templates/index.php:24
+msgid "Show new password"
+msgstr ""
+
+#: ../templates/index.php:34
+msgid "Language"
+msgstr ""
+
+#: ../ajax/changepassword.php:13 ../ajax/setlanguage.php:13
+msgid "Authentication error"
+msgstr ""
+
+#: ../ajax/changepassword.php:19
+msgid "You have to enter the old and the new password!"
+msgstr ""
+
+#: ../ajax/changepassword.php:25
+msgid "Your old password is wrong!"
+msgstr ""
+
+#: ../ajax/changepassword.php:31
+msgid "Password changed"
+msgstr ""
+
+#: ../ajax/changepassword.php:34
+msgid "Unable to change password"
+msgstr ""
+
+#: ../ajax/setlanguage.php:21
+msgid "Language changed"
+msgstr ""
+
+#: ../ajax/setlanguage.php:23
+msgid "Invalid request"
+msgstr ""
diff --git a/settings/l10n/xgettextfiles b/settings/l10n/xgettextfiles
new file mode 100644
index 00000000000..8a2f185f230
--- /dev/null
+++ b/settings/l10n/xgettextfiles
@@ -0,0 +1,3 @@
+../templates/index.php
+../ajax/changepassword.php
+../ajax/setlanguage.php \ No newline at end of file
diff --git a/settings/templates/index.php b/settings/templates/index.php
index f8ef9faf1d7..761289acefa 100644
--- a/settings/templates/index.php
+++ b/settings/templates/index.php
@@ -1,27 +1,27 @@
<form id="quota">
<fieldset>
- <legend>Account information</legend>
+ <legend><?php echo $l->t( 'Account information' );?></legend>
<div id="quota_indicator"><div style="width:<?php echo $_['usage_relative'] ?>%;">&nbsp;</div></div>
- <p>You're currently using <?php echo $_['usage_relative'] ?>% (<?php echo $_['usage'] ?>) of your <?php echo $_['total_space'] ?> space.</p>
+ <p><?php echo $l->t( 'You\'re currently using' );?> <?php echo $_['usage_relative'] ?>% (<?php echo $_['usage'] ?>) <?php echo $l->t( 'of your' );?> <?php echo $_['total_space'] ?> <?php echo $l->t( 'space' );?>.</p>
</fieldset>
</form>
<form id="passwordform">
<fieldset>
- <legend>Change Password</legend>
- <div id="passwordchanged">You're password got changed</div>
+ <legend><?php echo $l->t( 'Change Password' );?></legend>
+ <div id="passwordchanged"><?php echo $l->t( 'Your password got changed');?></div>
<div id="passworderror"></div>
<p>
- <label for="pass1">Old password:</label>
+ <label for="pass1"><?php echo $l->t( 'Old password:' );?></label>
<input type="password" id="pass1" name="oldpassword" />
</p>
<p>
- <label for="pass2">New password :</label>
+ <label for="pass2"><?php echo $l->t( 'New password' );?></label>
<input type="password" id="pass2" name="password" />
</p>
<p>
<input type="checkbox" id="show" name="show" />
- <label for="show">Show new password</label>
+ <label for="show"><?php echo $l->t( 'Show new password' );?></label>
</p>
<p class="form_footer">
<input id="passwordbutton" class="prettybutton" type="submit" value="Save" />
@@ -31,7 +31,7 @@
<form id="languageform">
<fieldset>
- <legend>Language</legend>
+ <legend><?php echo $l->t( 'Language' );?></legend>
<label for=''></label>
<select id="languageinput" name='lang'>
<?php foreach($_['languages'] as $language):?>