You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.5 KiB
C
60 lines
2.5 KiB
C
16 years ago
|
/* $Id$ */
|
||
|
|
||
15 years ago
|
/*
|
||
|
* This file is part of OpenTTD.
|
||
|
* OpenTTD 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, version 2.
|
||
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
|
||
14 years ago
|
/** @file language.h Information about languages and their files. */
|
||
16 years ago
|
|
||
14 years ago
|
#ifndef LANGUAGE_H
|
||
|
#define LANGUAGE_H
|
||
16 years ago
|
|
||
16 years ago
|
/** Header of a language file. */
|
||
16 years ago
|
struct LanguagePackHeader {
|
||
14 years ago
|
static const uint32 IDENT = 0x474E414C; ///< Identifier for OpenTTD language files, big endian for "LANG"
|
||
|
|
||
16 years ago
|
uint32 ident; ///< 32-bits identifier
|
||
|
uint32 version; ///< 32-bits of auto generated version info which is basically a hash of strings.h
|
||
|
char name[32]; ///< the international name of this language
|
||
|
char own_name[32]; ///< the localized name of this language
|
||
|
char isocode[16]; ///< the ISO code for the language (not country code)
|
||
|
uint16 offsets[32]; ///< the offsets
|
||
|
|
||
|
/** Thousand separator used for anything not currencies */
|
||
|
char digit_group_separator[8];
|
||
|
/** Thousand separator used for currencies */
|
||
|
char digit_group_separator_currency[8];
|
||
15 years ago
|
/** Decimal separator */
|
||
|
char digit_decimal_separator[8];
|
||
16 years ago
|
byte plural_form; ///< plural form index
|
||
|
byte text_dir; ///< default direction of the text
|
||
16 years ago
|
/**
|
||
|
* Windows language ID:
|
||
|
* Windows cannot and will not convert isocodes to something it can use to
|
||
|
* determine whether a font can be used for the language or not. As a result
|
||
|
* of that we need to pass the language id via strgen to OpenTTD to tell
|
||
|
* what language it is in "Windows". The ID is the 'locale identifier' on:
|
||
|
* http://msdn.microsoft.com/en-us/library/ms776294.aspx
|
||
|
*/
|
||
16 years ago
|
uint16 winlangid; ///< windows language id
|
||
|
uint8 newgrflangid; ///< newgrf language id
|
||
|
byte pad[3]; ///< pad header to be a multiple of 4
|
||
14 years ago
|
|
||
|
/**
|
||
|
* Check whether the header is a valid header for OpenTTD.
|
||
|
* @return true iff the header is deemed valid.
|
||
|
*/
|
||
|
bool IsValid() const;
|
||
16 years ago
|
};
|
||
|
assert_compile(sizeof(LanguagePackHeader) % 4 == 0);
|
||
|
|
||
14 years ago
|
/** Metadata about a single language. */
|
||
|
struct LanguageMetadata : public LanguagePackHeader {
|
||
|
char file[MAX_PATH]; ///< Name of the file we read this data from.
|
||
|
};
|
||
|
|
||
|
#endif /* LANGUAGE_H */
|