Index: trunk/psLib/src/astro/psTime.c
===================================================================
--- trunk/psLib/src/astro/psTime.c	(revision 7961)
+++ trunk/psLib/src/astro/psTime.c	(revision 8232)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.92 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-07-25 01:16:04 $
+ *  @version $Revision: 1.93 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-08-08 23:32:22 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -33,5 +33,5 @@
 #include "psLookupTable.h"
 #include "psAssert.h"
-#include "psErrorText.h"
+
 
 #include "config.h"
@@ -205,5 +205,5 @@
         // Check if table not a metadata item
         if(tableMetadataItem == NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                     tableName);
             *status = PS_LOOKUP_ERROR;
@@ -282,5 +282,5 @@
     if(metadataItem == NULL) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                 "psLib.time.tables.n");
         return false;
@@ -292,5 +292,5 @@
     if(metadataItem == NULL) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                 "psLib.time.tables.from");
         return false;
@@ -299,5 +299,5 @@
     if(tablesFrom->n != numTables) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_BAD_VECTOR, tablesFrom->n, numTables);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Incorrect vector size. Size: %d, Expected %d."), tablesFrom->n, numTables);
         psFree(tablesFrom);
         return false;
@@ -308,5 +308,5 @@
     if(metadataItem == NULL) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                 "psLib.time.tables.to");
         psFree(tablesFrom);
@@ -316,5 +316,5 @@
     if(tablesTo->n != numTables) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_BAD_VECTOR, tablesTo->n, numTables);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Incorrect vector size. Size: %d, Expected %d."), tablesTo->n, numTables);
         psFree(tablesFrom);
         psFree(tablesTo);
@@ -326,5 +326,5 @@
     if(metadataItem == NULL) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE,true,PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+        psError(PS_ERR_BAD_PARAMETER_VALUE,true,_("Failed find '%s' in time metadata."),
                 "psLib.time.tables.index");
         psFree(tablesFrom);
@@ -335,5 +335,5 @@
     if(tablesIndex->n != numTables) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE,true,PS_ERRORTEXT_psTime_BAD_VECTOR,tablesIndex->n,numTables);
+        psError(PS_ERR_BAD_PARAMETER_VALUE,true,_("Incorrect vector size. Size: %d, Expected %d."),tablesIndex->n,numTables);
         psFree(tablesFrom);
         psFree(tablesTo);
@@ -346,5 +346,5 @@
     if(metadataItem == NULL) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                 "psLib.time.tables.dir");
         psFree(tablesFrom);
@@ -359,5 +359,5 @@
     if(metadataItem == NULL) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                 "psLib.time.tables.files");
 
@@ -374,5 +374,5 @@
     if(metadataItem == NULL) {
         p_psMemAllocatePersistent(initialPersistence);
-        psError(PS_ERR_BAD_PARAMETER_VALUE,true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+        psError(PS_ERR_BAD_PARAMETER_VALUE,true, _("Failed find '%s' in time metadata."),
                 "psLib.time.tables.format");
         psFree(tablesFrom);
@@ -404,5 +404,5 @@
         tableFormat = getToken(&formatPtr,",",&status);
         if(tableFormat == NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE,no_problem,PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+            psError(PS_ERR_BAD_PARAMETER_VALUE,no_problem,_("Failed find '%s' in time metadata."),
                     "psLib.time.tables.format");
             no_problem = false;
@@ -415,5 +415,5 @@
         } else {
             psError(PS_ERR_BAD_PARAMETER_VALUE, no_problem,
-                    PS_ERRORTEXT_psTime_BAD_TABLE_COUNT, i+1, numTables);
+                    _("Incorrect number of table files entered. Found: %d. Expected: %d."), i+1, numTables);
             no_problem = false;
         }
@@ -429,5 +429,5 @@
             } else if(foundTable==false && j==numTables-1) {
                 psError(PS_ERR_BAD_PARAMETER_VALUE, no_problem,
-                        PS_ERRORTEXT_psTime_BAD_TABLE_COUNT, j, numTables);
+                        _("Incorrect number of table files entered. Found: %d. Expected: %d."), j, numTables);
                 no_problem = false;
             }
@@ -444,5 +444,5 @@
 
     if(numTables != i) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, no_problem, PS_ERRORTEXT_psTime_BAD_TABLE_COUNT, i, numTables);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, no_problem, _("Incorrect number of table files entered. Found: %d. Expected: %d."), i, numTables);
     }
 
@@ -480,5 +480,5 @@
             type!=PS_TIME_TT) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                PS_ERRORTEXT_psTime_TYPE_UNKNOWN,
