From b31a8ac985c829fde5e7baa90efd21eeb27fb08c Mon Sep 17 00:00:00 2001
From: Jakob Sack <kde@jakobsack.de>
Date: Sun, 19 Jun 2011 23:33:34 +0200
Subject: [PATCH] More l10n-stuff

---
 admin/l10n/messages.pot      |  91 ++++++++++++++++++++++++++
 admin/l10n/xgettextfiles     |   5 ++
 docs/createtranslation.pl    |   1 +
 docs/getstrings.pl           |  18 ++++++
 index.php                    |   2 +
 js/js.js                     |  43 ++++++-------
 js/setup.js                  |  26 ++++++++
 l10n/de.php                  |  11 ++++
 l10n/de.po                   | 120 +++++++++++++++++++++++++++++++++++
 l10n/javascript.php          |  34 ++++++++++
 l10n/messages.pot            | 120 +++++++++++++++++++++++++++++++++++
 l10n/xgettextfiles           |   7 ++
 lib/l10n.php                 |  20 ++++--
 log/l10n/da.php              |  14 ++++
 log/l10n/da.po               |  67 +++++++++++++++++++
 log/l10n/log                 |   1 +
 templates/404.php            |   2 +-
 templates/installation.php   |  36 +++++------
 templates/layout.admin.php   |   3 +
 templates/layout.guest.php   |   5 +-
 templates/layout.user.php    |   3 +
 templates/login.php          |   2 +-
 templates/logout.php         |   2 +-
 templates/part.pagenavi.php  |   4 +-
 templates/part.searchbox.php |   2 +-
 25 files changed, 584 insertions(+), 55 deletions(-)
 create mode 100644 admin/l10n/messages.pot
 create mode 100644 admin/l10n/xgettextfiles
 create mode 100644 docs/getstrings.pl
 create mode 100644 js/setup.js
 create mode 100644 l10n/de.php
 create mode 100644 l10n/de.po
 create mode 100644 l10n/javascript.php
 create mode 100644 l10n/messages.pot
 create mode 100644 l10n/xgettextfiles
 create mode 100644 log/l10n/da.php
 create mode 100644 log/l10n/da.po

