Index: potx.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/Attic/potx.inc,v
retrieving revision 1.1.2.17.2.7.2.19.2.15
diff -u -p -r1.1.2.17.2.7.2.19.2.15 potx.inc
--- potx.inc	25 Jan 2011 09:44:24 -0000	1.1.2.17.2.7.2.19.2.15
+++ potx.inc	25 Jan 2011 14:21:14 -0000
@@ -190,16 +190,18 @@ function _potx_process_file($file_path, 
 
   // Regular t() calls with different usages.
   if ($api_version > POTX_API_6) {
-    // Drupal 7 onwards supports context on t().
+    // Drupal 7 onwards supports context on t() and st().
     _potx_find_t_calls_with_context($file_name, $save_callback);
+    _potx_find_t_calls_with_context($file_name, $save_callback, '$t', POTX_STRING_BOTH);
+    _potx_find_t_calls_with_context($file_name, $save_callback, 'st', POTX_STRING_INSTALLER);
   }
   else {
     _potx_find_t_calls($file_name, $save_callback);
+    _potx_find_t_calls($file_name, $save_callback, '$t', POTX_STRING_BOTH);
+    _potx_find_t_calls($file_name, $save_callback, 'st', POTX_STRING_INSTALLER);
   }
-  // These do not support context even in Drupal 7.
+  // This does not support context even in Drupal 7.
   _potx_find_t_calls($file_name, $save_callback, '_locale_import_message', POTX_STRING_BOTH);
-  _potx_find_t_calls($file_name, $save_callback, '$t', POTX_STRING_BOTH);
-  _potx_find_t_calls($file_name, $save_callback, 'st', POTX_STRING_INSTALLER);
 
   if ($api_version > POTX_API_5) {
     // Watchdog calls have both of their arguments translated from Drupal 6.x.
@@ -760,7 +762,8 @@ function _potx_find_t_calls($file, $save
  *   Callback function used to save strings.
  * @param function_name
  *   The name of the function to look for (could be 't', '$t', 'st'
- *   or any other t-like function). Drupal 7 only supports context on t().
+ *   or any other t-like function). Drupal 7 only supports context on t(), st()
+ *   and $t().
  * @param $string_mode
  *   String mode to use: POTX_STRING_INSTALLER, POTX_STRING_RUNTIME or
  *   POTX_STRING_BOTH.
Index: tests/potx.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/tests/Attic/potx.test,v
retrieving revision 1.1.4.7
diff -u -p -r1.1.4.7 potx.test
--- tests/potx.test	25 Jan 2011 09:44:24 -0000	1.1.4.7
+++ tests/potx.test	25 Jan 2011 14:21:14 -0000
@@ -49,10 +49,13 @@ class PotxTestCase extends DrupalWebTest
     // Installer string should not appear in runtime output.
     $this->assertNoMsgID('Installer only test string');
     $this->assertMsgID('Dynamic callback test string');
+    $this->assertNoMsgID('Installer string in context');
 
     // No context support yet.
     $this->assertNoMsgIDContext('Test string in context', 'Test context');
     $this->assertMsgID('Test string in context');
+    $this->assertNoMsgIDContext('Dynamic string in context', 'Dynamic context');
+    $this->assertMsgID('Dynamic string in context');
 
     // Look at installer strings.
     $this->parseFile($filename, POTX_API_5, POTX_STRING_INSTALLER);
@@ -60,6 +63,10 @@ class PotxTestCase extends DrupalWebTest
     $this->assertMsgID('Dynamic callback test string');
     $this->assertNoMsgID('1 test string');
     $this->assertNoMsgID('This is a test string.');
+    $this->assertNoMsgIDContext('Installer string in context', 'Installer context');
+    $this->assertMsgID('Installer string in context');
+    $this->assertNoMsgIDContext('Dynamic string in context', 'Dynamic context');
+    $this->assertMsgID('Dynamic string in context');
 
     $this->assert(count($this->potx_status) == 3, t('3 error messages found'));
     $this->assert($this->potx_status[0][0] == $this->empty_error, t('First empty error found.'));
@@ -93,10 +100,13 @@ class PotxTestCase extends DrupalWebTest
     // Installer string should not appear in runtime output.
     $this->assertNoMsgID('Installer only test string');
     $this->assertMsgID('Dynamic callback test string');
+    $this->assertNoMsgID('Installer string in context');
 
     // No context support yet.
     $this->assertNoMsgIDContext('Test string in context', 'Test context');
     $this->assertMsgID('Test string in context');
+    $this->assertNoMsgIDContext('Dynamic string in context', 'Dynamic context');
+    $this->assertMsgID('Dynamic string in context');
 
     // Look at installer strings.
     $this->parseFile($filename, POTX_API_6, POTX_STRING_INSTALLER);
@@ -104,6 +114,10 @@ class PotxTestCase extends DrupalWebTest
     $this->assertMsgID('Dynamic callback test string');
     $this->assertNoMsgID('1 test string');
     $this->assertNoMsgID('This is a test string.');
+    $this->assertNoMsgIDContext('Installer string in context', 'Installer context');
+    $this->assertMsgID('Installer string in context');
+    $this->assertNoMsgIDContext('Dynamic string in context', 'Dynamic context');
+    $this->assertMsgID('Dynamic string in context');
 
     $this->assert(count($this->potx_status) == 3, t('3 error messages found'));
     $this->assert($this->potx_status[0][0] == $this->empty_error, t('First empty error found.'));
@@ -144,6 +158,8 @@ class PotxTestCase extends DrupalWebTest
 
     $this->assertNoMsgID('Installer only test string');
     $this->assertMsgID('Dynamic callback test string');
+    $this->assertNoMsgIDContext('Installer string in context', 'Installer context');
+    $this->assertMsgIDContext('Dynamic string in context', 'Dynamic context');
 
     // Context support added.
     $this->assertMsgIDContext('Test string in context', 'Test context');
@@ -154,6 +170,8 @@ class PotxTestCase extends DrupalWebTest
     $this->assertMsgID('Dynamic callback test string');
     $this->assertNoMsgID('1 test string');
     $this->assertNoMsgID('This is a test string.');
+    $this->assertMsgIDContext('Installer string in context', 'Installer context');
+    $this->assertMsgIDContext('Dynamic string in context', 'Dynamic context');
 
     $this->assert(count($this->potx_status) == 2, t('2 error messages found'));
     $this->assert($this->potx_status[0][0] == $this->empty_error, t('First empty error found.'));
Index: tests/potx_test_5.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/tests/Attic/potx_test_5.module,v
retrieving revision 1.1.4.3
diff -u -p -r1.1.4.3 potx_test_5.module
--- tests/potx_test_5.module	17 Nov 2009 12:35:09 -0000	1.1.4.3
+++ tests/potx_test_5.module	25 Jan 2011 14:21:14 -0000
@@ -34,9 +34,12 @@ function potx_test_5_page() {
 
   st('Installer only test string');
   $t('Dynamic callback test string');
-  
+
   t('Test string in context', array(), array('context' => 'Test context'));
   t('');
+
+  st('Installer string in context', array(), array('context' => 'Installer context'));
+  $t('Dynamic string in context', array(), array('context' => 'Dynamic context'));
 }
 
 function potx_test_5_perm() {
Index: tests/potx_test_6.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/tests/Attic/potx_test_6.module,v
retrieving revision 1.1.4.4
diff -u -p -r1.1.4.4 potx_test_6.module
--- tests/potx_test_6.module	25 Jan 2011 09:44:24 -0000	1.1.4.4
+++ tests/potx_test_6.module	25 Jan 2011 14:21:14 -0000
@@ -44,9 +44,12 @@ function potx_test_6_page() {
 
   st('Installer only test string');
   $t('Dynamic callback test string');
-  
+
   t('Test string in context', array(), array('context' => 'Test context'));
   t('');
+
+  st('Installer string in context', array(), array('context' => 'Installer context'));
+  $t('Dynamic string in context', array(), array('context' => 'Dynamic context'));
 }
 
 function potx_test_6_perm() {
Index: tests/potx_test_7.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/potx/tests/Attic/potx_test_7.module,v
retrieving revision 1.1.4.4
diff -u -p -r1.1.4.4 potx_test_7.module
--- tests/potx_test_7.module	25 Jan 2011 09:44:24 -0000	1.1.4.4
+++ tests/potx_test_7.module	25 Jan 2011 14:21:14 -0000
@@ -44,9 +44,12 @@ function potx_test_7_page() {
 
   st('Installer only test string');
   $t('Dynamic callback test string');
-  
+
   t('Test string in context', array(), array('context' => 'Test context'));
   t('');
+
+  st('Installer string in context', array(), array('context' => 'Installer context'));
+  $t('Dynamic string in context', array(), array('context' => 'Dynamic context'));
 }
 
 function potx_test_7_perm() {
