diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-05 06:54:35 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-05 06:54:35 +0300 |
commit | 37755274aa10ae2a2f8e701fe741b64ba28ba1c9 (patch) | |
tree | 5f55561690430d0a353bd69908df7507fabaf0d5 /src | |
parent | bb1b42eaf7ecb6cd9ea4c531c28513839f443a07 (diff) |
Lang: New strings for directory/archive browsing
Diffstat (limited to 'src')
-rw-r--r-- | src/gmrequest.c | 17 | ||||
-rw-r--r-- | src/ui/documentwidget.c | 11 |
2 files changed, 16 insertions, 12 deletions
diff --git a/src/gmrequest.c b/src/gmrequest.c index cdf4e582..1a7c37df 100644 --- a/src/gmrequest.c +++ b/src/gmrequest.c | |||
@@ -696,25 +696,28 @@ void submit_GmRequest(iGmRequest *d) { | |||
696 | } | 696 | } |
697 | else { | 697 | else { |
698 | /* The root directory. */ | 698 | /* The root directory. */ |
699 | appendFormat_String(page, "=> %s " close_Icon " Exit the archive\n", | 699 | appendFormat_String(page, "=> %s " close_Icon " ${archive.exit}\n", |
700 | cstr_String(containerUrl)); | 700 | cstr_String(containerUrl)); |
701 | appendFormat_String(page, "# %s\n\n" | 701 | appendFormat_String(page, "# %s\n\n", cstr_Rangecc(containerName)); |
702 | "This archive contains %zu items and its compressed " | 702 | appendFormat_String(page, |
703 | "size is %.1f MB.\n\n", | 703 | cstrCount_Lang("archive.summary.n", numEntries_Archive(arch)), |
704 | cstr_Rangecc(containerName), | ||
705 | numEntries_Archive(arch), | 704 | numEntries_Archive(arch), |
706 | (double) sourceSize_Archive(arch) / 1.0e6); | 705 | (double) sourceSize_Archive(arch) / 1.0e6); |
706 | appendCStr_String(page, "\n\n"); | ||
707 | } | 707 | } |
708 | iStringSet *contents = iClob(listDirectory_Archive(arch, entryPath)); | 708 | iStringSet *contents = iClob(listDirectory_Archive(arch, entryPath)); |
709 | if (!isRoot) { | 709 | if (!isRoot) { |
710 | if (isEmpty_StringSet(contents)) { | 710 | if (isEmpty_StringSet(contents)) { |
711 | appendCStr_String(page, "This directory is empty.\n"); | 711 | appendCStr_String(page, "${dir.empty}\n"); |
712 | } | 712 | } |
713 | else if (size_StringSet(contents) > 1) { | 713 | else if (size_StringSet(contents) > 1) { |
714 | appendFormat_String(page, "This directory contains %zu items.\n\n", | 714 | appendFormat_String(page, cstrCount_Lang("dir.summary.n", |
715 | size_StringSet(contents)), | ||
715 | size_StringSet(contents)); | 716 | size_StringSet(contents)); |
717 | appendCStr_String(page, "\n\n"); | ||
716 | } | 718 | } |
717 | } | 719 | } |
720 | translate_Lang(page); | ||
718 | iConstForEach(StringSet, e, contents) { | 721 | iConstForEach(StringSet, e, contents) { |
719 | const iString *subPath = e.value; | 722 | const iString *subPath = e.value; |
720 | iRangecc relSub = range_String(subPath); | 723 | iRangecc relSub = range_String(subPath); |
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 8d519865..ed38ad0b 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -1182,10 +1182,11 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse | |||
1182 | setRange_String(&d->sourceMime, param); | 1182 | setRange_String(&d->sourceMime, param); |
1183 | iString *key = collectNew_String(); | 1183 | iString *key = collectNew_String(); |
1184 | toString_Sym(SDLK_s, KMOD_PRIMARY, key); | 1184 | toString_Sym(SDLK_s, KMOD_PRIMARY, key); |
1185 | format_String(&str, "# %s\n" | 1185 | format_String(&str, "# %s\n", zipPageHeading_(param)); |
1186 | "%s is a compressed archive.\n\n", | 1186 | appendFormat_String(&str, |
1187 | zipPageHeading_(param), | 1187 | cstr_Lang("doc.archive"), |
1188 | cstr_Rangecc(baseName_Path(d->mod.url))); | 1188 | cstr_Rangecc(baseName_Path(d->mod.url))); |
1189 | appendCStr_String(&str, "\n\n"); | ||
1189 | iString *localPath = localFilePathFromUrl_String(d->mod.url); | 1190 | iString *localPath = localFilePathFromUrl_String(d->mod.url); |
1190 | if (!localPath) { | 1191 | if (!localPath) { |
1191 | appendFormat_String(&str, "%s\n\n", | 1192 | appendFormat_String(&str, "%s\n\n", |
@@ -1195,7 +1196,7 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse | |||
1195 | } | 1196 | } |
1196 | delete_String(localPath); | 1197 | delete_String(localPath); |
1197 | if (equalCase_Rangecc(urlScheme_String(d->mod.url), "file")) { | 1198 | if (equalCase_Rangecc(urlScheme_String(d->mod.url), "file")) { |
1198 | appendFormat_String(&str, "=> %s/ View archive contents\n", | 1199 | appendFormat_String(&str, "=> %s/ ${doc.archive.view}\n", |
1199 | cstr_String(withSpacesEncoded_String(d->mod.url))); | 1200 | cstr_String(withSpacesEncoded_String(d->mod.url))); |
1200 | } | 1201 | } |
1201 | translate_Lang(&str); | 1202 | translate_Lang(&str); |