summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-05 12:21:28 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-05 12:21:28 +0300
commitfe0167daef135089a32c64254c1a90dd2aa42172 (patch)
tree9c815b52bac698bce52f4774ac91e3545c64dee8
parent6000db343bb2c1b44bed9eb4b14a179f839f3aa7 (diff)
Added new language strings for media, feeds list
"about:feeds", inline downloads, and media player UI didn't have translations.
-rw-r--r--po/en.po87
-rw-r--r--res/lang/en.binbin16083 -> 16948 bytes
-rw-r--r--res/lang/es.binbin18079 -> 18557 bytes
-rw-r--r--res/lang/fi.binbin17740 -> 18218 bytes
-rw-r--r--res/lang/ie.binbin17249 -> 17727 bytes
-rw-r--r--res/lang/ru.binbin27064 -> 27542 bytes
-rw-r--r--res/lang/sr.binbin25569 -> 26047 bytes
-rw-r--r--res/lang/zh_Hans.binbin15648 -> 16126 bytes
-rw-r--r--res/lang/zh_Hant.binbin15731 -> 16209 bytes
-rw-r--r--src/audio/player.c21
-rw-r--r--src/feeds.c31
-rw-r--r--src/ui/documentwidget.c2
-rw-r--r--src/ui/mediaui.c10
13 files changed, 122 insertions, 29 deletions
diff --git a/po/en.po b/po/en.po
index 12702b8d..45b3118a 100644
--- a/po/en.po
+++ b/po/en.po
@@ -1,6 +1,90 @@
1msgid "doc.pre.nocaption" 1msgid "doc.pre.nocaption"
2msgstr "Preformatted text without a caption" 2msgstr "Preformatted text without a caption"
3 3
4# Link download progress message.
5msgid "doc.fetching"
6msgstr "Fetching"
7
8# Inline download status message.
9msgid "media.download.warnclose"
10msgstr "Download will be cancelled if this tab is closed."
11
12# Inline download status message.
13msgid "media.download.complete"
14msgstr "Download completed."
15
16# Used in inline audio player metadata popup.
17msgid "audio.meta.title"
18msgstr "Title"
19
20# Used in inline audio player metadata popup.
21msgid "audio.meta.artist"
22msgstr "Artist"
23
24# Used in inline audio player metadata popup.
25msgid "audio.meta.genre"
26msgstr "Genre"
27
28# Used in inline audio player metadata popup.
29msgid "audio.meta.date"
30msgstr "Date"
31
32# used as adjective, n is 8, 16, 24, 32, or 64
33#, c-format
34msgid "n.bit"
35msgstr "%d-bit"
36
37msgid "numbertype.integer"
38msgstr "integer"
39
40msgid "numbertype.float"
41msgstr "float"
42
43# Hertz, unit for frequency values
44msgid "hz"
45msgstr "Hz"
46
47# Used in about:feeds.
48msgid "feeds.list.title"
49msgstr "Feed entries"
50
51#, c-format
52msgid "feeds.list.counts"
53msgid_plural "feeds.list.counts.n"
54msgstr[0] "You are subscribed to %zu feed that contains %%s.\n"
55msgstr[1] "You are subscribed to %zu feeds that contain %%s.\n"
56
57#, c-format
58msgid "feeds.list.entrycount"
59msgid_plural "feeds.list.entrycount.n"
60msgstr[0] " a total of %zu entry"
61msgstr[1] " a total of %zu entries"
62
63msgid "feeds.list.refreshtime.now"
64msgstr "The latest refresh occurred just a moment ago."
65
66#, c-format
67msgid "feeds.list.refreshtime"
68msgstr "The latest refresh occurred %s."
69
70#, c-format
71msgid "minutes.ago"
72msgid_plural "minutes.ago.n"
73msgstr[0] "%d minute ago"
74msgstr[1] "%d minutes ago"
75
76#, c-format
77msgid "hours.ago"
78msgid_plural "hours.ago.n"
79msgstr[0] "%d hour ago"
80msgstr[1] "%d hours ago"
81
82#, c-format
83msgid "days.ago"
84msgid_plural "days.ago.n"
85msgstr[0] "%d day ago"
86msgstr[1] "%d days ago"
87
4# Alt-text of the preformatted logo. 88# Alt-text of the preformatted logo.
5msgid "about.logo" 89msgid "about.logo"
6msgstr "ASCII art: the word \"Lagrange\" using a large font" 90msgstr "ASCII art: the word \"Lagrange\" using a large font"
@@ -269,6 +353,9 @@ msgstr "Updating Feeds"
269msgid "mb" 353msgid "mb"
270msgstr "MB" 354msgstr "MB"
271 355
356msgid "mb.per.sec"
357msgstr "MB/s"
358
272# kilobytes, used as the unit after a number 359# kilobytes, used as the unit after a number
273msgid "kb" 360msgid "kb"
274msgstr "KB" 361msgstr "KB"
diff --git a/res/lang/en.bin b/res/lang/en.bin
index 0689c6ef..dfc89524 100644
--- a/res/lang/en.bin
+++ b/res/lang/en.bin
Binary files differ
diff --git a/res/lang/es.bin b/res/lang/es.bin
index 6d320c3f..1a615301 100644
--- a/res/lang/es.bin
+++ b/res/lang/es.bin
Binary files differ
diff --git a/res/lang/fi.bin b/res/lang/fi.bin
index 17b66610..530ca2bc 100644
--- a/res/lang/fi.bin
+++ b/res/lang/fi.bin
Binary files differ
diff --git a/res/lang/ie.bin b/res/lang/ie.bin
index ad3cc38e..f2e40f93 100644
--- a/res/lang/ie.bin
+++ b/res/lang/ie.bin
Binary files differ
diff --git a/res/lang/ru.bin b/res/lang/ru.bin
index c3af7cb3..7abf7870 100644
--- a/res/lang/ru.bin
+++ b/res/lang/ru.bin
Binary files differ
diff --git a/res/lang/sr.bin b/res/lang/sr.bin
index 7d07273f..3fbfb378 100644
--- a/res/lang/sr.bin
+++ b/res/lang/sr.bin
Binary files differ
diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin
index 9e6a69aa..145735f3 100644
--- a/res/lang/zh_Hans.bin
+++ b/res/lang/zh_Hans.bin
Binary files differ
diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin
index 887791e4..89baa18f 100644
--- a/res/lang/zh_Hant.bin
+++ b/res/lang/zh_Hant.bin
Binary files differ
diff --git a/src/audio/player.c b/src/audio/player.c
index d2ec9870..c08b20fc 100644
--- a/src/audio/player.c
+++ b/src/audio/player.c
@@ -22,6 +22,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
22 22
23#include "player.h" 23#include "player.h"
24#include "buf.h" 24#include "buf.h"
25#include "lang.h"
25 26
26#define STB_VORBIS_HEADER_ONLY 27#define STB_VORBIS_HEADER_ONLY
27#include "stb_vorbis.c" 28#include "stb_vorbis.c"
@@ -579,7 +580,7 @@ static iContentSpec contentSpec_Player_(const iPlayer *d) {
579 content.output.freq = info.sample_rate; 580 content.output.freq = info.sample_rate;
580 content.output.channels = numChannels; 581 content.output.channels = numChannels;
581 content.output.format = AUDIO_F32; 582 content.output.format = AUDIO_F32;
582 content.inputFormat = AUDIO_F32; /* actually stb_vorbis provides floats */ 583 content.inputFormat = AUDIO_F32; /* actually stb_vorbis provides floats */
583 stb_vorbis_close(vrb); 584 stb_vorbis_close(vrb);
584 } 585 }
585 else if (content.type == mpeg_DecoderType) { 586 else if (content.type == mpeg_DecoderType) {
@@ -783,23 +784,27 @@ iString *metadataLabel_Player(const iPlayer *d) {
783 lock_Mutex(&d->decoder->tagMutex); 784 lock_Mutex(&d->decoder->tagMutex);
784 const iString *tags = d->decoder->tags; 785 const iString *tags = d->decoder->tags;
785 if (!isEmpty_String(&tags[title_PlayerTag])) { 786 if (!isEmpty_String(&tags[title_PlayerTag])) {
786 appendFormat_String(meta, "Title: %s\n", cstr_String(&tags[title_PlayerTag])); 787 appendFormat_String(meta, "${audio.meta.title}: %s\n", cstr_String(&tags[title_PlayerTag]));
787 } 788 }
788 if (!isEmpty_String(&tags[artist_PlayerTag])) { 789 if (!isEmpty_String(&tags[artist_PlayerTag])) {
789 appendFormat_String(meta, "Artist: %s\n", cstr_String(&tags[artist_PlayerTag])); 790 appendFormat_String(meta, "${audio.meta.artist}: %s\n", cstr_String(&tags[artist_PlayerTag]));
790 } 791 }
791 if (!isEmpty_String(&tags[genre_PlayerTag])) { 792 if (!isEmpty_String(&tags[genre_PlayerTag])) {
792 appendFormat_String(meta, "Genre: %s\n", cstr_String(&tags[genre_PlayerTag])); 793 appendFormat_String(meta, "${audio.meta.genre}: %s\n", cstr_String(&tags[genre_PlayerTag]));
793 } 794 }
794 if (!isEmpty_String(&tags[date_PlayerTag])) { 795 if (!isEmpty_String(&tags[date_PlayerTag])) {
795 appendFormat_String(meta, "Date: %s\n", cstr_String(&tags[date_PlayerTag])); 796 appendFormat_String(meta, "${audio.meta.date}: %s\n", cstr_String(&tags[date_PlayerTag]));
796 } 797 }
797 unlock_Mutex(&d->decoder->tagMutex); 798 unlock_Mutex(&d->decoder->tagMutex);
798 } 799 }
799 if (d->decoder) { 800 if (d->decoder) {
800 appendFormat_String(meta, "%d-bit %s %d Hz", SDL_AUDIO_BITSIZE(d->decoder->inputFormat), 801 appendFormat_String(meta,
801 SDL_AUDIO_ISFLOAT(d->decoder->inputFormat) ? "float" : "integer", 802 translateCStr_Lang("${n.bit} %s %d ${hz}"), /* translation adds %d */
802 d->spec.freq); 803 SDL_AUDIO_BITSIZE(d->decoder->inputFormat),
804 cstr_Lang(SDL_AUDIO_ISFLOAT(d->decoder->inputFormat)
805 ? "numbertype.float"
806 : "numbertype.integer"),
807 d->spec.freq);
803 } 808 }
804 return meta; 809 return meta;
805} 810}
diff --git a/src/feeds.c b/src/feeds.c
index db426994..2f4714f3 100644
--- a/src/feeds.c
+++ b/src/feeds.c
@@ -24,6 +24,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
24#include "bookmarks.h" 24#include "bookmarks.h"
25#include "gmrequest.h" 25#include "gmrequest.h"
26#include "visited.h" 26#include "visited.h"
27#include "lang.h"
27#include "app.h" 28#include "app.h"
28 29
29#include <the_Foundation/file.h> 30#include <the_Foundation/file.h>
@@ -637,30 +638,28 @@ size_t numUnread_Feeds(void) {
637 return count; 638 return count;
638} 639}
639 640
640#define iPluralS(c) ((c) != 1 ? "s" : "")
641
642const iString *entryListPage_Feeds(void) { 641const iString *entryListPage_Feeds(void) {
643 iFeeds *d = &feeds_; 642 iFeeds *d = &feeds_;
644 iString *src = collectNew_String(); 643 iString *src = collectNew_String();
645 format_String(src, "# Feed entries\n\n"); 644 setCStr_String(src, translateCStr_Lang("# ${feeds.list.title}\n\n"));
646 lock_Mutex(d->mtx); 645 lock_Mutex(d->mtx);
647 const iPtrArray *subs = listSubscriptions_(); 646 const iPtrArray *subs = listSubscriptions_();
648 int elapsed = elapsedSeconds_Time(&d->lastRefreshedAt) / 60; 647 const int elapsed = elapsedSeconds_Time(&d->lastRefreshedAt) / 60;
649 appendFormat_String( 648 appendFormat_String(
650 src, 649 src,
651 "You are subscribed to %zu feed%s that contain%s a total of %zu entries.\n", 650 formatCStrs_Lang("feeds.list.counts.n", size_PtrArray(subs)),
652 size_PtrArray(subs), 651 formatCStrs_Lang("feeds.list.entrycount.n", size_SortedArray(&d->entries)));
653 iPluralS(size_PtrArray(subs)),
654 size_PtrArray(subs) == 1 ? "s" : "",
655 size_SortedArray(&d->entries));
656 if (isValid_Time(&d->lastRefreshedAt)) { 652 if (isValid_Time(&d->lastRefreshedAt)) {
657 appendFormat_String(src, 653 if (elapsed == 0) {
658 "\nThe latest refresh occurred %s.\n", 654 appendCStr_String(src, translateCStr_Lang("\n${feeds.list.refreshtime.now}\n"));
659 elapsed == 0 ? "just a moment ago" 655 }
660 : elapsed < 60 ? format_CStr("%d minute%s ago", elapsed, iPluralS(elapsed)) 656 else {
661 : elapsed < 1440 ? format_CStr("%d hour%s ago", elapsed / 60, iPluralS(elapsed / 60)) 657 appendFormat_String(src,
662 : format_CStr("%d day%s ago", elapsed / 1440, 658 translateCStr_Lang("\n${feeds.list.refreshtime}\n"),
663 iPluralS(elapsed / 1440))); 659 elapsed < 60 ? formatCStr_Lang("minutes.ago.n", elapsed)
660 : elapsed < 1440 ? formatCStr_Lang("hours.ago.n", elapsed / 60)
661 : formatCStr_Lang("days.ago.n", elapsed / 1440));
662 }
664 } 663 }
665 iDate on; 664 iDate on;
666 iZap(on); 665 iZap(on);
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index ff89f5ec..e4dadeff 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -3222,7 +3222,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) {
3222 draw_Text(metaFont, 3222 draw_Text(metaFont,
3223 topRight_Rect(linkRect), 3223 topRight_Rect(linkRect),
3224 tmInlineContentMetadata_ColorId, 3224 tmInlineContentMetadata_ColorId,
3225 " \u2014 Fetching\u2026 (%.1f MB)", 3225 translateCStr_Lang(" \u2014 ${doc.fetching}\u2026 (%.1f ${mb})"),
3226 (float) bodySize_GmRequest(mr->req) / 1.0e6f); 3226 (float) bodySize_GmRequest(mr->req) / 1.0e6f);
3227 } 3227 }
3228 } 3228 }
diff --git a/src/ui/mediaui.c b/src/ui/mediaui.c
index 2fad0cec..24b29cb0 100644
--- a/src/ui/mediaui.c
+++ b/src/ui/mediaui.c
@@ -27,6 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
27#include "audio/player.h" 27#include "audio/player.h"
28#include "paint.h" 28#include "paint.h"
29#include "util.h" 29#include "util.h"
30#include "lang.h"
30 31
31#include <the_Foundation/path.h> 32#include <the_Foundation/path.h>
32 33
@@ -258,16 +259,17 @@ void draw_DownloadUI(const iDownloadUI *d, iPaint *p) {
258 draw_Text(uiLabel_FontId, 259 draw_Text(uiLabel_FontId,
259 init_I2(x, y2), 260 init_I2(x, y2),
260 isFinished ? uiTextAction_ColorId : uiTextDim_ColorId, 261 isFinished ? uiTextAction_ColorId : uiTextDim_ColorId,
261 isFinished ? "Download completed." 262 cstr_Lang(isFinished ? "media.download.complete" : "media.download.warnclose"));
262 : "Download will be cancelled if this tab is closed.");
263 const int x2 = right_Rect(rect); 263 const int x2 = right_Rect(rect);
264 drawSevenSegmentBytes_(init_I2(x2, y1), uiTextDim_ColorId, info.numBytes); 264 drawSevenSegmentBytes_(init_I2(x2, y1), uiTextDim_ColorId, info.numBytes);
265 const iInt2 pos = init_I2(x2, y2); 265 const iInt2 pos = init_I2(x2, y2);
266 if (bytesPerSecond > 0) { 266 if (bytesPerSecond > 0) {
267 drawAlign_Text(uiLabel_FontId, pos, uiTextDim_ColorId, right_Alignment, "%.3f MB/s", 267 drawAlign_Text(uiLabel_FontId, pos, uiTextDim_ColorId, right_Alignment,
268 translateCStr_Lang("%.3f ${mb.per.sec}"),
268 bytesPerSecond / 1.0e6); 269 bytesPerSecond / 1.0e6);
269 } 270 }
270 else { 271 else {
271 drawAlign_Text(uiLabel_FontId, pos, uiTextDim_ColorId, right_Alignment, "\u2014 MB/s"); 272 drawAlign_Text(uiLabel_FontId, pos, uiTextDim_ColorId, right_Alignment,
273 translateCStr_Lang("\u2014 ${mb.per.sec}"));
272 } 274 }
273} 275}