export messages and strings into separate .po files

commit the exported files.
This commit is contained in:
Enno Rehling 2018-05-17 10:43:23 +02:00
parent 0f3e3c9e38
commit 35c3d4cda0
7 changed files with 23113 additions and 12 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -918,11 +918,16 @@ static void export_locale(const struct locale *lang, const char *name) {
char fname[64];
FILE * F;
sprintf(fname, "strings.%s.po", name);
sprintf(fname, "strings.%2s.po", name);
F = fopen(fname, "wt");
if (F) {
export_strings(lang, F);
export_messages(lang, F);
fclose(F);
}
sprintf(fname, "messages.%2s.po", name);
F = fopen(fname, "wt");
if (F) {
export_messages(lang, F, NULL);
fclose(F);
}
}

View file

@ -191,12 +191,12 @@ void free_nrmesssages(void) {
}
}
void export_messages(const struct locale * lang, FILE *F) {
void export_messages(const struct locale * lang, FILE *F, const char *context) {
int i;
for (i = 0; i != NRT_MAXHASH; ++i) {
nrmessage_type *nrt = nrtypes[i];
while (nrt) {
po_write_msg(F, nrt->mtype->name, nrt->string, "message");
po_write_msg(F, nrt->mtype->name, nrt->string, context);
nrt = nrt->next;
}
}

View file

@ -47,14 +47,7 @@ extern "C" {
int nr_level(const struct message *msg);
const char *nr_section(const struct message *msg);
void export_messages(const struct locale * lang, FILE *F);
/* before:
* fogblock;movement:0;de;{unit} konnte von {region} nicht nach {$dir direction} ausreisen, der Nebel war zu dicht.
* after:
* fogblock:movement:0
* $unit($unit) konnte von $region($region) nicht nach $direction($direction) ausreisen, der Nebel war zu dicht.
* unit:unit region:region direction:int
*/
void export_messages(const struct locale * lang, FILE *F, const char *context);
#ifdef __cplusplus
}