From: p d. t. <pdo...@an...> - 2002-11-22 02:10:04
|
Awesome! I should have known, just use bindtextdomain() every time textdomain() is used. That works great for those of us using SM's gettext. Thanks a lot! > -----Original Message----- > From: squ...@li... > [mailto:squ...@li...] On Behalf Of > Alexandros Vellis > Sent: Thursday, November 21, 2002 5:06 AM > To: p dont think > Cc: squ...@li...; > squ...@li... > Subject: [SM-I18N] Re: [SM-PLUGINS] Problems with bindtextdomain() > > On Wed, 20 Nov 2002 09:52:29 -0800 > "p dont think" <pdo...@an...> wrote: > > [...] > > seems to work great, except for switching back to the squirrelmail > > text domain. > > You can take a look at my avelsieve (SIEVE Mail Filters) plugin. In > setup.php I do the following... Note that the second bindtextdomain() is > necessary if someone uses Squirrelmail's gettext hack. This might > actually be your problem, if you are not using PHP's gettext. > > > /* Function for the options page block */ > > function squirrelmail_plugin_avelsieve_optpage_register_block() { > global $optpage_blocks; > bindtextdomain ('avelsieve', '../plugins/avelsieve/locale'); > textdomain ('avelsieve'); > > $optpage_blocks[] = array( > 'name' => _("Message Filters"), > 'url' => '../plugins/avelsieve/table.php', > 'desc' => _("Server-Side mail filtering enables you to add criteria > in order to automatically forward, delete or place a given message into a fold > er."), > 'js' => false > ); > bindtextdomain ('squirrelmail', '../locale'); /* Needed only to make it > work with Squirrelmail's gettext() hack */ > textdomain('squirrelmail'); > > } > > > /* Function for the top menuline with the text _("Filters") */ > > function squirrelmail_plugin_avelsieve_menuline() { > include('../plugins/avelsieve/config.php'); > if($avelsieveheaderlink) { > /* $cwd = getcwd(); */ > bindtextdomain('avelsieve', > '../plugins/avelsieve/locale'); > > > /* There shouldn't be a need for the following. Unless a plugin > programmer doesn't stay at plugins/ :-) */ > > /* if (strstr($cwd, "avelsieve")) { > print "binding to locale"; > bindtextdomain ('avelsieve', $cwd.'/locale'); > > } elseif (strstr($cwd, "plugins/")) { > print " inside a plugin... binding > to ../avelsieve/locale "; > bindtextdomain ('avelsieve', > '../avelsieve/locale'); > > } elseif ( strstr($cwd, "src") || strstr($cwd, "functions") ) > { > print "binding to ../plugins/avelsieve/locale"; > bindtextdomain ('avelsieve', > '../plugins/avelsieve/locale'); > } > */ > textdomain ('avelsieve'); > > displayInternalLink('plugins/avelsieve/table.php',_("Filters"),'right'); > echo "  \n"; > bindtextdomain('squirrelmail', '../locale'); > textdomain ('squirrelmail'); > } > } > > > HTH! > > -- > Alexandros Vellis University of Athens > av...@no... Network Operations Centre > http://www.noc.uoa.gr/~avel/ > Public Key: http://www.noc.uoa.gr/~avel/gpgkey.asc > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > -- > squirrelmail-i18n mailing list > List Address: squ...@li... > List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-i18n > http://squirrelmail.org/cvs |