Home > Chamilo, Development, English, Tech Crunch > Debug: Howto show variables used in Chamilo 1.8.7 translations

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 http://translate.chamilo.org, click on “Advanced search” and change the translation to the right one.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: