Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

-Created branch ppa_new_plugin_arch for the new plugin architecture;

-Included index 'plugins' in the $conf var;
-Included index 'PluginExample' in the $conf['plugins'] var;
-Created PluginManager class (classes/plugins/PluginManager.php) to manage the plugins;
-Created plugins directory;
-Created basic structure of a plugin, PluginExample, with some example functions;
-Updated file libraries/lib.inc.php, with the code to manager the plugins;
-Updated code that write the toplinks at classes/Misc.php;
-Created a hook example for the toplinks;
-Created default transalation for the PluginExample (English);
-Created default transalation for the PluginExample (Portuguese-BR);
  • Loading branch information...
commit 8ccfe9f14bf83a26fb2c9abd2828b5473f3f9897 1 parent ed943b3
@asleonardo authored
View
18 classes/Misc.php
@@ -1142,11 +1142,21 @@ function printTopbar() {
' onclick="return confirm(\''. $lang['strconfdropcred']. '\')"':
'';
+ global $plugin_manager;
+ $toplinks = array();
+ $toplinks[] = "<a class=\"toplink\" href=\"{$sql_url}sql\" target=\"sqledit\" onclick=\"window.open('{$sql_url}sql','{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus(); return false;\">{$lang['strsql']}</a>";
+ $toplinks[] = "<a class=\"toplink\" href=\"{$history_url}\" onclick=\"window.open('{$history_url}','{$history_window_id}','toolbar=no,width=800,height=600,resizable=yes,scrollbars=yes').focus(); return false;\">{$lang['strhistory']}</a>";
+ $toplinks[] = "<a class=\"toplink\" href=\"{$sql_url}find\" target=\"sqledit\" onclick=\"window.open('{$sql_url}find','{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus(); return false;\">{$lang['strfind']}</a>";
+ /* TOPLINK HOOK'S PLACE */
+ $plugin_manager->execute_plugin_funtions('toplinks', $toplinks);
+ $toplinks[] = "<a class=\"toplink\" href=\"servers.php?action=logout&amp;logoutServer=".htmlspecialchars($server_info['host']).":".htmlspecialchars($server_info['port']).":".htmlspecialchars($server_info['sslmode'])."\"{$logout_shared}>{$lang['strlogout']}</a>";
+
+
echo "<td style=\"text-align: right\">";
- echo "<ul class=\"toplink\">\n\t<li><a class=\"toplink\" href=\"{$sql_url}sql\" target=\"sqledit\" onclick=\"window.open('{$sql_url}sql','{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus(); return false;\">{$lang['strsql']}</a></li>\n";
- echo "\t<li><a class=\"toplink\" href=\"{$history_url}\" onclick=\"window.open('{$history_url}','{$history_window_id}','toolbar=no,width=800,height=600,resizable=yes,scrollbars=yes').focus(); return false;\">{$lang['strhistory']}</a></li>\n";
- echo "\t<li><a class=\"toplink\" href=\"{$sql_url}find\" target=\"sqledit\" onclick=\"window.open('{$sql_url}find','{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus(); return false;\">{$lang['strfind']}</a></li>\n";
- echo "\t<li><a class=\"toplink\" href=\"servers.php?action=logout&amp;logoutServer=".htmlspecialchars($server_info['host']).":".htmlspecialchars($server_info['port']).":".htmlspecialchars($server_info['sslmode'])."\"{$logout_shared}>{$lang['strlogout']}</a></li>\n";
+ echo "<ul class=\"toplink\">\n";
+ foreach ($toplinks as $link) {
+ echo "\t<li>$link</li>\n";
+ }
echo "</ul>\n";
echo "</td>";
}
View
65 classes/plugins/PluginManager.php
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * A class that implements the plugin's system
+ *
+ * $Id:
@asleonardo Owner

