[FIX] google_calendar: cleanup/spellcheck translatable terms

This commit is contained in:
Olivier Dony 2014-07-08 18:29:39 +02:00
parent 57f79f9fa1
commit 07571de01b
1 changed files with 10 additions and 8 deletions

View File

@ -25,35 +25,37 @@ openerp.google_calendar = function(instance) {
local_context: context local_context: context
}).done(function(o) { }).done(function(o) {
if (o.status === "need_auth") { if (o.status === "need_auth") {
alert(_t("You will be redirected on gmail to authorize your Odoo to access your calendar !")); alert(_t("You will be redirected to Google to authorize access to your calendar!"));
instance.web.redirect(o.url); instance.web.redirect(o.url);
} }
else if (o.status === "need_config_from_admin"){ else if (o.status === "need_config_from_admin"){
if (!_.isUndefined(o.action) && parseInt(o.action)){ if (!_.isUndefined(o.action) && parseInt(o.action)){
if (confirm(_t("An admin need to configure Google Synchronization before to use it, do you want to configure it now ? !"))){ if (confirm(_t("The Google Synchronization needs to be configured before you can use it, do you want to do it now?"))) {
self.do_action(o.action); self.do_action(o.action);
} }
} }
else{ else{
alert(_t("An admin need to configure Google Synchronization before to use it !")); alert(_t("An administrator needs to configure Google Synchronization before you can use it!"));
} }
} }
else if (o.status === "need_refresh"){ else if (o.status === "need_refresh"){
self.$calendar.fullCalendar('refetchEvents'); self.$calendar.fullCalendar('refetchEvents');
} }
else if (o.status === "need_reset"){ else if (o.status === "need_reset"){
if (confirm(_t("The account that you are trying to synchronize (" + o.info.new_name + "), is not the same that the last one used \ var confirm_text1 = _t("The account you are trying to synchronize (%s) is not the same as the last one used (%s)!");
(" + o.info.old_name + "! )" + "\r\n\r\nDo you want remove all references from the old account ?"))){ var confirm_text2 = _t("In order to do this, you first need to disconnect all existing events from the old account.");
var confirm_text3 = _t("Do you want to do this now?");
var text = _.str.sprintf(confirm_text1 + "\n" + confirm_text2 + "\n\n" + confirm_text3, o.info.new_name, o.info.old_name);
if (confirm(text)) {
self.rpc('/google_calendar/remove_references', { self.rpc('/google_calendar/remove_references', {
model:res.model, model:res.model,
local_context:context local_context:context
}).done(function(o) { }).done(function(o) {
if (o.status === "OK") { if (o.status === "OK") {
alert(_t("All old references have been deleted. You can now restart the synchronization")); alert(_t("All events have been disconnected from your previous account. You can now restart the synchronization"));
} }
else if (o.status === "KO") { else if (o.status === "KO") {
alert(_t("An error has occured when we was removing all old references. Please retry or contact your administrator.")); alert(_t("An error occured while disconnecting events from your previous account. Please retry or contact your administrator."));
} }
//else NOP //else NOP
}); });