Motivation

A few messages retrieved with variable_get() are not wrapped in t() and thus do not show up in the translation interface.

For instance:

variable_get('google_appliance_errorcode_1', 'No results were found that matched your criteria.');

cannot be translated unless we wrap it with t():

t(variable_get('google_appliance_errorcode_1', 'No results were found that matched your criteria.'));

As a consequence we cannot translate them.

Proposed resolution

Wrapping such strings in t() would fix the problem. Attached is a suggested patch, any review is welcome.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fengtan’s picture

iamEAP’s picture

Status: Needs review » Needs work
+++ b/google_appliance.moduleundefined
@@ -897,7 +897,7 @@ function _google_appliance_search_initialise(&$gm, $client = NULL, $collection =
+    if ($message = t(variable_get('google_appliance_errorcode_'. $code, ''))) {

You should never pass dynamic values through the t() function.

Here's a slightly old blog post about how to properly translate variables: http://hojtsy.hu/blog/2011-feb-25/drupal-7039s-new-multilingual-systems-...