+                _("Specified type, %d, is not supported."),
                 type);
         return NULL;
@@ -521,5 +521,5 @@
     if (gettimeofday(&now, 0) == -1) {
         psError(PS_ERR_OS_CALL_FAILED, true,
-                PS_ERRORTEXT_psTime_GET_TOD_FAILED);
+                _("Failed to determine the current time from gettimeofday function."));
         return NULL;
     }
@@ -728,5 +728,5 @@
             // Convert from TAI to unknown time type
         } else {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_TYPE_UNKNOWN, type);
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified type, %d, is not supported."), type);
             return NULL;
         }
@@ -753,5 +753,5 @@
             // Convert from TT to unknown time type
         } else {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_TYPE_UNKNOWN, type);
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified type, %d, is not supported."), type);
             return NULL;
         }
@@ -772,10 +772,10 @@
             // Convert UTC to unknown time type
         } else {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_TYPE_UNKNOWN, type);
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified type, %d, is not supported."), type);
             return NULL;
         }
         // Convert unknown time type
     } else {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_TYPE_UNKNOWN, time->type);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified type, %d, is not supported."), time->type);
         return NULL;
     }
@@ -810,5 +810,5 @@
     // Verify input time is not in UT1 seconds
     if(time->type == PS_TIME_UT1) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE,true,PS_ERRORTEXT_psTime_TYPE_INCORRECT,time->type);
+        psError(PS_ERR_BAD_PARAMETER_VALUE,true,_("Specified type, %d, is incorrect."),time->type);
         return NAN;
     }
@@ -897,10 +897,10 @@
 
         // Date too early for tables. Get default time delta value from metadata, and issue warning.
-        psLogMsg(__func__,PS_LOG_WARN,PS_ERRORTEXT_psTime_TIME_PREDATES_TABLES,mjd,"UT1-UTC");
+        psLogMsg(__func__,PS_LOG_WARN,_("Specified psTime predates (%g) all tables of %s information."),mjd,"UT1-UTC");
 
         // Lookup value from time metadata loaded from pslib.config
         tableMetadataItem = psMetadataLookup(timeMetadata, "psLib.time.before.dut");
         if(tableMetadataItem == NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                     "psLib.time.before.dut");
             return NAN;
@@ -917,10 +917,10 @@
         */
         // Generate warning of postdate information
-        psLogMsg(__func__,PS_LOG_WARN,PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLES, mjd, "UT1-UTC");
+        psLogMsg(__func__,PS_LOG_WARN,_("Specified psTime postdates (%g) all tables of %s information."), mjd, "UT1-UTC");
 
         // Lookup values to calculate prediction
         tableMetadataItem = psMetadataLookup(timeMetadata, "psLib.time.predict.dut");
         if(tableMetadataItem == NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                     "psLib.time.predict.dut");
             return NAN;
@@ -935,5 +935,5 @@
 
     } else if(status != PS_LOOKUP_SUCCESS) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_INTERPOLATION_FAILED);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed time table interpolation."));
         return NAN;
     }
@@ -1059,5 +1059,5 @@
 
     if(time->type != PS_TIME_TAI) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_TYPE_INCORRECT, time->type);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified type, %d, is incorrect."), time->type);
         return NULL;
     }
@@ -1075,9 +1075,9 @@
         // Date too earlier for tables. Get default polar coodinate values from metadata, and issue warning.
         #if 0
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_TIME_PREDATES_TABLES, mjd, "polar motion");
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified psTime predates (%g) all tables of %s information."), mjd, "polar motion");
         return NULL;
         #else
 
-        psLogMsg(PS_FILE_LINE, PS_LOG_ERROR, PS_ERRORTEXT_psTime_TIME_PREDATES_TABLES, mjd, "polar motion");
+        psLogMsg(PS_FILE_LINE, PS_LOG_ERROR, _("Specified psTime predates (%g) all tables of %s information."), mjd, "polar motion");
         #endif
 
@@ -1085,5 +1085,5 @@
         if(tableMetadataItem == NULL) {
             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                    PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED, "psLib.time.before.xp");
+                    _("Failed find '%s' in time metadata."), "psLib.time.before.xp");
             return NULL;
         }
@@ -1092,5 +1092,5 @@
         tableMetadataItem = psMetadataLookup(timeMetadata, "psLib.time.before.yp");
         if(tableMetadataItem == NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED, "psLib.time.before.yp");
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."), "psLib.time.before.yp");
             return NULL;
         }
