diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index 1a9ad73610..f568d3ef87 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 672836afe0..f971806f4c 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 0000000000..705d583ee7 --- /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 , 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 \n" +"Language-Team: LANGUAGE \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 0000000000..8a2f185f23 --- /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 f8ef9faf1d..761289acef 100644 --- a/settings/templates/index.php +++ b/settings/templates/index.php @@ -1,27 +1,27 @@
- Account information + t( 'Account information' );?>
 
-

You're currently using % () of your space.

+

t( 'You\'re currently using' );?> % () t( 'of your' );?> t( 'space' );?>.

- Change Password -
You're password got changed
+ t( 'Change Password' );?> +
t( 'Your password got changed');?>

- +

- +

- +

- Language + t( 'Language' );?>