diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-10-29 08:40:05 (GMT) |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-10-29 08:40:05 (GMT) |
commit | 4b840bd9e3447d8fc72fb279dc7692104e3e28b9 (patch) | |
tree | 6e5a191eeb7908c57a82d2ad2a3f6e1ef3c79f49 | |
parent | 6fc197803965bfde437aa318ff5686b2609cae8d (diff) | |
download | kolab-wap-4b840bd9e3447d8fc72fb279dc7692104e3e28b9.tar.gz |
Do not use a separate localization file for API backend
Conflicts:
.tx/config
-rw-r--r-- | .tx/config | 1 | ||||
-rwxr-xr-x | bin/transifexpull.sh | 1 | ||||
-rw-r--r-- | lib/kolab_api_controller.php | 6 | ||||
-rw-r--r-- | lib/kolab_api_service.php | 4 | ||||
-rw-r--r-- | lib/locale/en_US.api.php | 10 | ||||
-rw-r--r-- | lib/locale/en_US.php | 3 |
6 files changed, 8 insertions, 17 deletions
@@ -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/<lang>.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 @@ -<?php - -$LANG['user.notypeid'] = 'No user type ID specified!'; -$LANG['user.invalidtypeid'] = 'Invalid user type ID!'; - -$LANG['group.notypeid'] = 'No group type ID specified!'; -$LANG['group.invalidtypeid'] = 'Invalid group type ID!'; - -$LANG['form_value.noattribute'] = 'No attribute name specified!'; -$LANG['form_value.unknownattribute'] = 'Unknown attribute!'; diff --git a/lib/locale/en_US.php b/lib/locale/en_US.php index babf530..b9e2d6a 100644 --- a/lib/locale/en_US.php +++ b/lib/locale/en_US.php @@ -9,6 +9,9 @@ $LANG['about.warranty'] = 'It comes with absolutely <b>no warranties</b> 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'; |