2017-06-01 21:55:10 +02:00
|
|
|
#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
|
2014-08-15 00:46:36 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
2016-05-04 19:24:41 +02:00
|
|
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
|
|
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
2014-08-15 00:46:36 +02:00
|
|
|
*
|
|
|
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
2014-08-15 00:46:36 +02:00
|
|
|
*****************************************************************************/
|
2016-05-04 19:24:41 +02:00
|
|
|
#pragma endregion
|
2014-08-15 00:46:36 +02:00
|
|
|
|
|
|
|
#ifndef _LANGUAGE_H_
|
|
|
|
#define _LANGUAGE_H_
|
|
|
|
|
2017-12-05 13:55:33 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#include <string>
|
|
|
|
#endif
|
|
|
|
|
2014-10-06 18:36:58 +02:00
|
|
|
#include "../common.h"
|
2015-07-31 02:15:35 +02:00
|
|
|
#include "../drawing/font.h"
|
2014-08-15 00:46:36 +02:00
|
|
|
|
|
|
|
enum {
|
2017-06-06 23:24:18 +02:00
|
|
|
LANGUAGE_UNDEFINED,
|
2017-10-09 10:53:09 +02:00
|
|
|
LANGUAGE_ARABIC,
|
|
|
|
LANGUAGE_CATALAN,
|
|
|
|
LANGUAGE_CHINESE_SIMPLIFIED,
|
|
|
|
LANGUAGE_CHINESE_TRADITIONAL,
|
|
|
|
LANGUAGE_CZECH,
|
|
|
|
LANGUAGE_GERMAN,
|
2017-06-06 23:24:18 +02:00
|
|
|
LANGUAGE_ENGLISH_UK,
|
|
|
|
LANGUAGE_ENGLISH_US,
|
2017-10-09 10:53:09 +02:00
|
|
|
LANGUAGE_SPANISH,
|
2017-06-06 23:24:18 +02:00
|
|
|
LANGUAGE_FRENCH,
|
2017-10-09 10:53:09 +02:00
|
|
|
LANGUAGE_ITALIAN,
|
|
|
|
LANGUAGE_JAPANESE,
|
|
|
|
LANGUAGE_KOREAN,
|
2017-06-06 23:24:18 +02:00
|
|
|
LANGUAGE_HUNGARIAN,
|
2017-10-09 10:53:09 +02:00
|
|
|
LANGUAGE_DUTCH,
|
|
|
|
LANGUAGE_NORWEGIAN,
|
2017-06-06 23:24:18 +02:00
|
|
|
LANGUAGE_POLISH,
|
|
|
|
LANGUAGE_PORTUGUESE_BR,
|
|
|
|
LANGUAGE_RUSSIAN,
|
2017-10-09 10:53:09 +02:00
|
|
|
LANGUAGE_FINNISH,
|
|
|
|
LANGUAGE_SWEDISH,
|
2017-06-06 23:24:18 +02:00
|
|
|
LANGUAGE_COUNT
|
2014-08-15 00:46:36 +02:00
|
|
|
};
|
|
|
|
|
2017-12-11 19:29:25 +01:00
|
|
|
typedef enum RCT2LanguageId
|
|
|
|
{
|
|
|
|
RCT2_LANGUAGE_ID_ENGLISH_UK,
|
|
|
|
RCT2_LANGUAGE_ID_ENGLISH_US,
|
|
|
|
RCT2_LANGUAGE_ID_FRENCH,
|
|
|
|
RCT2_LANGUAGE_ID_GERMAN,
|
|
|
|
RCT2_LANGUAGE_ID_SPANISH,
|
|
|
|
RCT2_LANGUAGE_ID_ITALIAN,
|
|
|
|
RCT2_LANGUAGE_ID_DUTCH,
|
|
|
|
RCT2_LANGUAGE_ID_SWEDISH,
|
|
|
|
RCT2_LANGUAGE_ID_JAPANESE,
|
|
|
|
RCT2_LANGUAGE_ID_KOREAN,
|
|
|
|
RCT2_LANGUAGE_ID_CHINESE_SIMPLIFIED,
|
|
|
|
RCT2_LANGUAGE_ID_CHINESE_TRADITIONAL,
|
|
|
|
RCT2_LANGUAGE_ID_12,
|
|
|
|
RCT2_LANGUAGE_ID_PORTUGUESE,
|
|
|
|
RCT2_LANGUAGE_ID_BLANK = 254,
|
|
|
|
RCT2_LANGUAGE_ID_END = 255
|
|
|
|
} RCT2LanguageId;
|
|
|
|
|
2015-07-26 18:50:01 +02:00
|
|
|
#define FONT_OPENRCT2_SPRITE NULL
|
|
|
|
|
2017-10-26 23:23:24 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#include "../interface/FontFamilies.h"
|
|
|
|
#endif
|
|
|
|
|
2016-05-12 23:57:40 +02:00
|
|
|
typedef struct language_descriptor {
|
2017-06-06 23:24:18 +02:00
|
|
|
const char *locale;
|
|
|
|
const utf8 *english_name;
|
|
|
|
const utf8 *native_name;
|
2017-10-26 23:23:24 +02:00
|
|
|
#if defined(__cplusplus) && !defined(NO_TTF)
|
|
|
|
TTFontFamily const * font_family;
|
2017-01-03 22:57:15 +01:00
|
|
|
#else
|
2017-10-26 23:23:24 +02:00
|
|
|
void * font_family;
|
|
|
|
#endif
|
2017-12-11 19:29:25 +01:00
|
|
|
RCT2LanguageId rct2_original_id;
|
2015-07-26 18:50:01 +02:00
|
|
|
} language_descriptor;
|
|
|
|
|
2017-09-18 17:05:28 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-07-26 18:50:01 +02:00
|
|
|
extern const language_descriptor LanguagesDescriptors[LANGUAGE_COUNT];
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
extern sint32 gCurrentLanguage;
|
2015-07-26 18:50:01 +02:00
|
|
|
extern bool gUseTrueTypeFont;
|
2014-08-15 00:46:36 +02:00
|
|
|
|
2015-07-27 02:09:24 +02:00
|
|
|
extern const utf8 BlackUpArrowString[];
|
|
|
|
extern const utf8 BlackDownArrowString[];
|
|
|
|
extern const utf8 BlackLeftArrowString[];
|
|
|
|
extern const utf8 BlackRightArrowString[];
|
|
|
|
extern const utf8 CheckBoxMarkString[];
|
|
|
|
|
2014-08-15 00:46:36 +02:00
|
|
|
const char *language_get_string(rct_string_id id);
|
2017-01-04 22:17:08 +01:00
|
|
|
bool language_open(sint32 id);
|
2015-06-08 18:16:18 +02:00
|
|
|
void language_close_all();
|
2014-08-15 00:46:36 +02:00
|
|
|
|
2015-07-26 01:55:17 +02:00
|
|
|
uint32 utf8_get_next(const utf8 *char_ptr, const utf8 **nextchar_ptr);
|
|
|
|
utf8 *utf8_write_codepoint(utf8 *dst, uint32 codepoint);
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 utf8_insert_codepoint(utf8 *dst, uint32 codepoint);
|
2016-03-10 00:07:55 +01:00
|
|
|
bool utf8_is_codepoint_start(const utf8 *text);
|
2016-03-01 05:33:46 +01:00
|
|
|
void utf8_remove_format_codes(utf8 *text, bool allowcolours);
|
2017-01-04 22:17:08 +01:00
|
|
|
sint32 utf8_get_codepoint_length(sint32 codepoint);
|
|
|
|
sint32 utf8_length(const utf8 *text);
|
2015-08-04 22:41:45 +02:00
|
|
|
wchar_t *utf8_to_widechar(const utf8 *src);
|
|
|
|
utf8 *widechar_to_utf8(const wchar_t *src);
|
2015-07-26 01:55:17 +02:00
|
|
|
|
2017-12-11 19:29:25 +01:00
|
|
|
utf8 *rct2_language_string_to_utf8(const char *src, size_t srcSize, RCT2LanguageId languageId);
|
2015-09-08 19:46:22 +02:00
|
|
|
bool language_get_localised_scenario_strings(const utf8 *scenarioFilename, rct_string_id *outStringIds);
|
2016-06-25 17:34:35 +02:00
|
|
|
void language_free_object_string(rct_string_id stringId);
|
2016-07-04 19:53:35 +02:00
|
|
|
rct_string_id language_get_object_override_string_id(const char * identifier, uint8 index);
|
2015-09-08 19:46:22 +02:00
|
|
|
|
2017-09-18 17:05:28 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-12-05 13:55:33 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
rct_string_id language_allocate_object_string(const std::string &target);
|
|
|
|
#endif
|
|
|
|
|
2014-10-21 02:08:55 +02:00
|
|
|
#endif
|