diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-02-08 15:07:47 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-02-08 15:07:47 -0500 |
commit | acf3941b4aa95bff9e80aa03e22dc064036e69cf (patch) | |
tree | fa00598349637eb125c8eb132f3dd74a2e3e9e6f /app | |
parent | 813b7c4c0036a73c3bb5ef31f98e83cce2630e9e (diff) |
Improve js and add native language support for datepicker and calendar
Diffstat (limited to 'app')
-rw-r--r-- | app/Core/Helper.php | 56 | ||||
-rw-r--r-- | app/Locale/da_DK/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/de_DE/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/es_ES/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/fi_FI/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/fr_FR/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/hu_HU/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/it_IT/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/ja_JP/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/pl_PL/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/pt_BR/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/ru_RU/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/sv_SE/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/th_TH/translations.php | 38 | ||||
-rw-r--r-- | app/Locale/zh_CN/translations.php | 38 | ||||
-rw-r--r-- | app/Model/Config.php | 53 | ||||
-rw-r--r-- | app/Template/calendar/show.php | 3 | ||||
-rw-r--r-- | app/Template/layout.php | 2 |
18 files changed, 61 insertions, 585 deletions
diff --git a/app/Core/Helper.php b/app/Core/Helper.php index 42cfbc8a..25d580e9 100644 --- a/app/Core/Helper.php +++ b/app/Core/Helper.php @@ -599,56 +599,24 @@ class Helper } /** - * Get calendar translations + * Get javascript language code * * @access public * @return string */ - public function getCalendarTranslations() - { - return json_encode(array( - 'Today' => t('Today'), - 'Jan' => t('Jan'), - 'Feb' => t('Feb'), - 'Mar' => t('Mar'), - 'Apr' => t('Apr'), - 'May' => t('May'), - 'Jun' => t('Jun'), - 'Jul' => t('Jul'), - 'Aug' => t('Aug'), - 'Sep' => t('Sep'), - 'Oct' => t('Oct'), - 'Nov' => t('Nov'), - 'Dec' => t('Dec'), - 'January' => t('January'), - 'February' => t('February'), - 'March' => t('March'), - 'April' => t('April'), - 'May' => t('May'), - 'June' => t('June'), - 'July' => t('July'), - 'August' => t('August'), - 'September' => t('September'), - 'October' => t('October'), - 'November' => t('November'), - 'December' => t('December'), - 'Sunday' => t('Sunday'), - 'Monday' => t('Monday'), - 'Tuesday' => t('Tuesday'), - 'Wednesday' => t('Wednesday'), - 'Thursday' => t('Thursday'), - 'Friday' => t('Friday'), - 'Saturday' => t('Saturday'), - 'Sun' => t('Sun'), - 'Mon' => t('Mon'), - 'Tue' => t('Tue'), - 'Wed' => t('Wed'), - 'Thu' => t('Thu'), - 'Fri' => t('Fri'), - 'Sat' => t('Sat'), - )); + public function jsLang() + { + return $this->config->getJsLanguageCode(); } + /** + * Get the link to toggle subtask status + * + * @access public + * @param array $subtask + * @param string $redirect + * @return string + */ public function toggleSubtaskStatus(array $subtask, $redirect) { if ($subtask['status'] == 0 && isset($this->session['has_subtask_inprogress']) && $this->session['has_subtask_inprogress'] === true) { diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 45611dcd..b312e29d 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', // 'Next' => '', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 6570f154..bd388342 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -650,44 +650,6 @@ return array( 'Filter by column' => 'Spalte filtern', 'Filter by status' => 'Status filtern', 'Calendar' => 'Kalender', - 'Today' => 'Heute', - 'Jan ' => 'Jan', - 'Feb' => 'Feb', - 'Mar' => 'Mar', - 'Apr' => 'Apr', - 'May' => 'Mai', - 'Jun' => 'Jun', - 'Jul' => 'Jul', - 'Aug' => 'Aug', - 'Sep' => 'Sep', - 'Oct' => 'Okt', - 'Nov' => 'Nov', - 'Dec' => 'Dez', - 'January' => 'Januar', - 'February' => 'Februar', - 'March' => 'März', - 'April' => 'April', - 'June' => 'Juni', - 'July' => 'Juli', - 'August' => 'August', - 'September' => 'September', - 'October' => 'Oktober', - 'November' => 'November', - 'December' => 'Dezember', - 'Sunday' => 'Sonntag', - 'Monday' => 'Montag', - 'Tuesday' => 'Dienstag', - 'Wednesday' => 'Mittwoch', - 'Thursday' => 'Donnerstag', - 'Friday' => 'Freitag', - 'Saturday' => 'Samstag', - 'Sun' => 'So', - 'Mon' => 'Mo', - 'Tue' => 'Di', - 'Wed' => 'Mi', - 'Thu' => 'Do', - 'Fri' => 'Fr', - 'Sat' => 'Sa', 'Next' => 'Nächste', // '#%d' => '', 'Filter by color' => 'Farbe filtern', diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index 91eeab00..ec42cc9c 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -650,44 +650,6 @@ return array( 'Filter by column' => 'Filtrar por columna', 'Filter by status' => 'Filtrar por estado', 'Calendar' => 'Calendario', - 'Today' => 'Hoy', - 'Jan ' => 'Ene', - 'Feb' => 'Feb', - 'Mar' => 'Mar', - 'Apr' => 'Abr', - 'May' => 'May', - 'Jun' => 'Jun', - 'Jul' => 'Jul', - 'Aug' => 'Ago', - 'Sep' => 'Sep', - 'Oct' => 'Oct', - 'Nov' => 'Nov', - 'Dec' => 'Dic', - 'January' => 'Enero', - 'February' => 'Febrero', - 'March' => 'Marzo', - 'April' => 'Abril', - 'June' => 'Junio', - 'July' => 'Julio', - 'August' => 'Agosto', - 'September' => 'Septiembre', - 'October' => 'Octubre', - 'November' => 'Noviembre', - 'December' => 'Diciembre', - 'Sunday' => 'Domingo', - 'Monday' => 'Lunes', - 'Tuesday' => 'Martes', - 'Wednesday' => 'Miércoles', - 'Thursday' => 'Jueves', - 'Friday' => 'Viernes', - 'Saturday' => 'Sabado', - 'Sun' => 'Dom', - 'Mon' => 'Lun', - 'Tue' => 'Mar', - 'Wed' => 'Mie', - 'Thu' => 'Jue', - 'Fri' => 'Vie', - 'Sat' => 'Sab', 'Next' => 'Siguiente', '#%d' => '', 'Filter by color' => 'Filtrar por color', diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 4db578dd..c5f45e2d 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', // 'Next' => '', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 90eb87af..8148361c 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -652,44 +652,6 @@ return array( 'Filter by column' => 'Filtrer par colonne', 'Filter by status' => 'Filtrer par status', 'Calendar' => 'Agenda', - 'Today' => 'Aujourd\'hui', - 'Jan ' => 'Janv', - 'Feb' => 'Fév', - 'Mar' => 'Mars', - 'Apr' => 'Avr', - 'May' => 'Mai', - 'Jun' => 'Juin', - 'Jul' => 'Juil', - 'Aug' => 'Août', - 'Sep' => 'Sept', - 'Oct' => 'Oct', - 'Nov' => 'Nov', - 'Dec' => 'Déc', - 'January' => 'Janvier', - 'February' => 'Février', - 'March' => 'Mars', - 'April' => 'Avril', - 'June' => 'Juin', - 'July' => 'Juillet', - 'August' => 'Août', - 'September' => 'Septembre', - 'October' => 'Octobre', - 'November' => 'Novembre', - 'December' => 'Décembre', - 'Sunday' => 'Dimanche', - 'Monday' => 'Lundi', - 'Tuesday' => 'Mardi', - 'Wednesday' => 'Mercredi', - 'Thursday' => 'Jeudi', - 'Friday' => 'Vendredi', - 'Saturday' => 'Samedi', - 'Sun' => 'Dim', - 'Mon' => 'Lun', - 'Tue' => 'Mar', - 'Wed' => 'Mer', - 'Thu' => 'Jeu', - 'Fri' => 'Ven', - 'Sat' => 'Sam', 'Next' => 'Suivant', '#%d' => 'n˚%d', 'Filter by color' => 'Filtrer par couleur', diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index 252e57ef..25e330a2 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', // 'Next' => '', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 4f0e6bc5..ff8ac1cb 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', // 'Next' => '', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index a71bffdd..12dfb953 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', // 'Next' => '', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 49fb3272..53e9e550 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -650,44 +650,6 @@ return array( 'Filter by column' => 'Filtrj według kolumn', 'Filter by status' => 'Filtruj według statusu', 'Calendar' => 'Kalendarz', - 'Today' => 'Dzisiaj', - 'Jan ' => 'Sty', - 'Feb' => 'Lut', - 'Mar' => 'Mar', - 'Apr' => 'Kwi', - 'May' => 'Maj', - 'Jun' => 'Cze', - 'Jul' => 'Lip', - 'Aug' => 'Sie', - 'Sep' => 'Wrz', - 'Oct' => 'Paź', - 'Nov' => 'Lis', - 'Dec' => 'Gru', - 'January' => 'Styczeń', - 'February' => 'Luty', - 'March' => 'Marzec', - 'April' => 'Kwiecień', - 'June' => 'Czerwiec', - 'July' => 'Lipiec', - 'August' => 'Sierpień', - 'September' => 'Wrzesień', - 'October' => 'Październik', - 'November' => 'Listopad', - 'December' => 'Grudzień', - 'Sunday' => 'Niedziela', - 'Monday' => 'Poniedziałek', - 'Tuesday' => 'Wtorek', - 'Wednesday' => 'Środa', - 'Thursday' => 'Czwartek', - 'Friday' => 'Piątek', - 'Saturday' => 'Sobota', - 'Sun' => 'Nie', - 'Mon' => 'Pon', - 'Tue' => 'Wto', - 'Wed' => 'Śro', - 'Thu' => 'Czw', - 'Fri' => 'Pią', - 'Sat' => 'Sob', 'Next' => 'Następny', // '#%d' => '', 'Filter by color' => 'Filtruj według koloru', diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index bd327f0b..368ce0e6 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -650,44 +650,6 @@ return array( 'Filter by column' => 'Filtrar por coluna', 'Filter by status' => 'Filtrar por status', 'Calendar' => 'Calendário', - 'Today' => 'Hoje', - 'Jan ' => 'Jan', - 'Feb' => 'Fev', - 'Mar' => 'Mar', - 'Apr' => 'Abr', - 'May' => 'Maio', - 'Jun' => 'Jun', - 'Jul' => 'Jul', - 'Aug' => 'Ago', - 'Sep' => 'Set', - 'Oct' => 'Out', - 'Nov' => 'Nov', - 'Dec' => 'Dez', - 'January' => 'Janeiro', - 'February' => 'Fevereiro', - 'March' => 'Março', - 'April' => 'Abril', - 'June' => 'Junho', - 'July' => 'Julho', - 'August' => 'Agosto', - 'September' => 'Setembro', - 'October' => 'Outubro', - 'November' => 'Novembro', - 'December' => 'Dezembro', - 'Sunday' => 'Domingo', - 'Monday' => 'Segunda', - 'Tuesday' => 'Terça', - 'Wednesday' => 'Quarta', - 'Thursday' => 'Quinta', - 'Friday' => 'Sexta', - 'Saturday' => 'Sábado', - 'Sun' => 'Dom', - 'Mon' => 'Seg', - 'Tue' => 'Ter', - 'Wed' => 'Qua', - 'Thu' => 'Qui', - 'Fri' => 'Sex', - 'Sat' => 'Sáb', 'Next' => 'Próximo', // '#%d' => '', 'Filter by color' => 'Filtrar por cor', diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 1042830d..134133ca 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', // 'Next' => '', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index cdae7fde..c0babf5a 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', 'Next' => 'Nästa', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index 54d94519..3455739c 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', // 'Next' => '', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 2a2bc0b8..ed9ab82b 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -650,44 +650,6 @@ return array( // 'Filter by column' => '', // 'Filter by status' => '', // 'Calendar' => '', - // 'Today' => '', - // 'Jan ' => '', - // 'Feb' => '', - // 'Mar' => '', - // 'Apr' => '', - // 'May' => '', - // 'Jun' => '', - // 'Jul' => '', - // 'Aug' => '', - // 'Sep' => '', - // 'Oct' => '', - // 'Nov' => '', - // 'Dec' => '', - // 'January' => '', - // 'February' => '', - // 'March' => '', - // 'April' => '', - // 'June' => '', - // 'July' => '', - // 'August' => '', - // 'September' => '', - // 'October' => '', - // 'November' => '', - // 'December' => '', - // 'Sunday' => '', - // 'Monday' => '', - // 'Tuesday' => '', - // 'Wednesday' => '', - // 'Thursday' => '', - // 'Friday' => '', - // 'Saturday' => '', - // 'Sun' => '', - // 'Mon' => '', - // 'Tue' => '', - // 'Wed' => '', - // 'Thu' => '', - // 'Fri' => '', - // 'Sat' => '', // 'Next' => '', // '#%d' => '', // 'Filter by color' => '', diff --git a/app/Model/Config.php b/app/Model/Config.php index d078a00a..542cedf7 100644 --- a/app/Model/Config.php +++ b/app/Model/Config.php @@ -76,6 +76,52 @@ class Config extends Base } /** + * Get javascript language code + * + * @access public + * @return string + */ + public function getJsLanguageCode() + { + $languages = array( + 'da_DK' => 'da', + 'de_DE' => 'de', + 'en_US' => 'en', + 'es_ES' => 'es', + 'fr_FR' => 'fr', + 'it_IT' => 'it', + 'hu_HU' => 'hu', + 'pl_PL' => 'pl', + 'pt_BR' => 'pt-br', + 'ru_RU' => 'ru', + 'fi_FI' => 'fi', + 'sv_SE' => 'sv', + 'zh_CN' => 'zh-cn', + 'ja_JP' => 'ja', + 'th_TH' => 'th', + ); + + $lang = $this->getCurrentLanguage(); + + return isset($languages[$lang]) ? $languages[$lang] : 'en'; + } + + /** + * Get current language + * + * @access public + * @return string + */ + public function getCurrentLanguage() + { + if ($this->userSession->isLogged() && ! empty($this->session['user']['language'])) { + return $this->session['user']['language']; + } + + return $this->get('application_language', 'en_US'); + } + + /** * Get a config variable from the session or the database * * @access public @@ -152,12 +198,7 @@ class Config extends Base */ public function setupTranslations() { - if ($this->userSession->isLogged() && ! empty($this->session['user']['language'])) { - Translator::load($this->session['user']['language']); - } - else { - Translator::load($this->get('application_language', 'en_US')); - } + Translator::load($this->getCurrentLanguage()); } /** diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php index a0bda008..b258e391 100644 --- a/app/Template/calendar/show.php +++ b/app/Template/calendar/show.php @@ -37,9 +37,8 @@ data-save-url="<?= $this->u('calendar', 'save', array('project_id' => $project['id'])) ?>" data-check-url="<?= $this->u('calendar', 'events', array('project_id' => $project['id'])) ?>" data-check-interval="<?= $check_interval ?>" - data-translations='<?= $this->getCalendarTranslations() ?>' > </div> </div> </section> -</section> +</section>
\ No newline at end of file diff --git a/app/Template/layout.php b/app/Template/layout.php index f04dad4b..0e44569e 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -25,7 +25,7 @@ <title><?= isset($title) ? $this->e($title) : 'Kanboard' ?></title> </head> - <body data-status-url="<?= $this->u('app', 'status') ?>" data-login-url="<?= $this->u('user', 'login') ?>"> + <body data-status-url="<?= $this->u('app', 'status') ?>" data-login-url="<?= $this->u('user', 'login') ?>" data-js-lang="<?= $this->jsLang() ?>"> <?php if (isset($no_layout) && $no_layout): ?> <?= $content_for_layout ?> <?php else: ?> |