The $Id was used by cvs. I can be dropped from here, and the other files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ */
+
+class PluginManager {
+
+ /**
+ * Attributes
+ */
+ public $plugins_list = array();
+ public $functions_list = array();
+
+ /**
+ * Add a plugin in the manager
+ * @param $plugin
+ */
+ function add_plugin($plugin) {
+ $this->plugins_list[$plugin->get_plugin_index()] = $plugin;
+ }
+
+ /**
+ * Get a plugin from the $plugins_list by the plugin's name.
+ * @param $plugin_index
+ */
+ function get_plugin($plugin_index) {
+ return $this->plugins_list[$plugin_index];
+ }
+
+ /**
+ * Add a function in the $functions_list list, with the information when this function will be used by the
+ * phppgadmin core.
+ * @param $plugin_index - Index that identify the plugin. Example the plugin_example's index is plugin_example :-)
+ * @param $when - This identify when the added function will be called
+ * @param $function - The name of the function. It will be called by callback;
+ */
+ function add_plugin_functions($plugin_index, $when, $function) {
+ $this->functions_list[$when][] = array('plugin_index' => $plugin_index, 'function' => $function);
+ }
+
+ /**
+ * Execute the plugins functions according some moment.
+ * @param $when - When the function will be called
+ * @param $function_args - The reference to arguments of the called function
+ *
+ * TODO: check the supported entries (browser tree, tabs, trailer, navigation links, action buttons, top links)
+ */
+ function execute_plugin_funtions($when, &$function_args) {
+ if (isset($this->functions_list[$when])) {
+ foreach ($this->functions_list[$when] as $node) {
+ $plugin_index = $node['plugin_index'];
+ $function = $node['function'];
+ $plugin = $this->get_plugin($plugin_index);
+ //
+ if (method_exists($plugin, $function)) {
+ call_user_func_array(array($plugin, $function), array(&$function_args));
+ }
+ }
+ }
+ }
+}
+?>
View
6 conf/config.inc.php-dist
@@ -149,7 +149,11 @@
// Configuration for ajax scripts
// Time in seconds. If set to 0, refreshing data using ajax will be disabled (locks and activity pages)
$conf['ajax_refresh'] = 3;
-
+
+ // Plugins
+ $conf['plugins'] = array();
+ $conf['plugins'][] = 'PluginExample';
+
@xzilla
xzilla added a note

Would it be possible to combine the above into a single config variable.... like $conf['plugins'] = array('PluginExample','Slony');

@asleonardo Owner

