OpenRCT2/src/localisation/language.h

87 lines
2.6 KiB
C
Raw Normal View History

#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
2014-08-15 00:46:36 +02:00
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* 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.
*
* A full copy of the GNU General Public License can be found in licence.txt
2014-08-15 00:46:36 +02:00
*****************************************************************************/
#pragma endregion
2014-08-15 00:46:36 +02:00
#ifndef _LANGUAGE_H_
#define _LANGUAGE_H_
2014-10-06 18:36:58 +02:00
#include "../common.h"
#include "../drawing/font.h"
2014-08-15 00:46:36 +02:00
enum {
LANGUAGE_UNDEFINED,
LANGUAGE_ENGLISH_UK,
LANGUAGE_ENGLISH_US,
2014-10-21 02:08:55 +02:00
LANGUAGE_GERMAN,
2014-08-15 00:46:36 +02:00
LANGUAGE_DUTCH,
2014-08-15 01:13:08 +02:00
LANGUAGE_FRENCH,
2014-08-19 21:17:20 +02:00
LANGUAGE_HUNGARIAN,
2014-08-20 21:32:09 +02:00
LANGUAGE_POLISH,
LANGUAGE_SPANISH,
2014-09-11 13:05:18 +02:00
LANGUAGE_SWEDISH,
2015-03-18 12:34:16 +01:00
LANGUAGE_ITALIAN,
2015-06-21 14:53:04 +02:00
LANGUAGE_PORTUGUESE_BR,
2015-07-26 14:58:53 +02:00
LANGUAGE_CHINESE_TRADITIONAL,
LANGUAGE_CHINESE_SIMPLIFIED,
LANGUAGE_FINNISH,
2015-09-03 20:57:24 +02:00
LANGUAGE_KOREAN,
2015-11-15 12:30:13 +01:00
LANGUAGE_RUSSIAN,
LANGUAGE_CZECH,
LANGUAGE_JAPANESE,
2016-06-01 00:25:28 +02:00
LANGUAGE_NORWEGIAN,
2014-08-15 00:46:36 +02:00
LANGUAGE_COUNT
};
2015-07-26 18:50:01 +02:00
#define FONT_OPENRCT2_SPRITE NULL
2016-05-12 23:57:40 +02:00
typedef struct language_descriptor {
2015-07-26 18:50:01 +02:00
const char *locale;
const utf8 *english_name;
const utf8 *native_name;
TTFFontSetDescriptor *font;
2015-07-27 02:09:24 +02:00
uint8 rct2_original_id;
2015-07-26 18:50:01 +02:00
} language_descriptor;
extern const language_descriptor LanguagesDescriptors[LANGUAGE_COUNT];
2014-08-15 00:46:36 +02:00
extern int 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);
bool language_open(int id);
void language_close_all();
2014-08-15 00:46:36 +02:00
rct_string_id object_get_localised_text(uint8_t** pStringTable/*ebp*/, int type/*ecx*/, int index/*ebx*/, int tableindex/*edx*/);
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);
2015-07-29 19:16:15 +02:00
int utf8_insert_codepoint(utf8 *dst, uint32 codepoint);
bool utf8_is_codepoint_start(const utf8 *text);
void utf8_remove_format_codes(utf8 *text, bool allowcolours);
2015-07-29 15:36:21 +02:00
int utf8_get_codepoint_length(int codepoint);
int utf8_length(const utf8 *text);
wchar_t *utf8_to_widechar(const utf8 *src);
utf8 *widechar_to_utf8(const wchar_t *src);
2015-07-26 01:55:17 +02:00
2015-09-08 19:46:22 +02:00
bool language_get_localised_scenario_strings(const utf8 *scenarioFilename, rct_string_id *outStringIds);
2014-10-21 02:08:55 +02:00
#endif