You are here

function lingotek_truncate_grid_text in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.bulk_grid.inc \lingotek_truncate_grid_text()
2 calls to lingotek_truncate_grid_text()
lingotek_bulk_grid_parse_config_data in ./lingotek.config.inc
lingotek_bulk_grid_parse_table_data in ./lingotek.bulk_grid.inc

File

./lingotek.bulk_grid.inc, line 1651

Code

function lingotek_truncate_grid_text($string, $truncate_length) {
  if (strlen($string) > $truncate_length) {
    $dots = '...';
    $dots_length = strlen($dots);
    $string = substr($string, 0, $truncate_length - $dots_length) . $dots;
  }
  return $string;
}