forked from github/server
export messages and strings into separate .po files
commit the exported files.
This commit is contained in:
parent
0f3e3c9e38
commit
35c3d4cda0
7 changed files with 23113 additions and 12 deletions
5595
res/translations/messages.de.po
Normal file
5595
res/translations/messages.de.po
Normal file
File diff suppressed because it is too large
Load diff
5595
res/translations/messages.en.po
Normal file
5595
res/translations/messages.en.po
Normal file
File diff suppressed because it is too large
Load diff
6312
res/translations/strings.de.po
Normal file
6312
res/translations/strings.de.po
Normal file
File diff suppressed because it is too large
Load diff
5601
res/translations/strings.en.po
Normal file
5601
res/translations/strings.en.po
Normal file
File diff suppressed because it is too large
Load diff
|
@ -918,11 +918,16 @@ static void export_locale(const struct locale *lang, const char *name) {
|
||||||
char fname[64];
|
char fname[64];
|
||||||
FILE * F;
|
FILE * F;
|
||||||
|
|
||||||
sprintf(fname, "strings.%s.po", name);
|
sprintf(fname, "strings.%2s.po", name);
|
||||||
F = fopen(fname, "wt");
|
F = fopen(fname, "wt");
|
||||||
if (F) {
|
if (F) {
|
||||||
export_strings(lang, 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);
|
fclose(F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
int i;
|
||||||
for (i = 0; i != NRT_MAXHASH; ++i) {
|
for (i = 0; i != NRT_MAXHASH; ++i) {
|
||||||
nrmessage_type *nrt = nrtypes[i];
|
nrmessage_type *nrt = nrtypes[i];
|
||||||
while (nrt) {
|
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;
|
nrt = nrt->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,14 +47,7 @@ extern "C" {
|
||||||
int nr_level(const struct message *msg);
|
int nr_level(const struct message *msg);
|
||||||
const char *nr_section(const struct message *msg);
|
const char *nr_section(const struct message *msg);
|
||||||
|
|
||||||
void export_messages(const struct locale * lang, FILE *F);
|
void export_messages(const struct locale * lang, FILE *F, const char *context);
|
||||||
/* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue