1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-08 06:59:55 +00:00

Add language-zh.cpp

This commit is contained in:
1iuh 2024-08-02 10:31:28 +08:00 committed by liuh
parent 617f125632
commit 6683d89ebc
5 changed files with 9229 additions and 4 deletions

View File

@ -63,7 +63,7 @@ savepng-loc.o: savepng.cpp
hyper-rogueviz.o: hyper.cpp graph.cpp hyperpoint.cpp geometry.cpp cell.cpp heptagon.cpp game.cpp classes.cpp polygons.cpp language.cpp language-data.cpp achievement.cpp shmup.cpp patterns.cpp mapeditor.cpp netgen.cpp yendor.cpp hyper.h rug.cpp flags.cpp system.cpp landgen.cpp orbs.cpp complex.cpp conformal.cpp menus.cpp init.cpp dialogs.cpp sound.cpp util.cpp ${drogueviz} fieldpattern.cpp ${MAIN} control.cpp commandline.cpp
${CXX} ${PROF} ${MAIN} -c -o hyper-rogueviz.o ${MYFLAGS}
langen: langen.cpp language-cz.cpp language-pl.cpp language-tr.cpp language-ru.cpp language-de.cpp language-ptbr.cpp language-fr.cpp
langen: langen.cpp language-cz.cpp language-pl.cpp language-tr.cpp language-ru.cpp language-de.cpp language-ptbr.cpp language-fr.cpp language-zh.cpp
${CXX} langen.cpp -o langen -g
language-data.cpp: langen

Binary file not shown.

View File

@ -26,7 +26,7 @@
template<class T> int isize(const T& x) { return x.size(); }
#define NUMLAN 8
#define NUMLAN 9
// language generator
@ -290,6 +290,27 @@ void langFR() {
current_language = "-";
}
void langZH() {
current_language = "ZH";
static std::pair<const char *, const char *> ds[] = {
#define S(a,b) { a, b },
#define N(a,b,c)
#include "language-zh.cpp"
#undef N
#undef S
};
static std::pair<const char *, noun2> ns[] = {
#define S(a,b)
#define N(a,b,c) { a, noun2{ b, c, c, c, c } },
#include "language-zh.cpp"
#undef N
#undef S
};
for(auto&& elt : ds) d[8].add(elt.first, elt.second);
for(auto&& elt : ns) nouns[8].add(elt.first, elt.second);
current_language = "-";
}
int completeness[NUMLAN];
template<class T>
@ -358,7 +379,7 @@ int main() {
langPL(); langCZ(); langRU();
langTR(); langDE(); langPT();
langFR();
langFR(); langZH();
// verify
compute_completeness(d);

9201
language-zh.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ EX const string dnameof(eWall w) { return w >= 0 && w < walltypes ? winf[w].name
EX const string dnameof(eItem i) { return i >= 0 && i < ittypes ? iinf[i].name : hr::format("[ITEM %d]", i); }
#if HDR
#define NUMLAN 8
#define NUMLAN 9
struct stringpar {
string v;
@ -303,6 +303,9 @@ void parrep(string& x, string w, stringpar p) {
rep(x, "%abl"+w, data.abl);
rep(x, "%d"+w, data.abl); // Dativ (which equals Ablative in German)
}
if(l == 8) {
rep(x, "%"+w, data.nom);
}
#endif
if(true) {
// proper names (R'Lyeh)