summaryrefslogtreecommitdiff
path: root/src/newgrf_text.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-11-16 12:47:22 +0000
committerrubidium <rubidium@openttd.org>2010-11-16 12:47:22 +0000
commit0500c92003282382c2b0e66c7168ba7319c65b25 (patch)
treea80acaa1006280fbde373e1c382baf7da765210e /src/newgrf_text.h
parente84c52e6620eed63ad1202a83e0a2e5a1b98fda5 (diff)
downloadopenttd-0500c92003282382c2b0e66c7168ba7319c65b25.tar.xz
(svn r21208) -Add: [NewGRF] Mapping information w.r.t. a translation's case and gender names
Diffstat (limited to 'src/newgrf_text.h')
-rw-r--r--src/newgrf_text.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/newgrf_text.h b/src/newgrf_text.h
index 2865bf706..90fcd719a 100644
--- a/src/newgrf_text.h
+++ b/src/newgrf_text.h
@@ -14,6 +14,7 @@
#include "string_type.h"
#include "strings_type.h"
+#include "core/smallvec_type.hpp"
/** This character, the thorn ('รพ'), indicates a unicode string to NFO. */
static const WChar NFO_UTF8_IDENTIFIER = 0x00DE;
@@ -42,4 +43,22 @@ uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const
StringID TTDPStringIDToOTTDStringIDMapping(StringID string);
+/** Mapping of language data between a NewGRF and OpenTTD. */
+struct LanguageMap {
+ /** Mapping between NewGRF and OpenTTD IDs. */
+ struct Mapping {
+ byte newgrf_id; ///< NewGRF's internal ID for a case/gender.
+ byte openttd_id; ///< OpenTTD's internal ID for a case/gender.
+ };
+
+ /* We need a vector and can't use SmallMap due to the fact that for "setting" a
+ * gender of a string or requesting a case for a substring we want to map from
+ * the NewGRF's internal ID to OpenTTD's ID whereas for the choice lists we map
+ * the genders/cases/plural OpenTTD IDs to the NewGRF's internal IDs. In this
+ * case a NewGRF developer/translator might want a different translation for
+ * both cases. Thus we are basically implementing a multi-map. */
+ SmallVector<Mapping, 1> gender_map; ///< Mapping of NewGRF and OpenTTD IDs for genders.
+ SmallVector<Mapping, 1> case_map; ///< Mapping of NewGRF and OpenTTD IDs for cases.
+};
+
#endif /* NEWGRF_TEXT_H */