Skip to content

Commit

Permalink
Add a setting to use labels from the json display templates instead o…
Browse files Browse the repository at this point in the history
…f language files
  • Loading branch information
mah0001 committed Aug 27, 2024
1 parent bffda95 commit eda44fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
//List of supported languages. type language name in lower case
$config['supported_languages']=array();//array("english","french","arabic","russian","spanish","mongolian");


/**
* Use template translations
*/
$config['use_template_translation']=false;

/*
|--------------------------------------------------------------------------
| Allowed IP addresses to access site administration
Expand Down
7 changes: 7 additions & 0 deletions application/helpers/MY_language_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ function t($line, $id = '')
function tt($line,$default=null)
{
$CI =& get_instance();
$use_template_translation = $CI->config->item('use_template_translation');

//use template translation [default value]
if ($use_template_translation==true && $default!=null){
$line = $default;
}

$str = $CI->lang->line($line);

if ($str=='')
Expand Down

0 comments on commit eda44fd

Please sign in to comment.