bin/transifexpull.sh lib/kolab_api_controller.php lib/kolab_api_service.php lib/locale .tx/config
Aleksander Machniak
machniak at kolabsys.com
Tue Oct 29 09:35:16 CET 2013
.tx/config | 5 -----
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(+), 21 deletions(-)
New commits:
commit 6c2720f7e3ecb1789e71750339f8cd853a1b365c
Author: Aleksander Machniak <alec at alec.pl>
Date: Tue Oct 29 09:34:28 2013 +0100
Do not use a separate localization file for API backend
diff --git a/.tx/config b/.tx/config
index 305e33a..06e1255 100644
--- a/.tx/config
+++ b/.tx/config
@@ -6,8 +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
-
-[kolab.kolab-webadmin-api]
-file_filter = lib/locale/<lang>.api.php
-source_file = lib/locale/en_US.api.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 c8f2680..83fdd5b 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';
More information about the commits
mailing list