Skip to content

Commit

Permalink
Add language support.
Browse files Browse the repository at this point in the history
The plugin now has its own language directory copied from the plugin photo_update
bc the fuction of photo_update can be replaced by the alternative function in our
plugin. anyway, if the plugin photo_update is enabled, its language support will
be loaded to our plugin.

We also load language support from the plugin "community".
  • Loading branch information
icy committed Mar 23, 2013
1 parent b44264f commit e700fbd
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 4 deletions.
7 changes: 6 additions & 1 deletion add_photos.php
Expand Up @@ -14,12 +14,17 @@
* user about this. FIXME: How to know if a method is in black-list?)
*/

if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
if (!defined('ICY_PICTURE_MODIFY_PATH')) die('Hacking attempt!');

global $template, $conf, $user;

include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');

if (!icy_plugin_enabled("community")) {
die('Something wrong happended. The plugin "community" must be enabled to use this function.');
}

include_once(COMMUNITY_PATH.'include/functions_community.inc.php');

if (!defined('PHOTOS_ADD_BASE_URL')) {
Expand Down
11 changes: 11 additions & 0 deletions icy_picture_modify.php
Expand Up @@ -12,6 +12,17 @@
require_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
require_once(ICY_PICTURE_MODIFY_PATH.'include/functions_icy_picture_modify.inc.php');

/* Language support */
load_language('plugin.lang', ICY_PICTURE_MODIFY_PATH . '/');

if (icy_plugin_enabled("photo_update")) {
load_language('plugin.lang', PHPWG_PLUGINS_PATH . '/photo_update/');
}

if (icy_plugin_enabled("community")) {
load_language('plugin.lang', PHPWG_PLUGINS_PATH . '/community/');
}

// <ADMIN_ONLY>
if (is_admin())
{
Expand Down
1 change: 1 addition & 0 deletions language/en_UK/description.txt
@@ -0,0 +1 @@
Allow normal users to upload images and/or edit information of any set of images. This plugin provides advanced ACL for your gallery.
5 changes: 5 additions & 0 deletions language/en_UK/plugin.lang.php
@@ -0,0 +1,5 @@
<?php
$lang['The photo was updated'] = 'The photo was updated';
$lang['Photo Update'] = 'Photo Update';
$lang['Update'] = 'Update';
?>
1 change: 1 addition & 0 deletions language/vi_VN/description.txt
@@ -0,0 +1 @@
Cho phép thành viên tải hình ảnh lên gallery, đổi hoặc chỉnh sửa thông tin của hình trong bất kỳ album nào
5 changes: 5 additions & 0 deletions language/vi_VN/plugin.lang.php
@@ -0,0 +1,5 @@
<?php
$lang['The photo was updated'] = 'Hình đã được cập nhật';
$lang['Photo Update'] = 'Cập nhật hình';
$lang['Update'] = 'Cập nhật';
?>
5 changes: 2 additions & 3 deletions main.inc.php
Expand Up @@ -9,12 +9,11 @@
License: GPL2
*/

if (!defined('PHPWG_ROOT_PATH'))
{
if (!defined('PHPWG_ROOT_PATH')) {
die('Hacking attempt!');
}

define('ICY_PICTURE_MODIFY_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
define('ICY_PICTURE_MODIFY_PATH' , PHPWG_PLUGINS_PATH .'icy_picture_modify/');
require_once(ICY_PICTURE_MODIFY_PATH.'include/functions_icy_picture_modify.inc.php');

# Variable declarations ################################################
Expand Down

0 comments on commit e700fbd

Please sign in to comment.