diff --git a/admin/l10n/messages.pot b/admin/l10n/messages.pot
new file mode 100644
index 00000000000..c30a4454311
--- /dev/null
+++ b/admin/l10n/messages.pot
@@ -0,0 +1,91 @@
+# 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-19 23:32+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/app.php:22
+msgid "read more"
+msgstr ""
+
+#: ../templates/app.php:24
+msgid "INSTALL"
+msgstr ""
+
+#: ../templates/app_noconn.php:6 ../templates/apps.php:6
+msgid "Apps Repository"
+msgstr ""
+
+#: ../templates/app_noconn.php:7
+msgid "Cannot connect to apps repository"
+msgstr ""
+
+#: ../templates/apps.php:13 ../templates/users.php:6 ../templates/users.php:20
+#: ../templates/users.php:50
+msgid "Name"
+msgstr ""
+
+#: ../templates/apps.php:14
+msgid "Modified"
+msgstr ""
+
+#: ../templates/system.php:6
+msgid "Administration"
+msgstr ""
+
+#: ../templates/system.php:7
+msgid "System Settings"
+msgstr ""
+
+#: ../templates/users.php:13
+msgid "Add user"
+msgstr ""
+
+#: ../templates/users.php:21
+msgid "Password"
+msgstr ""
+
+#: ../templates/users.php:30
+msgid "Create user"
+msgstr ""
+
+#: ../templates/users.php:40 ../templates/users.php:68
+msgid "remove"
+msgstr ""
+
+#: ../templates/users.php:46
+msgid "Groups"
+msgstr ""
+
+#: ../templates/users.php:58
+msgid "Create group"
+msgstr ""
+
+#: ../templates/users.php:94
+msgid "Force new password:"
+msgstr ""
+
+#: ../templates/users.php:96
+msgid "Set"
+msgstr ""
+
+#: ../templates/users.php:102
+msgid "Do you really want to delete user"
+msgstr ""
+
+#: ../templates/users.php:109
+msgid "Do you really want to delete group"
+msgstr ""
diff --git a/admin/l10n/xgettextfiles b/admin/l10n/xgettextfiles
new file mode 100644
index 00000000000..37acbc25deb
--- /dev/null
+++ b/admin/l10n/xgettextfiles
@@ -0,0 +1,5 @@
+../templates/app.php
+../templates/app_noconn.php
+../templates/apps.php
+../templates/system.php
+../templates/users.php
diff --git a/docs/createtranslation.pl b/docs/createtranslation.pl
index 4c1c7c38d73..12ba22a5ea4 100644
--- a/docs/createtranslation.pl
+++ b/docs/createtranslation.pl
@@ -16,6 +16,7 @@ foreach my $i ( @files ){
 	my @strings = ();
 	foreach my $key ( keys( %{$hash} )){
 		next if $key eq '""';
+		next if $hash->{$key}->msgstr() eq '""';
 		push( @strings, $hash->{$key}->msgid()." => ".$hash->{$key}->msgstr());
 	}
 
diff --git a/docs/getstrings.pl b/docs/getstrings.pl
new file mode 100644
index 00000000000..0325438b551
--- /dev/null
+++ b/docs/getstrings.pl
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+use strict;
+
+if( -e 'messages.pot' ){
+	`xgettext --files-from=xgettextfiles --join-existing --output=messages.pot --keyword=t`
+}
+else{
+	`xgettext --files-from=xgettextfiles --output=messages.pot --keyword=t`
+}
+
+opendir( DIR, '.' );
+my @files = readdir( DIR );
+closedir( DIR );
+
+foreach my $i ( @files ){
+	next unless $i =~ m/^(.*)\.po$/;
+	`xgettext --files-from=xgettextfiles --join-existing --output=$i --keyword=t`
+}
diff --git a/index.php b/index.php
index f4d6f27a3c4..5aaa8fb89c0 100644
--- a/index.php
+++ b/index.php
@@ -27,6 +27,8 @@ require_once(dirname(__FILE__).'/lib/base.php');
 require_once('appconfig.php');
 require_once('template.php');
 
+OC_UTIL::addScript('setup');
+
 $not_installed = !OC_CONFIG::getValue('installed', false);
 $install_called = (isset($_POST['install']) AND $_POST['install']=='true');
 
diff --git a/js/js.js b/js/js.js
index a6765ec62db..7e44b7ce6d5 100644
--- a/js/js.js
+++ b/js/js.js
@@ -1,26 +1,23 @@
-$(document).ready(function() {	
-	// Hide the MySQL config div if needed :
-	if(!$('#mysql').is(':checked') && $('#hasSQLite').val()=='true') {
-		$('#use_mysql').hide();
+var _l10ncache = {};
+function t(app,text){
+	if( !( app in _l10ncache )){
+		$.post( oc_webroot+'/l10n/javascript.php', {'app': app}, function(jsondata){
+			_l10ncache[app] = jsondata.data;
+		});
+
+		// Bad answer ...
+		if( !( app in _l10ncache )){
+			_l10ncache[app] = [];
+		}
 	}
-	
-	$('#datadirField').hide(250);
-	if($('#hasSQLite').val()=='true'){
-		$('#databaseField').hide(250);
+	if( typeof( _l10ncache[app][text] ) !== 'undefined' ){
+		return _l10ncache[app][text];
 	}
-	
-	$('#sqlite').click(function() {
-		$('#use_mysql').slideUp(250);
-	});
-	
-	$('#mysql').click(function() {
-		$('#use_mysql').slideDown(250);
-	});
-	
-	$('#showAdvanced').click(function() {
-		$('#datadirField').slideToggle(250);
-		if($('#hasSQLite').val()=='true'){
-			$('#databaseField').slideToggle(250);
-		}
-	});
+	else{
+		return text;
+	}
+}
+
+$(document).ready(function(){
+	// Put fancy stuff in here
 });
diff --git a/js/setup.js b/js/setup.js
new file mode 100644
index 00000000000..b4616b8b14c
--- /dev/null
+++ b/js/setup.js
@@ -0,0 +1,26 @@
+$(document).ready(function() {
+	// Hide the MySQL config div if needed :
+	if(!$('#mysql').is(':checked') && $('#hasSQLite').val()=='true') {
+		$('#use_mysql').hide();
+	}
+
+	$('#datadirField').hide(250);
+	if($('#hasSQLite').val()=='true'){
+		$('#databaseField').hide(250);
+	}
+
+	$('#sqlite').click(function() {
+		$('#use_mysql').slideUp(250);
+	});
+
+	$('#mysql').click(function() {
+		$('#use_mysql').slideDown(250);
+	});
+
+	$('#showAdvanced').click(function() {
+		$('#datadirField').slideToggle(250);
+		if($('#hasSQLite').val()=='true'){
+			$('#databaseField').slideToggle(250);
+		}
+	});
+});
diff --git a/l10n/de.php b/l10n/de.php
new file mode 100644
index 00000000000..fb00345e69d
--- /dev/null
+++ b/l10n/de.php
@@ -0,0 +1,11 @@
+<?php $TRANSLATIONS = array(
+"You are logged out." => "Sie wurden abgemeldet.",
+"Set where to store the data." => "Speicherort der Daten",
+"Advanced" => "Erweitert",
+"prev" => "zurück",
+"Login:" => "Benutzername:",
+"Login failed!" => "Anmeldung Fehlgeschlagen!",
+"next" => "weiter",
+"Password:" => "Passwort:",
+"Search" => "Suchen"
+);
diff --git a/l10n/de.po b/l10n/de.po
new file mode 100644
index 00000000000..19b12ca4aac
--- /dev/null
+++ b/l10n/de.po
@@ -0,0 +1,120 @@
+# 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-19 23:27+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=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../templates/404.php:15
+msgid "Error 404, Cloud not found"
+msgstr ""
+
+#: ../templates/installation.php:6
+msgid "Welcome to <strong>ownCloud</strong>, your personnal cloud."
+msgstr ""
+
+#: ../templates/installation.php:7
+msgid "To finish the installation, please follow the steps below."
+msgstr ""
+
+#: ../templates/installation.php:26
+msgid "Create an <strong>admin account.</strong>"
+msgstr ""
+
+#: ../templates/installation.php:27
+msgid "Login:"
+msgstr "Benutzername:"
+
+#: ../templates/installation.php:28
+msgid "Password:"
+msgstr "Passwort:"
+
+#: ../templates/installation.php:31
+msgid "Advanced"
+msgstr "Erweitert"
+
+#: ../templates/installation.php:34
+msgid "Set where to store the data."
+msgstr "Speicherort der Daten"
+
+#: ../templates/installation.php:35
+msgid "Data directory:"
+msgstr ""
+
+#: ../templates/installation.php:39
+msgid "Configure your database."
+msgstr ""
+
+#: ../templates/installation.php:43
+msgid "I will use a SQLite database. You have nothing to do!"
+msgstr ""
+
+#: ../templates/installation.php:46
+msgid "SQLite"
+msgstr ""
+
+#: ../templates/installation.php:53
+msgid "I will use a MySQL database."
+msgstr ""
+
+#: ../templates/installation.php:59
+msgid "Host:"
+msgstr ""
+
+#: ../templates/installation.php:60
+msgid "Database name:"
+msgstr ""
+
+#: ../templates/installation.php:61
+msgid "Table prefix:"
+msgstr ""
+
+#: ../templates/installation.php:62
+msgid "MySQL user login:"
+msgstr ""
+
+#: ../templates/installation.php:63
+msgid "MySQL user password:"
+msgstr ""
+
+#: ../templates/layout.guest.php:17 ../templates/layout.guest.php:20
+msgid ""
+"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs "
+"on your own server.</p>"
+msgstr ""
+
+#: ../templates/login.php:6
+msgid "Login failed!"
+msgstr "Anmeldung Fehlgeschlagen!"
+
+#: ../templates/logout.php:1
+msgid "You are logged out."
+msgstr "Sie wurden abgemeldet."
+
+#: ../templates/part.pagenavi.php:6
+msgid "prev"
+msgstr "zurück"
+
+#: ../templates/part.pagenavi.php:26
+msgid "next"
+msgstr "weiter"
+
+#: ../templates/part.searchbox.php:3
+msgid "Search"
+msgstr "Suchen"
+
+#: ../templates/installation.php:68
+msgid "Finish setup"
+msgstr ""
diff --git a/l10n/javascript.php b/l10n/javascript.php
new file mode 100644
index 00000000000..a1e84487f63
--- /dev/null
+++ b/l10n/javascript.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+* ownCloud - ajax frontend
+*
+* @author Jakob Sack
+* @copyright 2011 Jakob Sack kde@jakobsack.de
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+// Init owncloud
+require_once('../lib/base.php');
+
+$app = $_POST["app"];
+
+// We send json data
+header( "Content-Type: application/jsonrequest" );
+$l = new OC_L10N( $app );
+
+echo json_encode( array( 'status' => 'success', 'data' => $l->getTranslations()));
+?>
diff --git a/l10n/messages.pot b/l10n/messages.pot
new file mode 100644
index 00000000000..591a1c724e3
--- /dev/null
+++ b/l10n/messages.pot
@@ -0,0 +1,120 @@
+# 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-19 23:27+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/404.php:15
+msgid "Error 404, Cloud not found"
+msgstr ""
+
+#: ../templates/installation.php:6
+msgid "Welcome to <strong>ownCloud</strong>, your personnal cloud."
+msgstr ""
+
+#: ../templates/installation.php:7
+msgid "To finish the installation, please follow the steps below."
+msgstr ""
+
+#: ../templates/installation.php:26
+msgid "Create an <strong>admin account.</strong>"
+msgstr ""
+
+#: ../templates/installation.php:27
+msgid "Login:"
+msgstr ""
+
+#: ../templates/installation.php:28
+msgid "Password:"
+msgstr ""
+
+#: ../templates/installation.php:31
+msgid "Advanced"
+msgstr ""
+
+#: ../templates/installation.php:34
+msgid "Set where to store the data."
+msgstr ""
+
+#: ../templates/installation.php:35
+msgid "Data directory:"
+msgstr ""
+
+#: ../templates/installation.php:39
+msgid "Configure your database."
+msgstr ""
+
+#: ../templates/installation.php:43
+msgid "I will use a SQLite database. You have nothing to do!"
+msgstr ""
+
+#: ../templates/installation.php:46
+msgid "SQLite"
+msgstr ""
+
+#: ../templates/installation.php:53
+msgid "I will use a MySQL database."
+msgstr ""
+
+#: ../templates/installation.php:59
+msgid "Host:"
+msgstr ""
+
+#: ../templates/installation.php:60
+msgid "Database name:"
+msgstr ""
+
+#: ../templates/installation.php:61
+msgid "Table prefix:"
+msgstr ""
+
+#: ../templates/installation.php:62
+msgid "MySQL user login:"
+msgstr ""
+
+#: ../templates/installation.php:63
+msgid "MySQL user password:"
+msgstr ""
+
+#: ../templates/installation.php:68
+msgid "Finish setup"
+msgstr ""
+
+#: ../templates/layout.guest.php:20
+msgid ""
+"<a href=\"http://owncloud.org/\">ownCloud</a> is a personal cloud which runs "
+"on your own server.</p>"
+msgstr ""
+
+#: ../templates/login.php:6
+msgid "Login failed!"
+msgstr ""
+
+#: ../templates/logout.php:1
+msgid "You are logged out."
+msgstr ""
+
+#: ../templates/part.pagenavi.php:6
+msgid "prev"
+msgstr ""
+
+#: ../templates/part.pagenavi.php:26
+msgid "next"
+msgstr ""
+
+#: ../templates/part.searchbox.php:3
+msgid "Search"
+msgstr ""
diff --git a/l10n/xgettextfiles b/l10n/xgettextfiles
new file mode 100644
index 00000000000..b5d83a880d4
--- /dev/null
+++ b/l10n/xgettextfiles
@@ -0,0 +1,7 @@
+../templates/404.php
+../templates/installation.php
+../templates/layout.guest.php
+../templates/login.php
+../templates/logout.php
+../templates/part.pagenavi.php
+../templates/part.searchbox.php
diff --git a/lib/l10n.php b/lib/l10n.php
index 2f72b971173..8a7ff9d8535 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -109,6 +109,16 @@ class OC_L10N{
 		return $text;
 	}
 
+	/**
+	 * @brief getTranslations
+	 * @returns Fetch all translations
+	 *
+	 * Returns an associative array with all translations
+	 */
+	public function getTranslations(){
+		return $this->translations;
+	}
+
 	/**
 	 * @brief Localization
 	 * @param $type Type of localization
@@ -202,11 +212,10 @@ class OC_L10N{
 				closedir($dh);
 			}
 		}
-
 		if( isset($_SESSION['user_id']) && $_SESSION['user_id'] && OC_PREFERENCES::getValue( $_SESSION['user_id'], 'core', 'lang' )){
 			$lang = OC_PREFERENCES::getValue( $_SESSION['user_id'], 'core', 'lang' );
 			self::$language = $lang;
-			if( array_search( $lang, $available )){
+			if( array_search( $lang, $available ) !== false ){
 				return $lang;
 			}
 		}
@@ -226,12 +235,9 @@ class OC_L10N{
 	}
 
 	/**
-	 * @brief find the best language
+	 * @brief find the l10n directory
 	 * @param $app App that needs to be translated
-	 * @returns language
-	 *
-	 * Finds the best language. Depends on user settings and browser
-	 * information
+	 * @returns directory
 	 */
 	protected static function findI18nDir( $app ){
 		global $SERVERROOT;
diff --git a/log/l10n/da.php b/log/l10n/da.php
new file mode 100644
index 00000000000..8ab99277bfa
--- /dev/null
+++ b/log/l10n/da.php
@@ -0,0 +1,14 @@
+<?php $TRANSLATIONS = array(
+"Show:" => "Vis:",
+"Uploads" => "Uploads",
+"Filter:" => "Filter:",
+"Logouts" => "Logouts",
+"Logins" => "Logins",
+"When" => "Hvornår",
+"Downloads" => "Downloads",
+"Clear log entries before" => "Slet log poster før",
+"What" => "Hvilket",
+"entries per page." => "poster pr side.",
+"Creations" => "Oprettelser",
+"Deletions" => "Sletninger"
+);
diff --git a/log/l10n/da.po b/log/l10n/da.po
new file mode 100644
index 00000000000..5a88aedee94
--- /dev/null
+++ b/log/l10n/da.po
@@ -0,0 +1,67 @@
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Mikkel Bjerg Larsen <mikkelbjerglarsen@gmail.com>, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-06-19 16:53+0200\n"
+"PO-Revision-Date: 2011-06-19 21:09+0200\n"
+"Last-Translator: Mikkel Bjerg Larsen <mikkelbjerglarsen@gmail.com>\n"
+"Language-Team: American English <kde-i18n-doc@kde.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.2\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: ../templates/index.php:4
+msgid "Filter:"
+msgstr "Filter:"
+
+#: ../templates/index.php:7
+msgid "Logins"
+msgstr "Logins"
+
+#: ../templates/index.php:8
+msgid "Logouts"
+msgstr "Logouts"
+
+#: ../templates/index.php:9
+msgid "Downloads"
+msgstr "Downloads"
+
+#: ../templates/index.php:10
+msgid "Uploads"
+msgstr "Uploads"
+
+#: ../templates/index.php:11
+msgid "Creations"
+msgstr "Oprettelser"
+
+#: ../templates/index.php:12
+msgid "Deletions"
+msgstr "Sletninger"
+
+#: ../templates/index.php:15
+msgid "Show:"
+msgstr "Vis:"
+
+#: ../templates/index.php:16
+msgid "entries per page."
+msgstr "poster pr side."
+
+#: ../templates/index.php:26
+msgid "What"
+msgstr "Hvilket"
+
+#: ../templates/index.php:27
+msgid "When"
+msgstr "Hvornår"
+
+#: ../templates/index.php:45
+msgid "Clear log entries before"
+msgstr "Slet log poster før"
+
diff --git a/log/l10n/log b/log/l10n/log
index e5e074bf9aa..f70eb6af3fe 100644
--- a/log/l10n/log
+++ b/log/l10n/log
@@ -1,3 +1,4 @@
 [General]
 LangCode=de
+ProjectID=oc_log
 TargetLangCode=de
diff --git a/templates/404.php b/templates/404.php
index 8909db29a40..b287571d166 100644
--- a/templates/404.php
+++ b/templates/404.php
@@ -12,7 +12,7 @@ if(!isset($_)){//also provide standalone error page
 	<img src="<?php echo image_path("", "weather-clear.png"); ?>" alt="ownCloud" />
 	<ul>
 		<li class='error'>
-			Error 404, Cloud not found<br/>
+			<?php echo $l->t( 'Error 404, Cloud not found' ); ?><br/>
 			<p class='hint'><?php if(isset($_['file'])) echo $_['file']?></p>
 		</li>
 	</ul>
diff --git a/templates/installation.php b/templates/installation.php
index 880beb9a89e..93c00547ab9 100644
--- a/templates/installation.php
+++ b/templates/installation.php
@@ -3,8 +3,8 @@
 	<form action="index.php" method="post" id="setup_form">
 		<input type="hidden" name="install" value="true" />
 		<p class="intro">
-			Welcome to <strong>ownCloud</strong>, your personnal cloud.<br />
-			To finish the installation, please follow the steps below.
+			<?php echo $l->t( 'Welcome to <strong>ownCloud</strong>, your personnal cloud.' ); ?><br />
+			<?php echo $l->t( 'To finish the installation, please follow the steps below.' ); ?>
 		</p>
 
 		<?php if(count($_['errors']) > 0): ?>
@@ -23,48 +23,48 @@
 		<?php endif; ?>
 
 		<fieldset>
-			<legend>Create an <strong>admin account.</strong></legend>
-			<p><label for="adminlogin">Login :</label><input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_HELPER::init_var('adminlogin'); ?>" /></p>
-			<p><label for="adminpass">Password :</label><input type="password" name="adminpass" id="adminpass" value="<?php print OC_HELPER::init_var('adminpass'); ?>" /></p>
+			<legend><?php echo $l->t( 'Create an <strong>admin account.</strong>' ); ?></legend>
+			<p><label for="adminlogin"><?php echo $l->t( 'Login:' ); ?></label><input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_HELPER::init_var('adminlogin'); ?>" /></p>
+			<p><label for="adminpass"><?php echo $l->t( 'Password:' ); ?></label><input type="password" name="adminpass" id="adminpass" value="<?php print OC_HELPER::init_var('adminpass'); ?>" /></p>
         </fieldset>
         
-        <a id='showAdvanced'>Advanced <img src='<?php echo OC_HELPER::imagePath('','drop-arrow.png'); ?>'></img></a>
+        <a id='showAdvanced'><?php echo $l->t( 'Advanced' ); ?> <img src='<?php echo OC_HELPER::imagePath('','drop-arrow.png'); ?>'></img></a>
         
         <fieldset id='datadirField'>
-			<legend>Set where to store the data.</legend>
-			<p><label for="directory">Data directory :</label><input type="text" name="directory" id="directory" value="<?php print OC_HELPER::init_var('directory', $_['directory']); ?>" /></p>
+			<legend><?php echo $l->t( 'Set where to store the data.' ); ?></legend>
+			<p><label for="directory"><?php echo $l->t( 'Data directory:' ); ?></label><input type="text" name="directory" id="directory" value="<?php print OC_HELPER::init_var('directory', $_['directory']); ?>" /></p>
 		</fieldset>
 		
 		<fieldset id='databaseField'>
-			<legend>Configure your database.</legend>
+			<legend><?php echo $l->t( 'Configure your database.' ); ?></legend>
 			<?php if($_['hasSQLite']): ?>
 			<input type='hidden' id='hasSQLite' value='true'/>
 			<?php if(!$_['hasMySQL']): ?>
-			<p>I will use a SQLite database. You have nothing to do !</p>
+			<p><?php echo $l->t( 'I will use a SQLite database. You have nothing to do!' ); ?></p>
 			<input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
 			<?php else: ?>
-			<p><label class="sqlite" for="sqlite">SQLite </label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_HELPER::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
+			<p><label class="sqlite" for="sqlite"><?php echo $l->t( 'SQLite' ); ?></label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_HELPER::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
 			<?php endif; ?>
 			<?php endif; ?>
 
 			<?php if($_['hasMySQL']): ?>
 			<input type='hidden' id='hasMySQL' value='true'/>
 			<?php if(!$_['hasSQLite']): ?>
-			<p>I will use a MySQL database.</p>
+			<p><?php echo $l->t( 'I will use a MySQL database.' ); ?></p>
 			<input type="hidden" id="dbtype" name="dbtype" value="mysql" />
 			<?php else: ?>
 			<p><label class="mysql" for="mysql">MySQL </label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_HELPER::init_radio('dbtype', 'mysql', 'sqlite'); ?>/></p>
 			<?php endif; ?>
 			<div id="use_mysql">
-				<p><label for="dbhost">Host :</label><input type="text" name="dbhost" id="dbhost" value="<?php print OC_HELPER::init_var('dbhost', 'localhost'); ?>" /></p>
-				<p><label for="dbname">Database name :</label><input type="text" name="dbname" id="dbname" value="<?php print OC_HELPER::init_var('dbname'); ?>" /></p>
-				<p><label for="dbtableprefix">Table prefix :</label><input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_HELPER::init_var('dbtableprefix', 'oc_'); ?>" /></p>
-				<p><label for="dbuser">MySQL user login :</label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_HELPER::init_var('dbuser'); ?>" /></p>
-				<p><label for="dbpass">MySQL user password :</label><input type="password" name="dbpass" id="dbpass" value="<?php print OC_HELPER::init_var('dbpass'); ?>" /></p>
+				<p><label for="dbhost"><?php echo $l->t( 'Host:' ); ?></label><input type="text" name="dbhost" id="dbhost" value="<?php print OC_HELPER::init_var('dbhost', 'localhost'); ?>" /></p>
+				<p><label for="dbname"><?php echo $l->t( 'Database name:' ); ?></label><input type="text" name="dbname" id="dbname" value="<?php print OC_HELPER::init_var('dbname'); ?>" /></p>
+				<p><label for="dbtableprefix"><?php echo $l->t( 'Table prefix:' ); ?></label><input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_HELPER::init_var('dbtableprefix', 'oc_'); ?>" /></p>
+				<p><label for="dbuser"><?php echo $l->t( 'MySQL user login:' ); ?></label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_HELPER::init_var('dbuser'); ?>" /></p>
+				<p><label for="dbpass"><?php echo $l->t( 'MySQL user password:' ); ?></label><input type="password" name="dbpass" id="dbpass" value="<?php print OC_HELPER::init_var('dbpass'); ?>" /></p>
 			</div>
 			<?php endif; ?>
 		</fieldset>
 
-		<p class="submit"><input type="submit" value="Finish setup" /></p>
+		<p class="submit"><input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" /></p>
 	</form>
 </div>
diff --git a/templates/layout.admin.php b/templates/layout.admin.php
index 36b824639d3..66fb3ccc60b 100644
--- a/templates/layout.admin.php
+++ b/templates/layout.admin.php
@@ -7,6 +7,9 @@
 		<?php foreach($_['cssfiles'] as $cssfile): ?>
 			<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
 		<?php endforeach; ?>
+		<script type="text/javascript">
+			var oc_webroot = '<?php global $WEBROOT; echo $WEBROOT; ?>';
+		// </script>
 		<?php foreach($_['jsfiles'] as $jsfile): ?>
 			<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
 		<?php endforeach; ?>
diff --git a/templates/layout.guest.php b/templates/layout.guest.php
index c9575530820..ce99b00b9f6 100644
--- a/templates/layout.guest.php
+++ b/templates/layout.guest.php
@@ -7,6 +7,9 @@
 		<?php foreach($_['cssfiles'] as $cssfile): ?>
 			<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
 		<?php endforeach; ?>
+		<script type="text/javascript">
+			var oc_webroot = '<?php global $WEBROOT; echo $WEBROOT; ?>';
+		// </script>
 		<?php foreach($_['jsfiles'] as $jsfile): ?>
 			<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
 		<?php endforeach; ?>
@@ -14,6 +17,6 @@
 
 	<body id="body-login">
 		<?php echo $_['content']; ?>
-		<p class="info"><a href="http://owncloud.org/">ownCloud</a> is a personal cloud which runs on your own server.</p>
+		<p class="info"><?php echo $l->t( '<a href="http://owncloud.org/">ownCloud</a> is a personal cloud which runs on your own server.</p>' ); ?>
 	</body>
 </html>
diff --git a/templates/layout.user.php b/templates/layout.user.php
index da30df294f2..f21db202a83 100644
--- a/templates/layout.user.php
+++ b/templates/layout.user.php
@@ -7,6 +7,9 @@
 		<?php foreach($_['cssfiles'] as $cssfile): ?>
 			<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
 		<?php endforeach; ?>
+		<script type="text/javascript">
+			var oc_webroot = '<?php global $WEBROOT; echo $WEBROOT; ?>';
+		// </script>
 		<?php foreach($_['jsfiles'] as $jsfile): ?>
 			<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
 		<?php endforeach; ?>
diff --git a/templates/login.php b/templates/login.php
index 845ae831a40..e0f6ce23e2e 100644
--- a/templates/login.php
+++ b/templates/login.php
@@ -3,7 +3,7 @@
 	<form action="index.php" method="post" id="login_form">
 		<fieldset>
 			<?php if($_['error']): ?>
-				Login failed!
+				<?php echo $l->t( 'Login failed!' ); ?>
 			<?php endif; ?>
 			<input type="text" name="user" id="user" value="" />
 			<input type="password" name="password" id="password" value="" />
diff --git a/templates/logout.php b/templates/logout.php
index 4a15998a5c0..8cbbdd9cc8d 100644
--- a/templates/logout.php
+++ b/templates/logout.php
@@ -1 +1 @@
-You are logged out.
+<?php echo $l->t( 'You are logged out.' ); ?>
\ No newline at end of file
diff --git a/templates/part.pagenavi.php b/templates/part.pagenavi.php
index d48d0cada32..0602b793882 100644
--- a/templates/part.pagenavi.php
+++ b/templates/part.pagenavi.php
@@ -3,7 +3,7 @@
 		<tr>
 			<td width="1">
 				<?php if($_['page']>0):?>
-					<span class="pagerbutton1"><a href="<?php echo $_['url'].($_['page']-1);?>">prev</a>&nbsp;&nbsp;</span>
+					<span class="pagerbutton1"><a href="<?php echo $_['url'].($_['page']-1);?>"><?php echo $l->t( 'prev' ); ?></a>&nbsp;&nbsp;</span>
 				<?php endif; ?>
 			</td>
 			<td>
@@ -23,7 +23,7 @@
 			</td>
 			<td width="1">
 				<?php if(($_['page']+1)<$_['pagecount']):?>
-					<span class="pagerbutton2"><a href="<?php echo $_['url'].($_['page']+1);?>">next</a></span>
+					<span class="pagerbutton2"><a href="<?php echo $_['url'].($_['page']+1);?>"><?php echo $l->t( 'next' ); ?></a></span>
 				<?php endif; ?>
 			</td>
 		</tr>
diff --git a/templates/part.searchbox.php b/templates/part.searchbox.php
index 910af81ebb2..7465a7326ee 100644
--- a/templates/part.searchbox.php
+++ b/templates/part.searchbox.php
@@ -1,4 +1,4 @@
 <form class='searchbox' action='<?php echo $_['searchurl']?>' method='post'>
 	<input name='query' value='<?php if(isset($_POST['query'])){echo $_POST['query'];};?>'/>
-	<input type='submit' value='Search' class='prettybutton'/>
+	<input type='submit' value='<?php echo $l->t( 'Search' ); ?>' class='prettybutton'/>
 </form>
\ No newline at end of file
-- 
GitLab