Debug: Howto show variables used in Chamilo 1.8.7 translations

As a developer or translator for Chamilo 1.8.*, you might often be faced with the need to know what variable is used to look for a translated term to be shown on screen. While we don’t have a nice in-house feature for this just yet, you can easily hack your own. Here’s how:

  • Go to main/inc/lib/internationalization.lib.php
  • Find the function get_lang
  • Find the first and the third “return” statements
  • Put the whole value (after the equal sign) between parenthesis and prefix them with: $variable.’-‘. (this should give something like  return $cache[$language][$variable] = $variable.’-‘.($_api_is_translated ? ($is_utf8_encoding ? $langvar : api_utf8_decode($langvar, $encoding)) : $langvar); )

From then, you should see all the variables show before the translated term. You can then go on, click on “Advanced search” and change the translation to the right one.

Related Posts

Why is the Chamilo package so big?

In recent years, the Chamilo LMS software we develop has grown in size,...

Important meetings

Sometimes I like to treat this blog as a personal one and write...

Quick Contact Form