@@ -1110,10 +1110,10 @@
         #if 0
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLES, mjd, "polar motion");
+                _("Specified psTime postdates (%g) all tables of %s information."), mjd, "polar motion");
         return NULL;
         #else
 
         psLogMsg(PS_FILE_LINE, PS_LOG_ERROR,
-                 PS_ERRORTEXT_psTime_TIME_POSTDATES_TABLES, mjd, "polar motion");
+                 _("Specified psTime postdates (%g) all tables of %s information."), mjd, "polar motion");
         #endif
 
@@ -1121,5 +1121,5 @@
         tableMetadataItem = psMetadataLookup(timeMetadata, "psLib.time.predict.mjd");
         if(tableMetadataItem == NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED,
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."),
                     "psLib.time.predict.mjd");
             return NULL;
@@ -1130,5 +1130,5 @@
         tableMetadataItem = psMetadataLookup(timeMetadata, "psLib.time.predict.xp");
         if(tableMetadataItem == NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED, "psLib.time.predict.xp");
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."), "psLib.time.predict.xp");
             return NULL;
         }
@@ -1139,5 +1139,5 @@
         tableMetadataItem = psMetadataLookup(timeMetadata, "psLib.time.predict.yp");
         if(tableMetadataItem == NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED, "psLib.time.predict.yp");
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."), "psLib.time.predict.yp");
             return NULL;
         }
@@ -1163,5 +1163,5 @@
 
     } else if(xStatus!=PS_LOOKUP_SUCCESS || yStatus!=PS_LOOKUP_SUCCESS) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_INTERPOLATION_FAILED);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed time table interpolation."));
         return NULL;
     }
@@ -1193,5 +1193,5 @@
     // Check if psTime tables are loaded/loadable
     if(!p_psTimeInit(p_psGetConfigFileName())) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND,
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed to open file %s."),
                 p_psGetConfigFileName());
         return NAN;
@@ -1201,5 +1201,5 @@
     tableMetadataItem = psMetadataLookup(timeMetadata, "taiTable");
     if(tableMetadataItem == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_LOOKUP_METADATA_FAILED, "taiTable");
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed find '%s' in time metadata."), "taiTable");
         return NAN;
     }
@@ -1228,5 +1228,5 @@
     // Check for successful interpolation
     if(results == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_INTERPOLATION_FAILED);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Failed time table interpolation."));
         return NAN;
     }
@@ -1273,5 +1273,5 @@
     // Verify time is UTC type
     if(utc->type != PS_TIME_UTC) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE,true,PS_ERRORTEXT_psTime_TYPE_INCORRECT,utc->type);
+        psError(PS_ERR_BAD_PARAMETER_VALUE,true,_("Specified type, %d, is incorrect."),utc->type);
         return false;
     }
@@ -1371,5 +1371,5 @@
     // Converts psTime to YYYY-MM-DDThh:mm:ss.sss in string form
     if (!strftime(tempString, MAX_TIME_STRING_LENGTH, "%Y-%m-%dT%H:%M:%S", tmTime)) {
-        psError(PS_ERR_OS_CALL_FAILED, true, PS_ERRORTEXT_psTime_CONVERT_TIME_TO_STRING_FAILED);
+        psError(PS_ERR_OS_CALL_FAILED, true, _("Failed to convert a time via strftime function."));
         return NULL;
     }
@@ -1385,5 +1385,5 @@
     // Create string with milliseconds
     if (snprintf(timeString, MAX_TIME_STRING_LENGTH, "%s.%1dZ", tempString, ds) < 0) {
-        psError(PS_ERR_OS_CALL_FAILED, true, PS_ERRORTEXT_psTime_APPEND_MSEC_FAILED);
+        psError(PS_ERR_OS_CALL_FAILED, true, _("Failed to append millisecond to time string with snprintf function."));
         return NULL;
     }
@@ -1501,5 +1501,5 @@
     if (sscanf(input, "%d-%d-%dT%d:%d:%d.%d", &tmTime.tm_year, &tmTime.tm_mon, &tmTime.tm_mday,
                &tmTime.tm_hour, &tmTime.tm_min, &tmTime.tm_sec,&millisecond) < 7) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_ISOTIME_MALFORMED, input);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified ISO Time string, '%s', is malformed.  Must be in 'YYYY-MM-DDThh:mm:ss.sss' format."), input);
         return NULL;
     }
@@ -1760,5 +1760,5 @@
     // Verify both times of the same type
     if(time1->type != time2->type) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE,true,PS_ERRORTEXT_psTime_TYPE_INCORRECT,time1->type);
+        psError(PS_ERR_BAD_PARAMETER_VALUE,true,_("Specified type, %d, is incorrect."),time1->type);
         return NAN;
     }
