Changeset 768


Ignore:
Timestamp:
01/20/13 01:44:11 (23 months ago)
Author:
ofer
Message:

Added the transposh_echo function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/transposh.php

    r767 r768  
    147147        if ($this->options->debug_enable) 
    148148                tp_logger(preg_replace('|^' . preg_quote(WP_PLUGIN_DIR, '|') . '/|', '', __FILE__), 4); // includes transposh dir and php 
    149              
     149 
    150150// TODO: get_class_methods to replace said mess, other way? 
    151151        add_filter('plugin_action_links_' . preg_replace('|^' . preg_quote(WP_PLUGIN_DIR, '|') . '/|', '', __FILE__), array(&$this, 'plugin_action_links')); 
     
    15291529 
    15301530/** 
     1531 * Function for use in themes to allow different outputs 
     1532 * @param string $default - the default text in the default language 
     1533 * @param array $altarray - array including alternatives in the format ("es" => "hola") 
     1534 */ 
     1535function transposh_echo($default, $altarray) { 
     1536    if (isset($altarray[transposh_get_current_language()])) { 
     1537        echo TP_GTXT_BRK . $altarray[transposh_get_current_language()] . TP_GTXT_BRK_CLOSER; 
     1538    } else { 
     1539        echo $default; 
     1540    } 
     1541} 
     1542 
     1543/** 
    15311544 * This function provides easier access to logging using the singleton object 
    15321545 * @param mixed $msg 
Note: See TracChangeset for help on using the changeset viewer.