Bug fix for allowing language to be specified.
This commit is contained in:
parent
856311dd53
commit
4f498fba98
|
@ -28,5 +28,6 @@ extern int isMissionAvailable(Mission *mission, Mission *prev);
|
|||
extern char **getFileList(char *dir, int *count);
|
||||
extern Mission *loadMissionMeta(char *filename);
|
||||
extern int getJSONValue(cJSON *node, char *name, int defValue);
|
||||
extern char *getTranslatedString(char *string);
|
||||
|
||||
extern Game game;
|
||||
|
|
|
@ -240,9 +240,9 @@ static void handleMissionArgs(int argc, char *argv[])
|
|||
for (i = 1 ; i < argc ; i++)
|
||||
{
|
||||
/* assume this is filename for testing */
|
||||
if (argv[i][0] != '-')
|
||||
if (strcmp(argv[i], "-mission") == 0)
|
||||
{
|
||||
loadTestMission(argv[i]);
|
||||
loadTestMission(argv[++i]);
|
||||
|
||||
testingMission = 1;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,12 @@ void setLanguage(char *applicationName, char *languageCode)
|
|||
|
||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Locale is %s", language);
|
||||
|
||||
sprintf(c, "locale/%s.mo", language);
|
||||
|
||||
if (!fileExists(c))
|
||||
{
|
||||
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
|
||||
}
|
||||
|
||||
#if DEV == 1
|
||||
printf("Opening %s\n", c);
|
||||
|
|
|
@ -28,3 +28,4 @@ Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
|
|||
char *getTranslatedString(char *);
|
||||
void setLanguage(char *, char *);
|
||||
void cleanupLanguage(void);
|
||||
extern int fileExists(char *filename);
|
||||
|
|
Loading…
Reference in New Issue