--- countries_api\countries_api.module	2008-01-24 12:32:31.328125000 -0500
+++ countries_api.module	2008-02-02 10:40:50.703125000 -0500
@@ -4,357 +4,14 @@
 /**
  * Implementation of hook_help()
  */
-function countries_api_help($__section = '')
-{
+function countries_api_help($section) {
   $_content = '';
-
-  // license path
-  $_license = drupal_get_path('module', 'countries_api') . '/LICENSE.txt';
-
   // switch over section
-  switch($__section) {
-
+  switch ($section) {
     // module
     case 'admin/help#countries_api':
-
-      $_content = <<<HELP
-<p>
-  Provides an API for official ISO 3166 country codes and names.
-  <br />
-  Please visit the Maintenance agency website on
-  <a href="http://www.iso.org/iso/country_codes/"
-    target="_blank">http://www.iso.org/iso/country_codes/</a>
-  for more information about ISO 3166.
-</p>
-<h3 style="border-bottom:solid 1px #ABABAB;">
-  <br />
-  <b>Global operations</b>
-</h3>
-<blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_get_list()</b> : array
-  </h4>
-  <blockquote>
-    <p>
-      This function returns the full list of official ISO country codes and
-      names.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      None
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      An indexed array containing the list of each official ISO country codes
-      and name as associative arrays, using the following keys:
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            name
-            <br/>
-            <i>Returns the country short name.</i>
-          </li>
-          <li>
-            iso2
-            <br/>
-            <i>Returns the country ISO 3166-1-alpha-2 code.</i>
-          </li>
-          <li>
-            iso3
-            <br/>
-            <i>Returns the country ISO 3166-1-alpha-3 code.</i>
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-  </blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_get_name(\$code)</b> : string
-  </h4>
-  <blockquote>
-    <p>
-      This function gets either an ISO 3166-1-alpha-2 or ISO 3166-1-alpha-3
-      code in parameter and returns the corresponding country short name.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            \$code
-            <br/>
-            <i>An ISO 3166-1-alpha-2 or ISO 3166-1-alpha-3 code as a</i>
-            string.
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      The corresponding country short name as a <i>string</i>.
-      <br />
-      In case the country code doesn't match any country, <i>null</i> is
-      returned.
-    </p>
-  </blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_get_country(\$code)</b> : array
-  </h4>
-  <blockquote>
-    <p>
-      This function gets either an ISO 3166-1-alpha-2 or ISO 3166-1-alpha-3
-      code in parameter and returns an array representing the corresponding
-      country.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            \$code
-            <br/>
-            <i>An ISO 3166-1-alpha-2 or ISO 3166-1-alpha-3 code as a</i>
-            string.
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      An associative <i>array</i>, using the keys as described in
-      <i>countries_api_get_list()</i>.
-      <br />
-      In case the country code doesn't match any country, <i>null</i> is
-      returned.
-    </p>
-  </blockquote>
-</blockquote>
-<h3 style="border-bottom:solid 1px #ABABAB;">
-  <br />
-  <b>ISO 3166-1-alpha-2 code operations</b>
-</h3>
-<blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_iso2_get_name(\$code)</b> : string
-  </h4>
-  <blockquote>
-    <p>
-      This function gets an ISO 3166-1-alpha-2 code in parameter and returns
-      the corresponding country short name.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            \$code
-            <br/>
-            <i>An ISO 3166-1-alpha-2 code as a</i> string.
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      The corresponding country short name as a <i>string</i>.
-      <br />
-      In case the country code doesn't match any country, <i>null</i> is
-      returned.
-    </p>
-  </blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_iso2_get_iso3(\$code)</b> : string
-  </h4>
-  <blockquote>
-    <p>
-      This function gets an ISO 3166-1-alpha-2 code in parameter and returns
-      the corresponding ISO 3166-1-alpha-3 code.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            \$code
-            <br/>
-            <i>An ISO 3166-1-alpha-2 code as a</i> string.
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      The corresponding ISO 3166-1-alpha-3 code as a <i>string</i>.
-      <br />
-      In case the country code doesn't match any country, <i>null</i> is
-      returned.
-    </p>
-  </blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_iso2_get_country(\$code)</b> : array
-  </h4>
-  <blockquote>
-    <p>
-      This function gets an ISO 3166-1-alpha-2 code in parameter and returns an
-      array representing the corresponding country.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            \$code
-            <br/>
-            <i>An ISO 3166-1-alpha-2 code as a</i> string.
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      An associative <i>array</i>, using the keys as described in
-      <i>countries_api_get_list()</i>.
-      <br />
-      In case the country code doesn't match any country, <i>null</i> is
-      returned.
-    </p>
-  </blockquote>
-</blockquote>
-<h3 style="border-bottom:solid 1px #ABABAB;">
-  <br />
-  <b>ISO 3166-1-alpha-3 code operations</b>
-</h3>
-<blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_iso3_get_name(\$code)</b> : string
-  </h4>
-  <blockquote>
-    <p>
-      This function gets an ISO 3166-1-alpha-3 code in parameter and returns
-      the corresponding country short name.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            \$code
-            <br/>
-            <i>An ISO 3166-1-alpha-3 code as a</i> string.
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      The corresponding country short name as a <i>string</i>.
-      <br />
-      In case the country code doesn't match any country, <i>null</i> is
-      returned.
-    </p>
-  </blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_iso3_get_iso2(\$code)</b> : string
-  </h4>
-  <blockquote>
-    <p>
-      This function gets an ISO 3166-1-alpha-3 code in parameter and returns
-      the corresponding ISO 3166-1-alpha-2 code.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            \$code
-            <br/>
-            <i>An ISO 3166-1-alpha-3 code as a</i> string.
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      The corresponding ISO 3166-1-alpha-2 code as a <i>string</i>.
-      <br />
-      In case the country code doesn't match any country, <i>null</i> is
-      returned.
-    </p>
-  </blockquote>
-  <h4>
-    <br />
-    function <b>countries_api_iso3_get_country(\$code)</b> : array
-  </h4>
-  <blockquote>
-    <p>
-      This function gets an ISO 3166-1-alpha-3 code in parameter and returns an
-      array representing the corresponding country.
-    </p>
-    <p>
-      <i>Parameter(s):</i>
-      <br />
-      <blockquote>
-        <ul>
-          <li>
-            \$code
-            <br/>
-            <i>An ISO 3166-1-alpha-3 code as a</i> string.
-          </li>
-        </ul>
-      </blockquote>
-    </p>
-    <p>
-      <i>Returns:</i>
-      <br />
-      An associative <i>array</i>, using the keys as described in
-      <i>countries_api_get_list()</i>.
-      <br />
-      In case the country code doesn't match any country, <i>null</i> is
-      returned.
-    </p>
-  </blockquote>
-</blockquote>
-<h3 style="border-bottom:solid 1px #ABABAB;">
-  <br />
-  <b>License</b>
-</h3>
-<blockquote>
-  <br />
-  <p>
-    This module is licensed under the terms of the
-    <a href="$_license"
-      target="_blank">GNU General Public License version 2</a>.
-    <br />
-    This module was created by horsconcept, Alexandre Kraft
-    &lt;ak@horsconcept.ch&gt;.
-  </p>
-</blockquote>
-HELP;
+      $_content .= '<p>'. t('Provides an API for official ISO 3166 country codes and names. Please see the <a href="!url" target="_blank">Drupal documentation</a> for more information about this module.', array('!url' => 'http://drupal.org/node/217070')) .'</p>';
+      $_content .= '<p>'. t('This module is licensed under the terms of the GNU General Public License version 2.') .'</p>';
       break;
   }
 
@@ -362,15 +19,16 @@ HELP;
 }
 
 /**
- * ISO 3166-1-alpha-#n code to country API function
+ * ISO 3166-1-alpha-#n code to country API function.
  */
-function countries_api_get_country($code)
-{
-  if(strlen(trim($code)) == 2) {
+function countries_api_get_country($code) {
+  if (strlen(trim($code)) == 2) {
     return countries_api_iso2_get_country($code);
-  } elseif(strlen(trim($code)) == 3) {
+  }
+  elseif (strlen(trim($code)) == 3) {
     return countries_api_iso3_get_country($code);
-  } else {
+  }
+  else {
     return null;
   }
 }
@@ -378,29 +36,28 @@ function countries_api_get_country($code
 /**
  * ISO 3166-1-alpha-2 code to country API function
  */
-function countries_api_iso2_get_country($code)
-{
+function countries_api_iso2_get_country($code) {
   return _countries_api_iso_get_country($code, 'iso2');
 }
 
 /**
  * ISO 3166-1-alpha-3 code to country API function
  */
-function countries_api_iso3_get_country($code)
-{
+function countries_api_iso3_get_country($code) {
   return _countries_api_iso_get_country($code, 'iso3');
 }
 
 /**
  * ISO 3166-1-alpha-#n code to country name API function
  */
-function countries_api_get_name($code)
-{
-  if(strlen(trim($code)) == 2) {
+function countries_api_get_name($code) {
+  if (strlen(trim($code)) == 2) {
     return countries_api_iso2_get_name($code);
-  } elseif(strlen(trim($code)) == 3) {
+  }
+  elseif (strlen(trim($code)) == 3) {
     return countries_api_iso3_get_name($code);
-  } else {
+  }
+  else {
     return null;
   }
 }
@@ -408,11 +65,10 @@ function countries_api_get_name($code)
 /**
  * ISO 3166-1-alpha-2 code to country name API function
  */
-function countries_api_iso2_get_name($code)
-{
+function countries_api_iso2_get_name($code) {
   $_country = countries_api_iso2_get_country($code);
 
-  if(!is_null($_country)) {
+  if (!is_null($_country)) {
     return $_country['name'];
   }
 
@@ -422,11 +78,10 @@ function countries_api_iso2_get_name($co
 /**
  * ISO 3166-1-alpha-3 code to country name API function
  */
-function countries_api_iso3_get_name($code)
-{
+function countries_api_iso3_get_name($code) {
   $_country = countries_api_iso3_get_country($code);
 
-  if(!is_null($_country)) {
+  if (!is_null($_country)) {
     return $_country['name'];
   }
 
@@ -436,11 +91,10 @@ function countries_api_iso3_get_name($co
 /**
  * ISO 3166-1-alpha-2 code to ISO 3166-1-alpha-3 code API function
  */
-function countries_api_iso2_get_iso3($code)
-{
+function countries_api_iso2_get_iso3($code) {
   $_country = countries_api_iso2_get_country($code);
 
-  if(!is_null($_country)) {
+  if (!is_null($_country)) {
     return $_country['iso3'];
   }
 
@@ -450,11 +104,10 @@ function countries_api_iso2_get_iso3($co
 /**
  * ISO 3166-1-alpha-3 code to ISO 3166-1-alpha-2 code API function
  */
-function countries_api_iso3_get_iso2($code)
-{
+function countries_api_iso3_get_iso2($code) {
   $_country = countries_api_iso3_get_country($code);
 
-  if(!is_null($_country)) {
+  if (!is_null($_country)) {
     return $_country['iso2'];
   }
 
@@ -464,13 +117,12 @@ function countries_api_iso3_get_iso2($co
 /**
  * Internal ISO 3166-1-alpha-#n code to country helper
  */
-function _countries_api_iso_get_country($__code, $__alpha)
-{
+function _countries_api_iso_get_country($__code, $__alpha) {
   $_list = countries_api_get_list();
   $_code = strtoupper(trim(check_plain($__code)));
 
-  foreach($_list as $_country) {
-    if($_country[$__alpha] == $_code) {
+  foreach ($_list as $_country) {
+    if ($_country[$__alpha] == $_code) {
       return $_country;
     }
   }
@@ -501,8 +153,7 @@ function countries_api_select($code = 'i
 /**
  * Countries list API function
  */
-function countries_api_get_list()
-{
+function countries_api_get_list() {
   $_countries = array(
 
     // a
