From 531cffdc7f44ec3823ff51e05c6e01ab8f717195 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 4 Jun 2009 23:13:17 -0400 Subject: [PATCH] I18N - L10N - Localized first strings in Context. --- i18n/strings.en-US | 1 + src/Context.cpp | 5 ++++- {i18n => src}/i18n.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) rename {i18n => src}/i18n.h (99%) diff --git a/i18n/strings.en-US b/i18n/strings.en-US index 8d75b86f2..ced94d6d9 100644 --- a/i18n/strings.en-US +++ b/i18n/strings.en-US @@ -11,6 +11,7 @@ # 1xx task shell 100 Unknown Error. +101 Could not read home directory from the passwd file. # 2xx Commands 200 active diff --git a/src/Context.cpp b/src/Context.cpp index 636b1951b..c55371fa4 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -33,6 +33,7 @@ #include "text.h" #include "util.h" #include "task.h" +#include "i18n.h" #include "../auto.h" //////////////////////////////////////////////////////////////////////////////// @@ -199,7 +200,9 @@ void Context::loadCorrectConfigFile (int argc, char** argv) struct passwd* pw = getpwuid (getuid ()); if (!pw) - throw std::string ("Could not read home directory from passwd file."); + throw std::string ( + stringtable.get (SHELL_READ_PASSWD, + "Could not read home directory from the passwd file.")); std::string file = pw->pw_dir; config.createDefault (file); diff --git a/i18n/i18n.h b/src/i18n.h similarity index 99% rename from i18n/i18n.h rename to src/i18n.h index 63a21ca8a..76395c09d 100644 --- a/i18n/i18n.h +++ b/src/i18n.h @@ -30,6 +30,7 @@ // 1xx task shell #define SHELL_UNKNOWN_ERROR 100 +#define SHELL_READ_PASSWD 101 // 2xx Commands #define CMD_ACTIVE 200