mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
When dumping translation table NOT to JSON, always start with LANGID
This commit is contained in:
20
src/trans.c
20
src/trans.c
@@ -143,19 +143,29 @@ DumpTranslationTable(FILE *fp, int json)
|
||||
{
|
||||
XlateItem *item;
|
||||
int done = 0;
|
||||
char const *t;
|
||||
if (!json) {
|
||||
fprintf(fp, "# Translation table\n");
|
||||
/* Always to LANGID first */
|
||||
t = GetTranslatedString("LANGID");
|
||||
if (t) {
|
||||
fprintf(fp, "TRANSLATE \"LANGID\" ");
|
||||
print_escaped_string(fp, t);
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
} else {
|
||||
fprintf(fp, "{");
|
||||
}
|
||||
item = hash_table_next(&TranslationTable, NULL);
|
||||
while(item) {
|
||||
if (!json) {
|
||||
fprintf(fp, "TRANSLATE ");
|
||||
print_escaped_string(fp, item->orig);
|
||||
fprintf(fp, " ");
|
||||
print_escaped_string(fp, item->translated);
|
||||
fprintf(fp, "\n");
|
||||
if (strcmp(item->orig, "LANGID")) {
|
||||
fprintf(fp, "TRANSLATE ");
|
||||
print_escaped_string(fp, item->orig);
|
||||
fprintf(fp, " ");
|
||||
print_escaped_string(fp, item->translated);
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
} else {
|
||||
if (done) {
|
||||
fprintf(fp, ",");
|
||||
|
||||
Reference in New Issue
Block a user