diff options
author | frosch <frosch@openttd.org> | 2012-09-09 15:55:20 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-09-09 15:55:20 +0000 |
commit | 16760cff8b6a5986922110794f2a41deb12947f0 (patch) | |
tree | 2339126e1b0f9aa42672de72aa79f1e0a5d1af6e /src/strgen/strgen_base.cpp | |
parent | 2ec61361135d004300f3f7f1071d7fd6f8cf204d (diff) | |
download | openttd-16760cff8b6a5986922110794f2a41deb12947f0.tar.xz |
(svn r24516) -Add: [GS] Support ##plural pragma in GS lang files.
Diffstat (limited to 'src/strgen/strgen_base.cpp')
-rw-r--r-- | src/strgen/strgen_base.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp index 3d0c91d30..7e4516f61 100644 --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -783,6 +783,17 @@ void StringReader::HandleString(char *str) } } +void StringReader::HandlePragma(char *str) +{ + if (!memcmp(str, "plural ", 7)) { + _lang.plural_form = atoi(str + 7); + if (_lang.plural_form >= lengthof(_plural_forms)) { + strgen_fatal("Invalid pluralform %d", _lang.plural_form); + } + } else { + strgen_fatal("unknown pragma '%s'", str); + } +} static void rstrip(char *buf) { |