hosted/js hosted/skins lib/hosted lib/locale
Torsten Grote
grote at kolabsys.com
Wed Sep 19 17:48:53 CEST 2012
hosted/js/kolab_hosted.js | 15 ++++++++-------
hosted/skins/default/hosted.css | 4 ++++
hosted/skins/default/templates/footer.html | 2 +-
hosted/skins/default/templates/signup.html | 14 ++++++--------
hosted/skins/minimal/templates/signup.html | 3 ---
lib/hosted/kolab_client_task_signup.php | 24 ++++++++++--------------
lib/locale/de.php | 16 ++++++++++++++++
lib/locale/en.php | 16 ++++++++++++++++
8 files changed, 61 insertions(+), 33 deletions(-)
New commits:
commit 0f1ce83b5a06c0789456d35eafd561535acf0fee
Author: Torsten Grote <grote at kolabsys.com>
Date: Wed Sep 19 17:47:50 2012 +0200
localized hosted signup
diff --git a/hosted/js/kolab_hosted.js b/hosted/js/kolab_hosted.js
index 7baad54..9f717ae 100644
--- a/hosted/js/kolab_hosted.js
+++ b/hosted/js/kolab_hosted.js
@@ -28,8 +28,7 @@ kadm.user_save = function(reload, section)
// check email address
if(typeof data.mailalternateaddress != 'undefined' && !isValidEmailAddress(data.mailalternateaddress)) {
- // TODO use translatable error message
- kadm.display_message('Please provide a valid email adress as this is where your password will be sent to.', 'error');
+ kadm.display_message('signup.wrongmailalternateaddress', 'error');
kadm.form_value_error('mailalternateaddress');
return;
}
@@ -70,8 +69,7 @@ kadm.check_user_availability = function()
// check if user with that email address already exists
kadm.http_post('signup.check_user', {data: data});
} else {
- // TODO use translatable string
- kadm.update_user_info('This will not produce a valid email address!', 'uid');
+ kadm.update_user_info('signup.wronguid', 'uid');
}
};
@@ -82,6 +80,10 @@ kadm.update_user_info = function(msg, part)
span_id = 'pass_match';
}
+ if (msg) {
+ msg = kadm.t(msg);
+ }
+
// display message next to form field
if($('span[id="'+span_id+'"]').length) {
// update existing span area
@@ -104,11 +106,10 @@ kadm.update_user_info = function(msg, part)
function password_match()
{
if($('input[name="userpassword"]').val().localeCompare($('input[name="userpassword2"]').val())) {
- // TODO make message translatable
- kadm.update_user_info("The passwords don't match!", 'userpassword');
+ kadm.update_user_info('user.password.mismatch', 'userpassword');
}
else {
- kadm.update_user_info("", 'userpassword');
+ kadm.update_user_info('', 'userpassword');
}
}
diff --git a/hosted/skins/default/hosted.css b/hosted/skins/default/hosted.css
index 4c891d4..bba4df6 100644
--- a/hosted/skins/default/hosted.css
+++ b/hosted/skins/default/hosted.css
@@ -38,3 +38,7 @@ td.label {
table.form td {
text-align: left;
}
+
+#footer {
+ text-align: center;
+}
diff --git a/hosted/skins/default/templates/footer.html b/hosted/skins/default/templates/footer.html
index 4b6bac5..24d972d 100644
--- a/hosted/skins/default/templates/footer.html
+++ b/hosted/skins/default/templates/footer.html
@@ -1 +1 @@
-This is a service offered by <a href="http://kolabsys.com">Kolab Systems</a>.
+{$engine->translate('signup.footer')}
diff --git a/hosted/skins/default/templates/signup.html b/hosted/skins/default/templates/signup.html
index 463f832..8043859 100644
--- a/hosted/skins/default/templates/signup.html
+++ b/hosted/skins/default/templates/signup.html
@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8" />
- <title>Sign Up For Hosted Kolab</title>
+ <title>{$engine->translate('signup.headline')}</title>
<link rel="stylesheet" href="{$skin_path}style.css" />
<link rel="stylesheet" href="{$skin_path}hosted.css" />
<link rel="shortcut icon" type="image/png" href="{$skin_path}images/favicon.png" />
@@ -20,13 +20,11 @@
<div id="task_content" class="signup">
- <h1>Sign Up For Hosted Kolab</h1>
- <p>
- Having an account on a Kolab server is way better than just simple Email. It also provides you with full groupware functionality including shared adressbooks, calendars, tasks and journal.
- </p>
- <p>
- You can sign up here now for a personal account.
- </p>
+ <h1>{$engine->translate('signup.headline')}</h1>
+
+ <p>{$engine->translate('signup.intro1')}</p>
+
+ <p>{$engine->translate('signup.intro2')}</p>
<div id="taskcontent" class="signup">{$form}</div>
diff --git a/hosted/skins/minimal/templates/signup.html b/hosted/skins/minimal/templates/signup.html
index 10ff483..961dbf8 100644
--- a/hosted/skins/minimal/templates/signup.html
+++ b/hosted/skins/minimal/templates/signup.html
@@ -15,9 +15,6 @@
<body>
<div id="taskcontent" class="signup">{$form}</div>
-
- </div>
-
<div id="footer">
{include file="footer.html"}
</div>
diff --git a/lib/hosted/kolab_client_task_signup.php b/lib/hosted/kolab_client_task_signup.php
index 4bcc194..b1dbe6d 100644
--- a/lib/hosted/kolab_client_task_signup.php
+++ b/lib/hosted/kolab_client_task_signup.php
@@ -87,7 +87,7 @@ class kolab_client_task_signup extends kolab_client_task
if (!empty($publickey)) {
// TODO find a less dirty way to add captcha into form
- $form = preg_replace('/<\/tbody>/', '<tr><td class="label">Captcha</td><td class="value"><div id="recaptcha_div"></div></td></tr></tbody>', $form);
+ $form = preg_replace('/<\/tbody>/', '<tr><td class="label">'.$this->translate('signup.captcha').'</td><td class="value"><div id="recaptcha_div"></div></td></tr></tbody>', $form);
// load captcha
$form .= '
@@ -113,8 +113,7 @@ class kolab_client_task_signup extends kolab_client_task
$result = $this->api->post('users.list', null, $post);
if($result->get('count') > 0) {
- // TODO make this message translatable
- $this->output->command('update_user_info("User already exists!", "uid")');
+ $this->output->command('update_user_info("signup.userexists", "uid")');
return false;
}
@@ -163,12 +162,10 @@ class kolab_client_task_signup extends kolab_client_task
$result = $this->api->post('user.add', null, $data);
if (array_key_exists('error_code', $result)) {
- // TODO make this message translatable
- $this->output->command('display_message', 'An Error occured. You could not be signed up. Please try again.', 'error');
+ $this->output->command('display_message', 'internalerror', 'error');
return;
} else {
- // TODO make this message translatable
- $this->output->set_object('taskcontent', '<h3>Your account has been successfully added!</h3>Congratulations, you now have your own Kolab account.');
+ $this->output->set_object('taskcontent', 'signup.usercreated');
}
}
@@ -248,18 +245,17 @@ class kolab_client_task_signup extends kolab_client_task
}
// Change field labels for hosted case
- // TODO make translatable
- $fields['uid']['label'] = "Username";
- $fields['mail']['label'] = "Your Future Email Address";
- if(isset($fields['mailalternateaddress'])) $fields['mailalternateaddress']['label'] = "Your Current Email Address";
- $fields['domain']['label'] = "Domain";
+ $fields['uid']['label'] = 'signup.username';
+ $fields['mail']['label'] = 'signup.futuremail';
+ if(isset($fields['mailalternateaddress'])) $fields['mailalternateaddress']['label'] = 'signup.mailalternateaddress';
+ $fields['domain']['label'] = 'signup.domain';
// Create form object and populate with fields
$form = $this->form_create('user', $attribs, array('other'), $fields, $fields_map, $data, true);
- $form->set_title(kolab_html::escape('Sign up'));
+ $form->set_title($this->translate('signup.formtitle'));
- $this->output->add_translation('user.password.mismatch', 'user.add.success');
+ $this->output->add_translation('user.password.mismatch', 'user.add.success', 'signup.wronguid');
return $form->output();
}
diff --git a/lib/locale/de.php b/lib/locale/de.php
index de118f5..1429a4b 100644
--- a/lib/locale/de.php
+++ b/lib/locale/de.php
@@ -115,6 +115,22 @@ $LANG['servererror'] = 'Server Fehler!';
$LANG['session.expired'] = 'Die Sitzung ist ausgelaufen. Bitte wieder Anmelden';
+$LANG['signup.headline'] = 'Anmeldung für ein Kolab Konto';
+$LANG['signup.intro1'] = 'Ein Kolab E-Mail Adresse ist viel besser als eine normale E-Mail. Denn mit ihr kommen Möglichkeiten zur Syncronisation und der gemeinsamen Nutzung von Adressbüchern, Kalendern, Aufgaben, Notizen und vielem mehr.';
+$LANG['signup.intro2'] = 'Sie können sich hier eine E-Mail Adresse registrieren.';
+$LANG['signup.formtitle'] = 'Anmelden';
+$LANG['signup.username'] = 'Benutzername';
+$LANG['signup.domain'] = 'Domain';
+$LANG['signup.mailalternateaddress'] = 'Aktuelle E-Mail Adresse';
+$LANG['signup.futuremail'] = 'Zukünftige E-Mail Adresse';
+$LANG['signup.company'] = 'Firma';
+$LANG['signup.captcha'] = 'CAPTCHA';
+$LANG['signup.userexists'] = 'Benutzer existiert bereits!';
+$LANG['signup.usercreated'] = '<h3>Ihre E-Mail Adresse wurde erfolgreich angelegt!</h3>Sie haben jetzt ein eigenes Kolab-Konto.';
+$LANG['signup.wronguid'] = 'Ungültiger Benutzername!';
+$LANG['signup.wrongmailalternateaddress'] = 'Bitte geben Sie eine gültige E-Mail Adresse an!';
+$LANG['signup.footer'] = 'Dieser Dienst wird von <a href="http://kolabsys.com">Kolab Systems</a> angeboten.';
+
$LANG['submit.button'] = 'Abschicken';
$LANG['user.add'] = 'Benutzer hinzufügen';
diff --git a/lib/locale/en.php b/lib/locale/en.php
index 0da1aa0..75d1f6d 100644
--- a/lib/locale/en.php
+++ b/lib/locale/en.php
@@ -119,6 +119,22 @@ $LANG['servererror'] = 'Server Error!';
$LANG['session.expired'] = 'Session has expired. Login again, please';
+$LANG['signup.headline'] = 'Sign Up for Hosted Kolab';
+$LANG['signup.intro1'] = 'Having an account on a Kolab server is way better than just simple Email. It also provides you with full groupware functionality including synchronization for shared addressbooks, calendars, tasks, journal and more.';
+$LANG['signup.intro2'] = 'You can sign up here now for an account.';
+$LANG['signup.formtitle'] = 'Sign Up';
+$LANG['signup.username'] = 'Username';
+$LANG['signup.domain'] = 'Domain';
+$LANG['signup.mailalternateaddress'] = 'Current Email Address';
+$LANG['signup.futuremail'] = 'Future Email Address';
+$LANG['signup.company'] = 'Company';
+$LANG['signup.captcha'] = 'CAPTCHA';
+$LANG['signup.userexists'] = 'User already exists!';
+$LANG['signup.usercreated'] = '<h3>Your account has been successfully added!</h3>Congratulations, you now have your own Kolab account.';
+$LANG['signup.wronguid'] = 'Invalid Username!';
+$LANG['signup.wrongmailalternateaddress'] = 'Please provide a valid Email Address!';
+$LANG['signup.footer'] = 'This is a service offered by <a href="http://kolabsys.com">Kolab Systems</a>.';
+
$LANG['submit.button'] = 'Submit';
$LANG['user.add'] = 'Add User';
More information about the commits
mailing list