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 char **getFileList(char *dir, int *count);
|
||||||
extern Mission *loadMissionMeta(char *filename);
|
extern Mission *loadMissionMeta(char *filename);
|
||||||
extern int getJSONValue(cJSON *node, char *name, int defValue);
|
extern int getJSONValue(cJSON *node, char *name, int defValue);
|
||||||
|
extern char *getTranslatedString(char *string);
|
||||||
|
|
||||||
extern Game game;
|
extern Game game;
|
||||||
|
|
|
@ -240,9 +240,9 @@ static void handleMissionArgs(int argc, char *argv[])
|
||||||
for (i = 1 ; i < argc ; i++)
|
for (i = 1 ; i < argc ; i++)
|
||||||
{
|
{
|
||||||
/* assume this is filename for testing */
|
/* assume this is filename for testing */
|
||||||
if (argv[i][0] != '-')
|
if (strcmp(argv[i], "-mission") == 0)
|
||||||
{
|
{
|
||||||
loadTestMission(argv[i]);
|
loadTestMission(argv[++i]);
|
||||||
|
|
||||||
testingMission = 1;
|
testingMission = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,8 +75,13 @@ void setLanguage(char *applicationName, char *languageCode)
|
||||||
strtok(language, ".");
|
strtok(language, ".");
|
||||||
|
|
||||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Locale is %s", language);
|
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Locale is %s", language);
|
||||||
|
|
||||||
|
sprintf(c, "locale/%s.mo", language);
|
||||||
|
|
||||||
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
|
if (!fileExists(c))
|
||||||
|
{
|
||||||
|
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
|
||||||
|
}
|
||||||
|
|
||||||
#if DEV == 1
|
#if DEV == 1
|
||||||
printf("Opening %s\n", c);
|
printf("Opening %s\n", c);
|
||||||
|
|
|
@ -28,3 +28,4 @@ Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
|
||||||
char *getTranslatedString(char *);
|
char *getTranslatedString(char *);
|
||||||
void setLanguage(char *, char *);
|
void setLanguage(char *, char *);
|
||||||
void cleanupLanguage(void);
|
void cleanupLanguage(void);
|
||||||
|
extern int fileExists(char *filename);
|
||||||
|
|
Loading…
Reference in New Issue