Yup, I don't see problem. I will also write an comment with an example. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
/*****************************************
* Don't modify anything below this line *
*****************************************/
View
11 libraries/lib.inc.php
@@ -179,6 +179,17 @@
exit;
}
+ // Check if there are activated plugins
+ $plugins = $conf['plugins'];//xdebug_var_dump($lang, $_language);
+ require_once('./classes/plugins/PluginManager.php');
+ $plugin_manager = new PluginManager();
+ //register the plugins and their functions
+ foreach ($plugins as $activated_plugin) {
+ include_once('./plugins/'.$activated_plugin.'/plugin.php');
+ $plugin = new $activated_plugin($plugin_manager, $_language);
+ $plugin_manager->add_plugin($plugin);
+ }
+
// Create data accessor object, if necessary
if (!isset($_no_db_connection)) {
if (!isset($_REQUEST['server'])) {
View
12 plugins/PluginExample/README.txt
@@ -0,0 +1,12 @@
+It is a plugin example, that will be usefull to create other plugins.
+
+This plugin is able to:
+
+* Add an entry in the browser tree in any level
+* Add an entry in the tabs
+* Add an entry in the trailer
+* Add an entry in the navigation links
+* Add an entry in the action buttons
+* Add an entry in the top links
+
+The example plugin is default disable in the central config.inc.php file.
View
257 plugins/PluginExample/lang/Makefile
@@ -0,0 +1,257 @@
+# This Makefile recodes source lang files into XML Unicode.
+# You should add your encodings to this file. You need to have GNU Recode
+# installed.
+#
@asleonardo Owner

Write a comment that this files is a copy from lang/Makefile. And remove unnecessaries comments and languages that this plugin doesn't have translation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+# It is important to:
+# - fix the delimiters of php code: <?php and ?>
+# - convert CRLF -> LF
+# - remove all text before first <?php
+# - remove all text after last ?>
+# - convert "&apos;" -> "'"
+# using 'convert.awk'
+#
+# Modifications by Dave Smith, 2003-11-10:
+# Added TARGETS variable for easy listing of all lang files.
+# Added 'prepare' target to check that 'recode' is installed.
+# Added 'clean' target to nuke recoded files.
+# Surpressed verbose command line dumpage with '@'.
+# Added dependency checking for incremental recoding.
+# Added pretty "Recoding ..." messages.
+# Added 'chmod 644' to 'all' target for correct file permissions.
+# Modifications by Rafal Slubowski, 2003-12-12:
+# All conversions of recoded text moved to convert.awk script
+#
+# $Id: Makefile,v 1.48 2007/02/10 03:48:35 xzilla Exp $
@asleonardo Owner

Remove the $Id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
+DESTDIR=./recoded
+TARGETS=polish \
+ english \
+ chinese-sim \
+ chinese-tr \
+ chinese-utf8-zh_TW \
+ chinese-utf8-zh_CN \
+ danish \
+ dutch \
+ german \
+ spanish \
+ italian \
+ french \
+ russian \
+ russian-utf8 \
+ japanese \
+ slovak \
+ turkish \
+ czech \
+ portuguese-br \
+ portuguese-pt \
+ swedish \
+ afrikaans \
+ arabic \
+ mongol \
+ ukrainian \
+ hungarian \
+ hebrew \
+ catalan \
+ romanian \
+ greek \
+ galician
+
+all: prepare ${TARGETS}
+ @for p in ${TARGETS} ; do chmod 644 ${DESTDIR}/$$p.php ; done
+
+prepare:
+ @which recode >/dev/null 2>&1 || ( echo "You must have GNU 'recode' installed to use this Makefile,\
+ but I could not find it in your path!" && exit 1 )
+ @which sed >/dev/null 2>&1 || ( echo "You must have sed installed to use this Makefile,\
+ but I could not find it in your path!" && exit 1 )
+ @which awk >/dev/null 2>&1 || ( echo "You must have awk installed to use this Makefile,\
+ but I could not find it in your path!" && exit 1 )
+
+clean:
+ @echo "Nuking recoded lang files..."
+ @for p in ${TARGETS} ; do rm -fv ${DESTDIR}/$$p.php ; done
+
+catalan: catalan.php
+ @echo "Recoding catalan..."
+ @cat catalan.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/catalan.php
+ @chmod 644 catalan.php ${DESTDIR}/catalan.php
+
+polish: polish.php
+ @echo "Recoding polish..."
+ @cat polish.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/polish.php
+ @chmod 644 polish.php ${DESTDIR}/polish.php
+
+english: english.php
+ @echo "Recoding english..."
+ @cat english.php | recode latin1..xml | ./convert.awk \
+ > ${DESTDIR}/english.php
+ @chmod 644 english.php ${DESTDIR}/english.php
+
+dutch: dutch.php
+ @echo "Recoding dutch..."
+ @cat dutch.php | recode latin1..xml | ./convert.awk \
+ > ${DESTDIR}/dutch.php
+ @chmod 644 dutch.php ${DESTDIR}/dutch.php
+
+danish: danish.php
+ @echo "Recoding danish..."
+ @cat danish.php | recode latin1..xml | ./convert.awk \
+ > ${DESTDIR}/danish.php
+ @chmod 644 danish.php ${DESTDIR}/danish.php
+
+german: german.php
+ @echo "Recoding german..."
+ @cat german.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/german.php
+ @chmod 644 german.php ${DESTDIR}/german.php
+
+spanish: spanish.php
+ @echo "Recoding spanish..."
+ @cat spanish.php | recode iso-8859-1..xml | ./convert.awk \
+ > ${DESTDIR}/spanish.php
+ @chmod 644 spanish.php ${DESTDIR}/spanish.php
+
+italian: italian.php
+ @echo "Recoding italian..."
+ @cat italian.php | recode iso-8859-1..xml | ./convert.awk \
+ > ${DESTDIR}/italian.php
+ @chmod 644 italian.php ${DESTDIR}/italian.php
+
+chinese-sim: chinese-sim.php
+ @echo "Recoding chinese-sim..."
+ @cat chinese-sim.php | recode gb2312..xml | ./convert.awk \
+ > ${DESTDIR}/chinese-sim.php
+ @chmod 644 chinese-sim.php ${DESTDIR}/chinese-sim.php
+
+chinese-tr: chinese-tr.php
+ @echo "Recoding chinese-tr..."
+ @cat chinese-tr.php | recode big5..xml | ./convert.awk \
+ > ${DESTDIR}/chinese-tr.php
+ @chmod 644 chinese-tr.php ${DESTDIR}/chinese-tr.php
+
+chinese-utf8-zh_CN: chinese-utf8-zh_CN.php
+ @echo "Recoding chinese-utf8-zh_CN..."
+ @cat chinese-utf8-zh_CN.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/chinese-utf8-zh_CN.php
+ @chmod 644 chinese-utf8-zh_CN.php ${DESTDIR}/chinese-utf8-zh_CN.php
+
+chinese-utf8-zh_TW: chinese-utf8-zh_TW.php
+ @echo "Recoding chinese-utf8-zh_TW..."
+ @cat chinese-utf8-zh_TW.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/chinese-utf8-zh_TW.php
+ @chmod 644 chinese-utf8-zh_TW.php ${DESTDIR}/chinese-utf8-zh_TW.php
+
+french: french.php
+ @echo "Recoding french..."
+ @cat french.php | recode latin1..xml | ./convert.awk \
+ > ${DESTDIR}/french.php
+ @chmod 644 french.php ${DESTDIR}/french.php
+
+japanese: japanese.php
+ @echo "Recoding japanese..."
+ @cat japanese.php | recode euc-jp..xml | ./convert.awk \
+ > ${DESTDIR}/japanese.php
+ @chmod 644 japanese.php ${DESTDIR}/japanese.php
+
+russian: russian.php
+ @echo "Recoding russian..."
+ @cat russian.php | recode koi8..xml | ./convert.awk \
+ > ${DESTDIR}/russian.php
+ @chmod 644 russian.php ${DESTDIR}/russian.php
+russian-utf8: russian-utf8.php
+ @echo "Recoding russian-utf8..."
+ @cat russian-utf8.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/russian-utf8.php
+ @chmod 644 russian-utf8.php ${DESTDIR}/russian-utf8.php
+
+slovak: slovak.php
+ @echo "Recoding slovak..."
+ @cat slovak.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/slovak.php
+ @chmod 644 slovak.php ${DESTDIR}/slovak.php
+
+czech: czech.php
+ @echo "Recoding czech..."
+ @cat czech.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/czech.php
+ @chmod 644 czech.php ${DESTDIR}/czech.php
+
+turkish: turkish.php
+ @echo "Recoding turkish..."
+ @cat turkish.php | recode iso-8859-9..xml | ./convert.awk \
+ > ${DESTDIR}/turkish.php
+ @chmod 644 turkish.php ${DESTDIR}/turkish.php
+
+portuguese-br: portuguese-br.php
+ @echo "Recoding portuguese-br..."
+ @cat portuguese-br.php | recode iso-8859-1..xml | ./convert.awk \
+ > ${DESTDIR}/portuguese-br.php
+ @chmod 644 portuguese-br.php ${DESTDIR}/portuguese-br.php
+
+portuguese-pt: portuguese-pt.php
+ @echo "Recoding portuguese-pt..."
+ @cat portuguese-pt.php | recode iso-8859-15..xml | ./convert.awk \
+ > ${DESTDIR}/portuguese-pt.php
+ @chmod 644 portuguese-pt.php ${DESTDIR}/portuguese-pt.php
+
+swedish: swedish.php
+ @echo "Recoding swedish..."
+ @cat swedish.php | recode iso-8859-1..xml | ./convert.awk \
+ > ${DESTDIR}/swedish.php
+ @chmod 644 swedish.php ${DESTDIR}/swedish.php
+
+afrikaans: afrikaans.php
+ @echo "Recoding afrikaans..."
+ @cat afrikaans.php | recode iso-8859-1..xml | ./convert.awk \
+ > ${DESTDIR}/afrikaans.php
+ @chmod 644 afrikaans.php ${DESTDIR}/afrikaans.php
+
+hungarian: hungarian.php
+ @echo "Recoding hungarian..."
+ @cat hungarian.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/hungarian.php
+ @chmod 644 hungarian.php ${DESTDIR}/hungarian.php
+
+arabic: arabic.php
+ @echo "Recoding arabic..."
+ @cat arabic.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/arabic.php
+ @chmod 644 arabic.php ${DESTDIR}/arabic.php
+
+mongol: mongol.php
+ @echo "Recoding mongol..."
+ @cat mongol.php | recode iso-8859-5..xml | ./convert.awk \
+ > ${DESTDIR}/mongol.php
+ @chmod 644 mongol.php ${DESTDIR}/mongol.php
+
+ukrainian: ukrainian.php
+ @echo "Recoding ukrainian..."
+ @cat ukrainian.php | recode koi8-r..xml | ./convert.awk \
+ > ${DESTDIR}/ukrainian.php
+ @chmod 644 ukrainian.php ${DESTDIR}/ukrainian.php
+
+hebrew: hebrew.php
+ @echo "Recoding hebrew..."
+ @cat hebrew.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/hebrew.php
+ @chmod 644 hebrew.php ${DESTDIR}/hebrew.php
+
+romanian: romanian.php
+ @echo "Recoding romanian..."
+ @cat romanian.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/romanian.php
+ @chmod 644 romanian.php ${DESTDIR}/romanian.php
+
+greek: greek.php
+ @echo "Recoding greek..."
+ @cat greek.php | recode iso-8859-7..xml | ./convert.awk \
+ > ${DESTDIR}/greek.php
+ @chmod 644 greek.php ${DESTDIR}/greek.php
+
+galician: galician.php
+ @echo "Recoding galician..."
+ @cat galician.php | recode utf-8..xml | ./convert.awk \
+ > ${DESTDIR}/galician.php
+ @chmod 644 galician.php ${DESTDIR}/galician.php
View
18 plugins/PluginExample/lang/convert.awk
@@ -0,0 +1,18 @@
+#!/usr/bin/awk -f
+#
+# Script contains all needed conversions of recoded text
+#
+# Remove everything before first "<?php"
+BEGIN { while (index($0,"&lt;?php")==0) { getline; continue }
+ print "<?php";
+ }
+# Remove everything after first "?>"
+# (as there should be only one occurance, thats no problem)
+/\?\&gt;/ { print "?>"; exit }
+
+ {
+ # Convert CRLF -> LF (== "remove CR" ) ;-)
+ gsub("&#13;","");
+ gsub("&apos;","'");
+ print $0
+ }
View
16 plugins/PluginExample/lang/english.php
@@ -0,0 +1,16 @@
+<?php
+
+ /**
+ * English language file for plugin Example. Use this as a basis
+ * for new translations.
+ *
+ * $Id:
+ */
+
+ //Plugin data
+ $plugin_lang['plugin_name'] = 'Plugin Example';
+
+ //Test
+ $plugin_lang['plugin_toplink'] = 'Example extra toplink';
+
+?>
View
16 plugins/PluginExample/lang/portuguese-br.php
@@ -0,0 +1,16 @@
+<?php
+
+ /**
+ * Brazilian Portuguese language file for plugin Example. Use this as a basis
+ * for new translations.
+ *
+ * $Id:
+ */
+
+ //Plugin data
+ $plugin_lang['plugin_name'] = 'Plugin Exemplo';
+
+ //Test
+ $plugin_lang['plugin_toplink'] = 'Exemplo de toplink extra';
+
+?>
View
16 plugins/PluginExample/lang/recoded/english.php
@@ -0,0 +1,16 @@
+<?php
+
+ /**
+ * English language file for plugin Example. Use this as a basis
+ * for new translations.
+ *
+ * $Id:
+ */
+
+ //Plugin data
+ $plugin_lang['plugin_name'] = 'PluginExample';
+
+ //Test
+ $plugin_lang['plugin_toplink'] = 'Example extra toplink';
+
+?>
View
16 plugins/PluginExample/lang/recoded/portuguese-br.php
@@ -0,0 +1,16 @@
+<?php
+
+ /**
+ * Brazilian Portuguese language file for plugin Example. Use this as a basis
+ * for new translations.
+ *
+ * $Id:
+ */
+
+ //Plugin data
+ $plugin_lang['plugin_name'] = 'Plugin Exemplo';
+
+ //Test
+ $plugin_lang['plugin_toplink'] = 'Exemplo de toplink extra';
+
+?>
View
27 plugins/PluginExample/lang/translations.php
@@ -0,0 +1,27 @@
+<?php
+ /**
+ * Supported Translations for PluginExample
+ *
+ * $Id:
+ */
+
+
+ // List of language files, and encoded language name.
+
+ $pluginLangFiles = array(
+ 'english' => 'English',
+ 'portuguese-br' => 'Portugu&ecirc;s-Brasileiro'
+ );
+
+ // ISO639 language code to language file mapping.
+ // See http://www.w3.org/WAI/ER/IG/ert/iso639.htm for language codes
+
+ // If it's available 'language-country', but not general
+ // 'language' translation (eg. 'portuguese-br', but not 'portuguese')
+ // specify both 'la' => 'language-country' and 'la-co' => 'language-country'.
+
@xzilla
xzilla added a note

According to the above comment, shouldn't you have both a portuguese mapping and portuguese-br mapping? I only see the -br one. It might be that the above comment is wrong, but they don't seem to match.

@asleonardo Owner

Yes, you are right, is missing the 'pt' => 'portuguese-br'.
About the comment. I copy it from the original lang/translations.php, and I forgot to follow what is written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ $availableLanguages = array(
+ 'en' => 'english',
+ 'pt-br' => 'portuguese-br'
+ );
+?>
View
51 plugins/PluginExample/plugin.php
@@ -0,0 +1,51 @@
+<?php
+class PluginExample {
+
+ /**
+ * Attributes
+ */
+ public $plugin_name = 'Plugin example';
+ public $plugin_index = __CLASS__;
+ public $plugin_lang = '';
+
+ /**
+ * Constructor
+ * Register the plugin's functions in hooks of PPA.
+ * @param $plugin_manager - Instance of plugin manager
+ */
+ function __construct($plugin_manager, $language) {
+ $this->manage_transalation($language);
+ $plugin_manager->add_plugin_functions($this->plugin_index, 'toplinks', 'add_plugin_toplinks');
+ /* Register more functions here */
+ }
+
+ /**
+ * Get the $plugin_index
+ * @return $plugin_index
+ */
+ function get_plugin_index() {
+ return $this->plugin_index;
+ }
+
+ /**
+ * Add plugin in the top links
+ * @param $toplinks_operations
+ */
+ function add_plugin_toplinks(&$toplinks_operations) {
+ $toplinks_operations[$this->plugin_index] = "<a class=\"toplink\" href=\"#\">{$this->plugin_lang['plugin_toplink']}</a>";
+ }
+
+ /**
+ * Manage the plugins translations
+ * TODO: to put this function in the PluginManager class
+ */
+ function manage_transalation($language) {
+ require_once("./plugins/{$this->plugin_index}/lang/recoded/english.php");
+ include_once("./plugins/{$this->plugin_index}/lang/translations.php");
+ if (isset($pluginLangFiles[$language])) {
+ include_once("./plugins/{$this->plugin_index}/lang/recoded/{$language}.php");
+ }
+ $this->plugin_lang = $plugin_lang;
+ }
+}
+?>
@xzilla

According to the above comment, shouldn't you have both a portuguese mapping and portuguese-br mapping? I only see the -br one. It might be that the above comment is wrong, but they don't seem to match.

@xzilla

Would it be possible to combine the above into a single config variable.... like $conf['plugins'] = array('PluginExample','Slony');

@asleonardo

Yup, I don't see problem. I will also write an comment with an example. Thanks

@asleonardo

Yes, you are right, is missing the 'pt' => 'portuguese-br'.
About the comment. I copy it from the original lang/translations.php, and I forgot to follow what is written.

@asleonardo

Write a comment that this files is a copy from lang/Makefile. And remove unnecessaries comments and languages that this plugin doesn't have translation.

@asleonardo

The $Id was used by cvs. I can be dropped from here, and the other files.

Please sign in to comment.
Something went wrong with that request. Please try again.