summaryrefslogtreecommitdiffstats
path: root/settings/ajax/setlanguage.php
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/ajax/setlanguage.php
parent76b12c4ae0ea9941b030f0a13786d0ac3fc32f76 (diff)
downloadnextcloud-server-4c1d3155a3ee4ddb48a0bb4281fe74391db1f016.tar.gz
nextcloud-server-4c1d3155a3ee4ddb48a0bb4281fe74391db1f016.zip
make personal settings translatable
Diffstat (limited to 'settings/ajax/setlanguage.php')
-rw-r--r--settings/ajax/setlanguage.php8
1 files changed, 5 insertions, 3 deletions
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") )));
}
?>