diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-05 12:21:28 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-05 12:21:28 +0300 |
commit | fe0167daef135089a32c64254c1a90dd2aa42172 (patch) | |
tree | 9c815b52bac698bce52f4774ac91e3545c64dee8 | |
parent | 6000db343bb2c1b44bed9eb4b14a179f839f3aa7 (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.po | 87 | ||||
-rw-r--r-- | res/lang/en.bin | bin | 16083 -> 16948 bytes | |||
-rw-r--r-- | res/lang/es.bin | bin | 18079 -> 18557 bytes | |||
-rw-r--r-- | res/lang/fi.bin | bin | 17740 -> 18218 bytes | |||
-rw-r--r-- | res/lang/ie.bin | bin | 17249 -> 17727 bytes | |||
-rw-r--r-- | res/lang/ru.bin | bin | 27064 -> 27542 bytes | |||
-rw-r--r-- | res/lang/sr.bin | bin | 25569 -> 26047 bytes | |||
-rw-r--r-- | res/lang/zh_Hans.bin | bin | 15648 -> 16126 bytes | |||
-rw-r--r-- | res/lang/zh_Hant.bin | bin | 15731 -> 16209 bytes | |||
-rw-r--r-- | src/audio/player.c | 21 | ||||
-rw-r--r-- | src/feeds.c | 31 | ||||
-rw-r--r-- | src/ui/documentwidget.c | 2 | ||||
-rw-r--r-- | src/ui/mediaui.c | 10 |
13 files changed, 122 insertions, 29 deletions
@@ -1,6 +1,90 @@ | |||
1 | msgid "doc.pre.nocaption" | 1 | msgid "doc.pre.nocaption" |
2 | msgstr "Preformatted text without a caption" | 2 | msgstr "Preformatted text without a caption" |
3 | 3 | ||
4 | # Link download progress message. | ||
5 | msgid "doc.fetching" | ||
6 | msgstr "Fetching" | ||
7 | |||
8 | # Inline download status message. | ||
9 | msgid "media.download.warnclose" | ||
10 | msgstr "Download will be cancelled if this tab is closed." | ||
11 | |||
12 | # Inline download status message. | ||
13 | msgid "media.download.complete" | ||
14 | msgstr "Download completed." | ||
15 | |||
16 | # Used in inline audio player metadata popup. | ||
17 | msgid "audio.meta.title" | ||
18 | msgstr "Title" | ||
19 | |||
20 | # Used in inline audio player metadata popup. | ||
21 | msgid "audio.meta.artist" | ||
22 | msgstr "Artist" | ||
23 | |||
24 | # Used in inline audio player metadata popup. | ||
25 | msgid "audio.meta.genre" | ||
26 | msgstr "Genre" | ||
27 | |||
28 | # Used in inline audio player metadata popup. | ||
29 | msgid "audio.meta.date" | ||
30 | msgstr "Date" | ||
31 | |||
32 | # used as adjective, n is 8, 16, 24, 32, or 64 | ||
33 | #, c-format | ||
34 | msgid "n.bit" | ||
35 | msgstr "%d-bit" | ||
36 | |||
37 | msgid "numbertype.integer" | ||
38 | msgstr "integer" | ||
39 | |||
40 | msgid "numbertype.float" | ||
41 | msgstr "float" | ||
42 | |||
43 | # Hertz, unit for frequency values | ||
44 | msgid "hz" | ||
45 | msgstr "Hz" | ||
46 | |||
47 | # Used in about:feeds. | ||
48 | msgid "feeds.list.title" | ||
49 | msgstr "Feed entries" | ||
50 | |||
51 | #, c-format | ||
52 | msgid "feeds.list.counts" | ||
53 | msgid_plural "feeds.list.counts.n" | ||
54 | msgstr[0] "You are subscribed to %zu feed that contains %%s.\n" | ||
55 | msgstr[1] "You are subscribed to %zu feeds that contain %%s.\n" | ||
56 | |||
57 | #, c-format | ||
58 | msgid "feeds.list.entrycount" | ||
59 | msgid_plural "feeds.list.entrycount.n" | ||
60 | msgstr[0] " a total of %zu entry" | ||
61 | msgstr[1] " a total of %zu entries" | ||
62 | |||
63 | msgid "feeds.list.refreshtime.now" | ||
64 | msgstr "The latest refresh occurred just a moment ago." | ||
65 | |||
66 | #, c-format | ||
67 | msgid "feeds.list.refreshtime" | ||
68 | msgstr "The latest refresh occurred %s." | ||
69 | |||
70 | #, c-format | ||
71 | msgid "minutes.ago" | ||
72 | msgid_plural "minutes.ago.n" | ||
73 | msgstr[0] "%d minute ago" | ||
74 | msgstr[1] "%d minutes ago" | ||
75 | |||
76 | #, c-format | ||
77 | msgid "hours.ago" | ||
78 | msgid_plural "hours.ago.n" | ||
79 | msgstr[0] "%d hour ago" | ||
80 | msgstr[1] "%d hours ago" | ||
81 | |||
82 | #, c-format | ||
83 | msgid "days.ago" | ||
84 | msgid_plural "days.ago.n" | ||
85 | msgstr[0] "%d day ago" | ||
86 | msgstr[1] "%d days ago" | ||
87 | |||
4 | # Alt-text of the preformatted logo. | 88 | # Alt-text of the preformatted logo. |
5 | msgid "about.logo" | 89 | msgid "about.logo" |
6 | msgstr "ASCII art: the word \"Lagrange\" using a large font" | 90 | msgstr "ASCII art: the word \"Lagrange\" using a large font" |
@@ -269,6 +353,9 @@ msgstr "Updating Feeds" | |||
269 | msgid "mb" | 353 | msgid "mb" |
270 | msgstr "MB" | 354 | msgstr "MB" |
271 | 355 | ||
356 | msgid "mb.per.sec" | ||
357 | msgstr "MB/s" | ||
358 | |||
272 | # kilobytes, used as the unit after a number | 359 | # kilobytes, used as the unit after a number |
273 | msgid "kb" | 360 | msgid "kb" |
274 | msgstr "KB" | 361 | msgstr "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 | |||
642 | const iString *entryListPage_Feeds(void) { | 641 | const 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 | } |