Variable with placeholder I am implementing a couple of translatable variables that are exposed via hook_variable_info().

Can I use placeholders in these variables, and process them to replace with the actual values?

As an example: I have a variable that holds the following informational text that will be shown on a page that has a registration form below.


  Please signup here to gain access to the restricted area for @yourcompany


I have been googling around for this, but cannot seem to find any good leads on how to do this (if at all possible?)
The simplest way is using format_string(), you can have 3 kind of replacement token for different sanitisation and formatting.


  @variable: Escaped to HTML using check_plain(). Use this as the default choice for anything displayed on a page on the site.
  
  %variable: Escaped to HTML and formatted using drupal_placeholder(), which makes it display as emphasized text.
  
  !variable: Inserted as is, with no sanitization or formatting. Only use this for text that has already been prepared for HTML display (for example, user-supplied text that has already been run through check_plain() previously, or is expected to contain some limited HTML tags and has already been run through filter_xss() previously).


Example code:

$message = variable_get_value('variable_name');
$message = format_string($message, array('@yourcompany' =&gt; $company_name));