Made Celestia also look for localized version of files in the 'locale' directory.

pull/3/head
Vincent Giangiulio 2008-11-24 13:14:22 +00:00
parent c1aed42a56
commit d47260538f
1 changed files with 9 additions and 2 deletions

View File

@ -75,8 +75,15 @@ string LocaleFilename(const string & filename)
{
localeFilename = filename + '_' + _("LANGUAGE");
}
if (stat(localeFilename.c_str(), &filestat) != 0) {
localeFilename = filename;
if (stat(localeFilename.c_str(), &filestat) != 0)
{
localeFilename = string("locale/") + localeFilename;
if (stat(localeFilename.c_str(), &filestat) != 0)
{
localeFilename = filename;
}
}
return localeFilename;
}