From 8d7f42389cc62b5793857c0569928a2f4fd6f4d6 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 28 May 2014 08:33:09 +0200 Subject: Support csv contacts import in German localization (#1489920) --- program/localization/de_CH/csv2vcard.inc | 110 +++++++++++++++++++++++++++++++ program/localization/de_DE/csv2vcard.inc | 110 +++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+) create mode 100644 program/localization/de_CH/csv2vcard.inc create mode 100644 program/localization/de_DE/csv2vcard.inc (limited to 'program') diff --git a/program/localization/de_CH/csv2vcard.inc b/program/localization/de_CH/csv2vcard.inc new file mode 100644 index 000000000..c6c2c5924 --- /dev/null +++ b/program/localization/de_CH/csv2vcard.inc @@ -0,0 +1,110 @@ + | ++-----------------------------------------------------------------------+ +*/ + +// This is a list of CSV column names specified in CSV file header +// These must be original texts used in Outlook/Thunderbird exported csv files +// Encoding UTF-8 + +$map = array(); + +// MS Outlook 2010 +$map['anniversary'] = "Jahrestag"; +$map['assistants_name'] = "Name Assistent"; +$map['assistants_phone'] = "Telefon Assistent"; +$map['birthday'] = "Geburtstag"; +$map['business_city'] = "Ort geschäftlich"; +$map['business_countryregion'] = "Region geschäftlich"; +$map['business_fax'] = "Fax geschäftlich"; +$map['business_phone'] = "Telefon geschäftlich"; +$map['business_phone_2'] = "Telefon geschäftlich 2"; +$map['business_postal_code'] = "Postleitzahl geschäftlich"; +$map['business_state'] = "Land geschäftlich"; +$map['business_street'] = "Straße geschäftlich"; +$map['car_phone'] = "Autotelefon"; +$map['categories'] = "Kategorien"; +$map['company'] = "Firma"; +$map['department'] = "Abteilung"; +$map['email_address'] = "E-Mail-Adresse"; +$map['first_name'] = "Vorname"; +$map['gender'] = "Geschlecht"; +$map['home_city'] = "Ort privat"; +$map['home_countryregion'] = "Region privat"; +$map['home_fax'] = "Fax privat"; +$map['home_phone'] = "Telefon privat"; +$map['home_phone_2'] = "Telefon privat 2"; +$map['home_postal_code'] = "Postleitzahl privat"; +$map['home_state'] = "Land privat"; +$map['home_street'] = "Straße privat"; +$map['job_title'] = "Position"; +$map['last_name'] = "Nachname"; +$map['managers_name'] = "Manager's Name"; +$map['middle_name'] = "Weitere Vornamen"; +$map['mobile_phone'] = "Mobiltelefon"; +$map['notes'] = "Notizen"; +$map['other_city'] = "Weiterer Ort"; +$map['other_countryregion'] = "Weitere Region"; +$map['other_fax'] = "Weiteres Fax"; +$map['other_phone'] = "Weiteres Telefon"; +$map['other_postal_code'] = "Weitere Postleitzahl"; +$map['other_state'] = "Weiteres Land"; +$map['other_street'] = "Weitere Straße"; +$map['pager'] = "Pager"; +$map['primary_phone'] = "Haupttelefon"; +$map['spouse'] = "Spouse"; +$map['suffix'] = "Suffix"; +$map['title'] = "Title"; +$map['web_page'] = "Webseite"; + +// Thunderbird +$map['birth_day'] = "Geburtstag"; +$map['birth_month'] = "Geburtsmonat"; +$map['birth_year'] = "Geburtsjahr"; +$map['display_name'] = "Anzeigename"; +$map['fax_number'] = "Fax-Nummer"; +$map['home_address'] = "Privat: Adresse"; +$map['home_country'] = "Privat: Land"; +$map['home_zipcode'] = "Privat: PLZ"; +$map['mobile_number'] = "Mobil-Tel.-Nr."; +$map['nickname'] = "Spitzname"; +$map['organization'] = "Organisation"; +$map['pager_number'] = "Pager-Nummer"; +$map['primary_email'] = "Primäre E-Mail-Adresse"; +$map['secondary_email'] = "Sekundäre E-Mail-Adresse"; +$map['web_page_1'] = "Webseite 1"; +$map['web_page_2'] = "Webseite 2"; +$map['work_phone'] = "Tel. dienstlich"; +$map['work_address'] = "Dienstlich: Adresse"; +$map['work_country'] = "Dienstlich: Land"; +$map['work_zipcode'] = "Dienstlich: PLZ"; + +// Atmail +$map['date_of_birth'] = "Date of Birth"; +$map['email'] = "Email"; +$map['home_mobile'] = "Home Mobile"; +$map['home_zip'] = "Home Zip"; +$map['info'] = "Info"; +$map['user_photo'] = "User Photo"; +$map['url'] = "URL"; +$map['work_city'] = "Work City"; +$map['work_company'] = "Work Company"; +$map['work_dept'] = "Work Dept"; +$map['work_fax'] = "Work Fax"; +$map['work_mobile'] = "Work Mobile"; +$map['work_state'] = "Work State"; +$map['work_title'] = "Work Title"; +$map['work_zip'] = "Work Zip"; diff --git a/program/localization/de_DE/csv2vcard.inc b/program/localization/de_DE/csv2vcard.inc new file mode 100644 index 000000000..116349d28 --- /dev/null +++ b/program/localization/de_DE/csv2vcard.inc @@ -0,0 +1,110 @@ + | ++-----------------------------------------------------------------------+ +*/ + +// This is a list of CSV column names specified in CSV file header +// These must be original texts used in Outlook/Thunderbird exported csv files +// Encoding UTF-8 + +$map = array(); + +// MS Outlook 2010 +$map['anniversary'] = "Jahrestag"; +$map['assistants_name'] = "Name Assistent"; +$map['assistants_phone'] = "Telefon Assistent"; +$map['birthday'] = "Geburtstag"; +$map['business_city'] = "Ort geschäftlich"; +$map['business_countryregion'] = "Region geschäftlich"; +$map['business_fax'] = "Fax geschäftlich"; +$map['business_phone'] = "Telefon geschäftlich"; +$map['business_phone_2'] = "Telefon geschäftlich 2"; +$map['business_postal_code'] = "Postleitzahl geschäftlich"; +$map['business_state'] = "Land geschäftlich"; +$map['business_street'] = "Straße geschäftlich"; +$map['car_phone'] = "Autotelefon"; +$map['categories'] = "Kategorien"; +$map['company'] = "Firma"; +$map['department'] = "Abteilung"; +$map['email_address'] = "E-Mail-Adresse"; +$map['first_name'] = "Vorname"; +$map['gender'] = "Geschlecht"; +$map['home_city'] = "Ort privat"; +$map['home_countryregion'] = "Region privat"; +$map['home_fax'] = "Fax privat"; +$map['home_phone'] = "Telefon privat"; +$map['home_phone_2'] = "Telefon privat 2"; +$map['home_postal_code'] = "Postleitzahl privat"; +$map['home_state'] = "Land privat"; +$map['home_street'] = "Straße privat"; +$map['job_title'] = "Position"; +$map['last_name'] = "Nachname"; +$map['managers_name'] = "Manager's Name"; +$map['middle_name'] = "Weitere Vornamen"; +$map['mobile_phone'] = "Mobiltelefon"; +$map['notes'] = "Notizen"; +$map['other_city'] = "Weiterer Ort"; +$map['other_countryregion'] = "Weitere Region"; +$map['other_fax'] = "Weiteres Fax"; +$map['other_phone'] = "Weiteres Telefon"; +$map['other_postal_code'] = "Weitere Postleitzahl"; +$map['other_state'] = "Weiteres Land"; +$map['other_street'] = "Weitere Straße"; +$map['pager'] = "Pager"; +$map['primary_phone'] = "Haupttelefon"; +$map['spouse'] = "Spouse"; +$map['suffix'] = "Suffix"; +$map['title'] = "Title"; +$map['web_page'] = "Webseite"; + +// Thunderbird +$map['birth_day'] = "Geburtstag"; +$map['birth_month'] = "Geburtsmonat"; +$map['birth_year'] = "Geburtsjahr"; +$map['display_name'] = "Anzeigename"; +$map['fax_number'] = "Fax-Nummer"; +$map['home_address'] = "Privat: Adresse"; +$map['home_country'] = "Privat: Land"; +$map['home_zipcode'] = "Privat: PLZ"; +$map['mobile_number'] = "Mobil-Tel.-Nr."; +$map['nickname'] = "Spitzname"; +$map['organization'] = "Organisation"; +$map['pager_number'] = "Pager-Nummer"; +$map['primary_email'] = "Primäre E-Mail-Adresse"; +$map['secondary_email'] = "Sekundäre E-Mail-Adresse"; +$map['web_page_1'] = "Webseite 1"; +$map['web_page_2'] = "Webseite 2"; +$map['work_phone'] = "Tel. dienstlich"; +$map['work_address'] = "Dienstlich: Adresse"; +$map['work_country'] = "Dienstlich: Land"; +$map['work_zipcode'] = "Dienstlich: PLZ"; + +// Atmail +$map['date_of_birth'] = "Date of Birth"; +$map['email'] = "Email"; +$map['home_mobile'] = "Home Mobile"; +$map['home_zip'] = "Home Zip"; +$map['info'] = "Info"; +$map['user_photo'] = "User Photo"; +$map['url'] = "URL"; +$map['work_city'] = "Work City"; +$map['work_company'] = "Work Company"; +$map['work_dept'] = "Work Dept"; +$map['work_fax'] = "Work Fax"; +$map['work_mobile'] = "Work Mobile"; +$map['work_state'] = "Work State"; +$map['work_title'] = "Work Title"; +$map['work_zip'] = "Work Zip"; -- cgit v1.2.3 From 20ef295ba8ff0e9fce57ee24dd7f467a366a5c88 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 28 May 2014 09:05:52 +0200 Subject: Fix UTF7-IMAP encoding detection (fixes folders list sorting) --- program/lib/Roundcube/rcube_imap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'program') diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index e4b77a0a3..8bdc92bee 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -4151,7 +4151,7 @@ class rcube_imap extends rcube_storage if ($folder[0] != '.') { // for better performance skip encoding conversion // if the string does not look like UTF7-IMAP - $folders[$folder] = strpos($folder, '+') === false ? $folder : rcube_charset::convert($folder, 'UTF7-IMAP'); + $folders[$folder] = strpos($folder, '&') === false ? $folder : rcube_charset::convert($folder, 'UTF7-IMAP'); } else { unset($folders[$idx]); -- cgit v1.2.3 From 2441264d00cce5cc3de0dd3923c9226f56bab5ca Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 28 May 2014 10:37:24 +0200 Subject: Improved folders sorting by name - use Intl.Collator if supported --- program/include/rcmail_output_html.php | 1 + program/js/app.js | 43 ++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 17 deletions(-) (limited to 'program') diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php index 2a90f6a01..43d73a6b4 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -68,6 +68,7 @@ class rcmail_output_html extends rcmail_output $this->set_env('task', $task); $this->set_env('x_frame_options', $this->config->get('x_frame_options', 'sameorigin')); $this->set_env('standard_windows', (bool) $this->config->get('standard_windows')); + $this->set_env('locale', $_SESSION['language']); // add cookie info $this->set_env('cookie_domain', ini_get('session.cookie_domain')); diff --git a/program/js/app.js b/program/js/app.js index 670a8e0f5..670e78bc7 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -5898,7 +5898,8 @@ function rcube_webmail() if (!this.gui_objects.subscriptionlist) return false; - var row, n, i, tmp, tmp_name, rowid, folders = [], list = [], slist = [], + var row, n, i, tmp, tmp_name, rowid, collator, + folders = [], list = [], slist = [], tbody = this.gui_objects.subscriptionlist.tBodies[0], refrow = $('tr', tbody).get(1), id = 'rcmrow'+((new Date).getTime()); @@ -5925,24 +5926,32 @@ function rcube_webmail() // add to folder/row-ID map this.env.subscriptionrows[id] = [name, display_name, false]; - // sort folders (to find a place where to insert the row) - // replace delimiter with \0 character to fix sorting - // issue where 'Abc Abc' would be placed before 'Abc/def' - var replace_from = RegExp(RegExp.escape(this.env.delimiter), 'g'), - replace_to = String.fromCharCode(0); - - $.each(this.env.subscriptionrows, function(k,v) { - if (v.length < 4) { - var n = v[0]; - n = n.replace(replace_from, replace_to); - v.push(n); - } - folders.push(v); - }); + // copy folders data to an array for sorting + $.each(this.env.subscriptionrows, function(k, v) { folders.push(v); }); + + try { + // use collator if supported (FF29, IE11, Opera15, Chrome24) + collator = new Intl.Collator(this.env.locale.replace('_', '-')); + } + catch (e) {}; + // sort folders folders.sort(function(a, b) { - var len = a.length - 1; n1 = a[len], n2 = b[len]; - return n1 < n2 ? -1 : 1; + var i, f1, f2, + path1 = a[0].split(ref.env.delimiter), + path2 = b[0].split(ref.env.delimiter); + + for (i=0; i Date: Wed, 28 May 2014 10:58:47 +0200 Subject: Small code improvements --- program/lib/Roundcube/rcube_imap.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'program') diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 8bdc92bee..78073abd6 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -4142,9 +4142,8 @@ class rcube_imap extends rcube_storage */ public function sort_folder_list($a_folders, $skip_default = false) { - $delimiter = $this->get_hierarchy_delimiter(); $specials = array_merge(array('INBOX'), array_values($this->get_special_folders())); - $folders = array_flip($a_folders); + $folders = array(); // convert names to UTF-8 and skip folders starting with '.' foreach ($a_folders as $folder) { @@ -4153,9 +4152,6 @@ class rcube_imap extends rcube_storage // if the string does not look like UTF7-IMAP $folders[$folder] = strpos($folder, '&') === false ? $folder : rcube_charset::convert($folder, 'UTF7-IMAP'); } - else { - unset($folders[$idx]); - } } // sort folders @@ -4175,7 +4171,7 @@ class rcube_imap extends rcube_storage // place default folders on top foreach ($specials as $special) { - $prefix = $special . $delimiter; + $prefix = $special . $this->delimiter; foreach ($folders as $idx => $folder) { if ($folder === $special) { @@ -4200,9 +4196,8 @@ class rcube_imap extends rcube_storage */ protected function sort_folder_comparator($str1, $str2) { - $delimiter = $this->get_hierarchy_delimiter(); - $path1 = explode($delimiter, $str1); - $path2 = explode($delimiter, $str2); + $path1 = explode($this->delimiter, $str1); + $path2 = explode($this->delimiter, $str2); foreach ($path1 as $idx => $folder1) { $folder2 = $path2[$idx]; -- cgit v1.2.3