From 4b840bd9e3447d8fc72fb279dc7692104e3e28b9 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 29 Oct 2013 09:40:05 +0100 Subject: Do not use a separate localization file for API backend Conflicts: .tx/config --- .tx/config | 1 - bin/transifexpull.sh | 1 - lib/kolab_api_controller.php | 6 +++--- lib/kolab_api_service.php | 4 ++-- lib/locale/en_US.api.php | 10 ---------- lib/locale/en_US.php | 3 +++ 6 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 lib/locale/en_US.api.php diff --git a/.tx/config b/.tx/config index 91923f6..06e1255 100644 --- a/.tx/config +++ b/.tx/config @@ -6,4 +6,3 @@ lang_map = en: en_US, de: de_DE, es: es_ES, fi: fi_FI, fr: fr_FR, ja: ja_JP, nl: file_filter = lib/locale/.php source_file = lib/locale/en_US.php source_lang = en_US - diff --git a/bin/transifexpull.sh b/bin/transifexpull.sh index 454b1bc..46962b0 100755 --- a/bin/transifexpull.sh +++ b/bin/transifexpull.sh @@ -34,7 +34,6 @@ DIR="${PWD}/../lib/locale" EN_CNT=`do_count $DIR/en_US.php` for file in $DIR/*.php; do - echo "$file" | grep -v api.php > /dev/null || continue do_clean $file CNT=`do_count $file` PERCENT=$((CNT*100/$EN_CNT)) diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php index f58d717..3b6766d 100644 --- a/lib/kolab_api_controller.php +++ b/lib/kolab_api_controller.php @@ -470,10 +470,10 @@ class kolab_api_controller } $LANG = array(); - @include INSTALL_PATH . '/locale/en_US.api.php'; + @include INSTALL_PATH . '/locale/en_US.php'; - if ($lang != 'en_US' && file_exists(INSTALL_PATH . "/locale/$lang.api.php")) { - @include INSTALL_PATH . "/locale/$language.api.php"; + if ($lang != 'en_US' && file_exists(INSTALL_PATH . "/locale/$lang.php")) { + @include INSTALL_PATH . "/locale/$language.php"; } setlocale(LC_ALL, $lang . '.utf8', 'en_US.utf8'); diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php index 8affdd4..276e679 100644 --- a/lib/kolab_api_service.php +++ b/lib/kolab_api_service.php @@ -70,7 +70,7 @@ abstract class kolab_api_service if (empty($type_id)) { if ($required) { - throw new Exception($this->controller->translate($object_name . '.notypeid'), 34); + throw new Exception($this->controller->translate('api.notypeid'), 34); } return array(); @@ -89,7 +89,7 @@ abstract class kolab_api_service return $result; } else { - throw new Exception($this->controller->translate($object_name . '.invalidtypeid'), 35); + throw new Exception($this->controller->translate('api.invalidtypeid'), 35); } } diff --git a/lib/locale/en_US.api.php b/lib/locale/en_US.api.php deleted file mode 100644 index 65a3896..0000000 --- a/lib/locale/en_US.api.php +++ /dev/null @@ -1,10 +0,0 @@ -no warranties and is $LANG['add'] = 'Add'; +$LANG['api.notypeid'] = 'No object type ID specified!'; +$LANG['api.invalidtypeid'] = 'Invalid object type ID!'; + $LANG['attribute.add'] = 'Add attribute'; $LANG['attribute.default'] = 'Default value'; $LANG['attribute.static'] = 'Static value'; -- cgit v0.12