From 6c6f7a0303405536f634d0f694288c79f076edda Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 23 Mar 2021 10:29:14 +0200 Subject: Lang: Applied string IDs everywhere More or less everywhere? IssueID #192 --- po/compile.py | 41 +- po/en.po | 453 ++++++++++++++++ po/ru.po | 1340 +++++++++++++++++++++++++++++++++++++++++++++++ res/lang/en.bin | Bin 6816 -> 11317 bytes src/macos.m | 1 + src/ui/bindingswidget.c | 12 +- src/ui/inputwidget.c | 2 + src/ui/keys.c | 58 +- src/ui/sidebarwidget.c | 3 +- src/ui/translation.c | 4 +- src/ui/util.c | 254 ++++----- 11 files changed, 1991 insertions(+), 177 deletions(-) create mode 100644 po/ru.po diff --git a/po/compile.py b/po/compile.py index 6e565733..650dc3eb 100755 --- a/po/compile.py +++ b/po/compile.py @@ -2,8 +2,9 @@ # Parses all the .po files and generates binary language strings to be loaded # at runtime via embedded data. -import os +import os, sys +MODE = 'compile' ESCAPES = { '\\': '\\', '"': '"', @@ -12,6 +13,9 @@ ESCAPES = { 't': '\t' } +if '--new' in sys.argv: + MODE = 'new' + def unquote(string): txt = string.strip() @@ -30,12 +34,10 @@ def unquote(string): else: out += c return out - - -messages = [] -for src in os.listdir('.'): - if not src.endswith('.po'): - continue + + +def parse_po(src): + messages = [] msg_id, msg_str = None, None for line in open(src, 'rt', encoding='utf-8').readlines(): line = line.strip() @@ -44,12 +46,23 @@ for src in os.listdir('.'): elif line.startswith('msgstr'): msg_str = unquote(line[7:]) messages.append((msg_id, msg_str)) - # Make a binary blob with strings sorted by ID. - compiled = bytes() - for msg in sorted(messages): - compiled += msg[0].encode('utf-8') + bytes([0]) - compiled += msg[1].encode('utf-8') + bytes([0]) - #print(compiled) - open(f'../res/lang/{src[:-3]}.bin', 'wb').write(compiled) + return messages + +if MODE == 'compile': + for src in os.listdir('.'): + if src.endswith('.po'): + # Make a binary blob with strings sorted by ID. + compiled = bytes() + for msg in sorted(parse_po(src)): + compiled += msg[0].encode('utf-8') + bytes([0]) + compiled += msg[1].encode('utf-8') + bytes([0]) + open(f'../res/lang/{src[:-3]}.bin', 'wb').write(compiled) + +elif MODE == 'new': + messages = parse_po('en.po') + f = open('new.po', 'wt', encoding='utf-8') + for msg_id, _ in messages: + print(f'\nmsgid "{msg_id}"\nmsgstr ""\n', file=f) + diff --git a/po/en.po b/po/en.po index 27948b3c..a00eaee5 100644 --- a/po/en.po +++ b/po/en.po @@ -16,6 +16,18 @@ msgstr "Cancel" msgid "dismiss" msgstr "Dismiss" +msgid "dlg.message.ok" +msgstr "Continue" + +msgid "dlg.default" +msgstr " OK " + +msgid "toggle.yes" +msgstr "YES" + +msgid "toggle.no" +msgstr "NO" + msgid "menu.title.file" msgstr "File" @@ -175,6 +187,12 @@ msgstr "Subscribe to Page…" msgid "menu.aboutpages" msgstr "About Pages" +msgid "menu.about" +msgstr "About" + +msgid "panel.back" +msgstr "Back" + msgid "menu.debug" msgstr "Debug Information" @@ -581,3 +599,438 @@ msgstr "View Image" msgid "bookmark.title.blank" msgstr "Blank Page" +msgid "heading.translate" +msgstr "TRANSLATE PAGE" + +msgid "dlg.translate.unavail" +msgstr "Service Unavailable" + +msgid "dlg.translate.fail" +msgstr "Request Failed" + +msgid "dlg.translate" +msgstr "Translate" + +msgid "dlg.translate.from" +msgstr "From:" + +msgid "dlg.translate.to" +msgstr "To:" + +msgid "lang.ar" +msgstr "Arabic" + +msgid "lang.zh" +msgstr "Chinese" + +msgid "lang.en" +msgstr "English" + +msgid "lang.fr" +msgstr "French" + +msgid "lang.de" +msgstr "German" + +msgid "lang.hi" +msgstr "Hindi" + +msgid "lang.it" +msgstr "Italian" + +msgid "lang.ja" +msgstr "Japanese" + +msgid "lang.pt" +msgstr "Portuguese" + +msgid "lang.ru" +msgstr "Russian" + +msgid "lang.es" +msgstr "Spanish" + +msgid "heading.newident" +msgstr "NEW IDENTITY" + +msgid "dlg.newident.rsa.selfsign" +msgstr "Creating a self-signed 2048-bit RSA certificate." + +msgid "dlg.newident.until" +msgstr "Valid until:" + +msgid "hint.newident.date" +msgstr "YYYY-MM-DD HH:MM:SS" + +msgid "hint.newident.optional" +msgstr "optional" + +msgid "dlg.newident.commonname" +msgstr "Common name:" + +msgid "dlg.newident.temp" +msgstr "Temporary:" + +msgid "dlg.newident.notsaved" +msgstr "not saved to disk" + +msgid "dlg.newident.email" +msgstr "Email:" + +msgid "dlg.newident.userid" +msgstr "User ID:" + +msgid "dlg.newident.domain" +msgstr "Domain:" + +msgid "dlg.newident.org" +msgstr "Organization:" + +msgid "dlg.newident.country" +msgstr "Country:" + +msgid "dlg.newident.create" +msgstr "Create Identity" + +msgid "heading.feedcfg" +msgstr "FEED SETTINGS" + +msgid "heading.subscribe" +msgstr "SUBSCRIBE TO PAGE" + +msgid "dlg.feed.title" +msgstr "Title:" + +msgid "dlg.feed.entrytype" +msgstr "Entry type:" + +msgid "dlg.feed.type.gemini" +msgstr "YYYY-MM-DD Links" + +msgid "dlg.feed.type.headings" +msgstr "New Headings" + +msgid "dlg.feed.save" +msgstr "Save Settings" + +msgid "dlg.feed.sub" +msgstr "Subscribe" + +msgid "heading.bookmark.add" +msgstr "ADD BOOKMARK" + +msgid "heading.bookmark.edit" +msgstr "EDIT BOOKMARK" + +msgid "dlg.bookmark.save" +msgstr "Save Bookmark" + +msgid "dlg.bookmark.title" +msgstr "Title:" + +msgid "dlg.bookmark.url" +msgstr "URL:" + +msgid "dlg.bookmark.tags" +msgstr "Tags:" + +msgid "dlg.bookmark.icon" +msgstr "Icon:" + +msgid "heading.prefs" +msgstr "PREFERENCES" + +msgid "heading.prefs.certs" +msgstr "CERTIFICATES" + +# tab button +msgid "heading.prefs.colors" +msgstr "Colors" + +msgid "heading.prefs.fonts" +msgstr "FONTS" + +# tab button +msgid "heading.prefs.general" +msgstr "General" + +# tab button +msgid "heading.prefs.interface" +msgstr "Interface" + +# tab button +msgid "heading.prefs.keys" +msgstr "Keys" + +# tab button +msgid "heading.prefs.network" +msgstr "Network" + +msgid "heading.prefs.paragraph" +msgstr "PARAGRAPH" + +msgid "heading.prefs.pagecontent" +msgstr "PAGE CONTENT" + +msgid "heading.prefs.proxies" +msgstr "PROXIES" + +msgid "heading.prefs.scrolling" +msgstr "SCROLLING" + +msgid "heading.prefs.sizing" +msgstr "SIZING" + +msgid "heading.prefs.widelayout" +msgstr "WIDE LAYOUT" + +# tab button +msgid "heading.prefs.style" +msgstr "Style" + +# tab button +msgid "heading.prefs.userinterface" +msgstr "User Interface" + +msgid "prefs.downloads" +msgstr "Donwloads folder:" + +msgid "prefs.searchurl" +msgstr "Search URL:" + +msgid "prefs.hoverlink" +msgstr "Show URL on hover:" + +msgid "prefs.centershort" +msgstr "Vertical centering:" + +msgid "prefs.smoothscroll" +msgstr "Smooth scrolling:" + +msgid "prefs.imageloadscroll" +msgstr "Load image on scroll:" + +msgid "prefs.hidetoolbarscroll" +msgstr "Hide toolbar on scroll:" + +msgid "prefs.ostheme" +msgstr "Use system theme:" + +msgid "prefs.theme" +msgstr "Theme:" + +msgid "prefs.theme.black" +msgstr "Pure Black" + +msgid "prefs.theme.dark" +msgstr "Dark" + +msgid "prefs.theme.light" +msgstr "Light" + +msgid "prefs.theme.white" +msgstr "Pure White" + +msgid "prefs.accent" +msgstr "Accent color:" + +msgid "prefs.accent.teal" +msgstr "Teal" + +msgid "prefs.accent.orange" +msgstr "Orange" + +msgid "prefs.uiscale" +msgstr "UI scale factor:" + +msgid "prefs.customframe" +msgstr "Custom window frame:" + +msgid "prefs.retainwindow" +msgstr "Retain placement:" + +msgid "prefs.sideicon" +msgstr "Capsule icon:" + +msgid "prefs.doctheme.dark" +msgstr "Dark theme:" + +msgid "prefs.doctheme.light" +msgstr "Light theme:" + +msgid "prefs.doctheme.name.colorfuldark" +msgstr "Colorful Dark" + +msgid "prefs.doctheme.name.colorfullight" +msgstr "Colorful Light" + +msgid "prefs.doctheme.name.black" +msgstr "Black" + +msgid "prefs.doctheme.name.gray" +msgstr "Gray" + +msgid "prefs.doctheme.name.white" +msgstr "White" + +msgid "prefs.doctheme.name.sepia" +msgstr "Sepia" + +msgid "prefs.doctheme.name.highcontrast" +msgstr "High Contrast" + +msgid "prefs.saturation" +msgstr "Saturation:" + +msgid "prefs.headingfont" +msgstr "Heading font:" + +msgid "prefs.font" +msgstr "Body font:" + +msgid "prefs.mono" +msgstr "Monospace body:" + +msgid "prefs.mono.gemini" +msgstr "Gemini" + +msgid "prefs.mono.gopher" +msgstr "Gopher" + +msgid "prefs.linewidth" +msgstr "Line width:" + +msgid "prefs.linewidth.normal" +msgstr "Normal" + +msgid "prefs.linewidth.fill" +msgstr "Fill" + +msgid "prefs.quoteicon" +msgstr "Quote indicator:" + +msgid "prefs.quoteicon.icon" +msgstr "\" Icon" + +msgid "prefs.quoteicon.line" +msgstr "Line" + +msgid "prefs.biglede" +msgstr "Big 1st paragaph:" + +msgid "prefs.plaintext.wrap" +msgstr "Wrap plain text:" + +msgid "prefs.decodeurls" +msgstr "Decode URLs:" + +msgid "prefs.cachesize" +msgstr "Cache size:" + +msgid "prefs.ca.file" +msgstr "CA file:" + +msgid "prefs.ca.path" +msgstr "CA path:" + +msgid "prefs.proxy.gemini" +msgstr "Gemini proxy:" + +msgid "prefs.proxy.gopher" +msgstr "Gopher proxy:" + +msgid "prefs.proxy.http" +msgstr "HTTP proxy:" + +msgid "menu.binding.reset" +msgstr "Reset to Default" + +msgid "menu.binding.clear" +msgstr "Remove" + +msgid "keys.top" +msgstr "Jump to top" + +msgid "keys.bottom" +msgstr "Jump to bottom" + +msgid "keys.scroll.up" +msgstr "Scroll up" + +msgid "keys.scroll.down" +msgstr "Scroll down" + +msgid "keys.scroll.halfpage.up" +msgstr "Scroll up half a page" + +msgid "keys.scroll.halfpage.down" +msgstr "Scroll down half a page" + +msgid "keys.scroll.page.up" +msgstr "Scroll up a page" + +msgid "keys.scroll.page.down" +msgstr "Scroll down a page" + +msgid "keys.back" +msgstr "Go back" + +msgid "keys.forward" +msgstr "Go forward" + +msgid "keys.parent" +msgstr "Go to parent directory" + +msgid "keys.root" +msgstr "Go to capsule root" + +msgid "keys.reload" +msgstr "Reload page" + +msgid "keys.link.modkey" +msgstr "Open link via modifier key" + +msgid "keys.link.homerow" +msgstr "Open link via home row keys" + +msgid "keys.link.homerow.newtab" +msgstr "Open link in new tab via home row keys" + +msgid "keys.link.homerow.hover" +msgstr "Hover on link via home row keys" + +msgid "keys.link.homerow.next" +msgstr "Next set of home row key links" + +msgid "keys.bookmark.add" +msgstr "Add bookmark" + +msgid "keys.findtext" +msgstr "Find text on page" + +msgid "keys.zoom.in" +msgstr "Zoom in" + +msgid "keys.zoom.out" +msgstr "Zoom out" + +msgid "keys.zoom.reset" +msgstr "Reset zoom" + +msgid "keys.fullscreen" +msgstr "Toggle fullscreen mode" + +msgid "keys.tab.new" +msgstr "New tab" + +msgid "keys.tab.close" +msgstr "Close tab" + +msgid "keys.tab.prev" +msgstr "Previous tab" + +msgid "keys.tab.next" +msgstr "Next tab" + +msgid "keys.hoverurl" +msgstr "Toggle show URL on hover" diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 00000000..8abcf95b --- /dev/null +++ b/po/ru.po @@ -0,0 +1,1340 @@ + +msgid "about.logo" +msgstr "" + + +msgid "about.tagline" +msgstr "" + + +msgid "about.version" +msgstr "" + + +msgid "about.powered" +msgstr "" + + +msgid "cancel" +msgstr "" + + +msgid "dismiss" +msgstr "" + + +msgid "dlg.message.ok" +msgstr "" + + +msgid "dlg.default" +msgstr "" + + +msgid "toggle.yes" +msgstr "" + + +msgid "toggle.no" +msgstr "" + + +msgid "menu.title.file" +msgstr "" + + +msgid "menu.title.edit" +msgstr "" + + +msgid "menu.title.view" +msgstr "" + + +msgid "menu.title.bookmarks" +msgstr "" + + +msgid "menu.title.identity" +msgstr "" + + +msgid "menu.title.help" +msgstr "" + + +msgid "menu.newtab" +msgstr "" + + +msgid "menu.closetab" +msgstr "" + + +msgid "menu.closetab.other" +msgstr "" + + +msgid "menu.closetab.left" +msgstr "" + + +msgid "menu.closetab.right" +msgstr "" + + +msgid "menu.duptab" +msgstr "" + + +msgid "menu.openlocation" +msgstr "" + + +msgid "menu.find" +msgstr "" + + +msgid "macos.menu.find" +msgstr "" + + +msgid "menu.save.files" +msgstr "" + + +msgid "menu.save.downloads" +msgstr "" + + +msgid "menu.copy.source" +msgstr "" + + +msgid "menu.sidebar" +msgstr "" + + +msgid "menu.sidebar.left" +msgstr "" + + +msgid "menu.sidebar.right" +msgstr "" + + +msgid "menu.zoom.in" +msgstr "" + + +msgid "menu.zoom.out" +msgstr "" + + +msgid "menu.zoom.reset" +msgstr "" + + +msgid "menu.bookmarks.list" +msgstr "" + + +msgid "macos.menu.bookmarks.list" +msgstr "" + + +msgid "menu.bookmarks.bytag" +msgstr "" + + +msgid "macos.menu.bookmarks.bytag" +msgstr "" + + +msgid "menu.bookmarks.bytime" +msgstr "" + + +msgid "macos.menu.bookmarks.bytime" +msgstr "" + + +msgid "menu.feeds.entrylist" +msgstr "" + + +msgid "menu.preferences" +msgstr "" + + +msgid "menu.help" +msgstr "" + + +msgid "menu.releasenotes" +msgstr "" + + +msgid "menu.quit" +msgstr "" + + +msgid "menu.cut" +msgstr "" + + +msgid "menu.copy" +msgstr "" + + +msgid "menu.paste" +msgstr "" + + +msgid "menu.copy.pagelink" +msgstr "" + + +msgid "menu.show.bookmarks" +msgstr "" + + +msgid "menu.show.feeds" +msgstr "" + + +msgid "menu.show.history" +msgstr "" + + +msgid "menu.show.identities" +msgstr "" + + +msgid "menu.show.outline" +msgstr "" + + +msgid "menu.back" +msgstr "" + + +msgid "menu.forward" +msgstr "" + + +msgid "menu.parent" +msgstr "" + + +msgid "menu.root" +msgstr "" + + +msgid "menu.reload" +msgstr "" + + +msgid "menu.autoreload" +msgstr "" + + +msgid "menu.page.bookmark" +msgstr "" + + +msgid "menu.page.subscribe" +msgstr "" + + +msgid "menu.aboutpages" +msgstr "" + + +msgid "menu.about" +msgstr "" + + +msgid "panel.back" +msgstr "" + + +msgid "menu.debug" +msgstr "" + + +msgid "menu.import.links" +msgstr "" + + +msgid "menu.page.import" +msgstr "" + + +msgid "menu.page.translate" +msgstr "" + + +msgid "menu.page.copyurl" +msgstr "" + + +msgid "menu.page.copysource" +msgstr "" + + +msgid "menu.bookmarks.refresh" +msgstr "" + + +msgid "menu.feeds.refresh" +msgstr "" + + +msgid "menu.identity.new" +msgstr "" + + +msgid "menu.identity.import" +msgstr "" + + +msgid "menu.identity.notactive" +msgstr "" + + +msgid "sidebar.bookmarks" +msgstr "" + + +msgid "sidebar.feeds" +msgstr "" + + +msgid "sidebar.history" +msgstr "" + + +msgid "sidebar.identities" +msgstr "" + + +msgid "sidebar.outline" +msgstr "" + + +msgid "sidebar.unread" +msgstr "" + + +msgid "toolbar.outline" +msgstr "" + + +msgid "hint.findtext" +msgstr "" + + +msgid "status.query" +msgstr "" + + +msgid "status.feeds" +msgstr "" + + +msgid "mb" +msgstr "" + + +msgid "kb" +msgstr "" + + +msgid "bytes" +msgstr "" + + +msgid "page.timestamp" +msgstr "" + + +msgid "sidebar.date.thisyear" +msgstr "" + + +msgid "sidebar.date.otheryear" +msgstr "" + + +msgid "feeds.today" +msgstr "" + + +msgid "feeds.entry.newtab" +msgstr "" + + +msgid "feeds.entry.markread" +msgstr "" + + +msgid "feeds.entry.markunread" +msgstr "" + + +msgid "sidebar.entry.bookmark" +msgstr "" + + +msgid "feeds.entry.bookmark" +msgstr "" + + +msgid "feeds.entry.openfeed" +msgstr "" + + +msgid "feeds.edit" +msgstr "" + + +msgid "feeds.unsubscribe" +msgstr "" + + +msgid "feeds.markallread" +msgstr "" + + +msgid "feeds.refresh" +msgstr "" + + +msgid "menu.opentab" +msgstr "" + + +msgid "menu.opentab.background" +msgstr "" + + +msgid "menu.edit" +msgstr "" + + +msgid "menu.dup" +msgstr "" + + +msgid "menu.copyurl" +msgstr "" + + +msgid "menu.forgeturl" +msgstr "" + + +msgid "history.clear" +msgstr "" + + +msgid "heading.history.clear" +msgstr "" + + +msgid "dlg.confirm.history.clear" +msgstr "" + + +msgid "dlg.history.clear" +msgstr "" + + +msgid "bookmark.tag.home" +msgstr "" + + +msgid "bookmark.tag.sub" +msgstr "" + + +msgid "bookmark.tag.remote" +msgstr "" + + +msgid "bookmark.untag.home" +msgstr "" + + +msgid "bookmark.untag.sub" +msgstr "" + + +msgid "bookmark.untag.remote" +msgstr "" + + +msgid "bookmark.delete" +msgstr "" + + +msgid "bookmarks.reload" +msgstr "" + + +msgid "ident.using" +msgstr "" + + +msgid "ident.notused" +msgstr "" + + +msgid "ident.usedonurls" +msgstr "" + + +msgid "ident.temporary" +msgstr "" + + +msgid "ident.expiry" +msgstr "" + + +msgid "ident.use" +msgstr "" + + +msgid "ident.stopuse" +msgstr "" + + +msgid "ident.stopuse.all" +msgstr "" + + +msgid "ident.showuse" +msgstr "" + + +msgid "heading.ident.use" +msgstr "" + + +msgid "menu.edit.notes" +msgstr "" + + +msgid "heading.ident.notes" +msgstr "" + + +msgid "dlg.ident.notes" +msgstr "" + + +msgid "ident.fingerprint" +msgstr "" + + +msgid "ident.delete" +msgstr "" + + +msgid "heading.ident.delete" +msgstr "" + + +msgid "dlg.confirm.ident.delete" +msgstr "" + + +msgid "dlg.ident.delete" +msgstr "" + + +msgid "sidebar.empty.idents" +msgstr "" + + +msgid "ident.gotohelp" +msgstr "" + + +msgid "heading.unsub" +msgstr "" + + +msgid "dlg.confirm.unsub" +msgstr "" + + +msgid "dlg.unsub" +msgstr "" + + +msgid "error.unsupported.suggestsave" +msgstr "" + + +msgid "heading.pageinfo" +msgstr "" + + +msgid "pageinfo.header.cached" +msgstr "" + + +msgid "pageinfo.cert.status" +msgstr "" + + +msgid "pageinfo.cert.ca.verified" +msgstr "" + + +msgid "pageinfo.cert.ca.unverified" +msgstr "" + + +msgid "pageinfo.cert.notexpired" +msgstr "" + + +msgid "pageinfo.cert.expired" +msgstr "" + + +msgid "pageinfo.cert.trusted" +msgstr "" + + +msgid "pageinfo.cert.untrusted" +msgstr "" + + +msgid "pageinfo.domain.match" +msgstr "" + + +msgid "pageinfo.domain.mismatch" +msgstr "" + + +msgid "dlg.cert.trust" +msgstr "" + + +msgid "dlg.cert.fingerprint" +msgstr "" + + +msgid "dlg.input.prompt" +msgstr "" + + +msgid "dlg.input.send" +msgstr "" + + +msgid "heading.save" +msgstr "" + + +msgid "heading.save.incomplete" +msgstr "" + + +msgid "dlg.save.incomplete" +msgstr "" + + +msgid "dlg.save.size" +msgstr "" + + +msgid "heading.save.error" +msgstr "" + + +msgid "heading.import.bookmarks" +msgstr "" + + +msgid "dlg.import.found" +msgstr "" + + +msgid "dlg.import.found.many" +msgstr "" + + +msgid "dlg.import.add" +msgstr "" + + +msgid "dlg.import.add.many" +msgstr "" + + +msgid "dlg.import.notnew" +msgstr "" + + +msgid "heading.autoreload" +msgstr "" + + +msgid "dlg.autoreload" +msgstr "" + + +msgid "link.newtab" +msgstr "" + + +msgid "link.newtab.background" +msgstr "" + + +msgid "link.browser" +msgstr "" + + +msgid "link.noproxy" +msgstr "" + + +msgid "link.copy" +msgstr "" + + +msgid "link.bookmark" +msgstr "" + + +msgid "link.download" +msgstr "" + + +msgid "heading.openlink" +msgstr "" + + +msgid "dlg.openlink.confirm" +msgstr "" + + +msgid "dlg.openlink" +msgstr "" + + +msgid "heading.certwarn" +msgstr "" + + +msgid "dlg.certwarn.mayberenewed" +msgstr "" + + +msgid "dlg.certwarn.different" +msgstr "" + + +msgid "dlg.certwarn.expired" +msgstr "" + + +msgid "dlg.certwarn.domain" +msgstr "" + + +msgid "dlg.certwarn.domain.expired" +msgstr "" + + +msgid "link.hint.audio" +msgstr "" + + +msgid "link.hint.image" +msgstr "" + + +msgid "bookmark.title.blank" +msgstr "" + + +msgid "heading.translate" +msgstr "" + + +msgid "dlg.translate.unavail" +msgstr "" + + +msgid "dlg.translate.fail" +msgstr "" + + +msgid "dlg.translate" +msgstr "" + + +msgid "dlg.translate.from" +msgstr "" + + +msgid "dlg.translate.to" +msgstr "" + + +msgid "lang.ar" +msgstr "" + + +msgid "lang.zh" +msgstr "" + + +msgid "lang.en" +msgstr "" + + +msgid "lang.fr" +msgstr "" + + +msgid "lang.de" +msgstr "" + + +msgid "lang.hi" +msgstr "" + + +msgid "lang.it" +msgstr "" + + +msgid "lang.ja" +msgstr "" + + +msgid "lang.pt" +msgstr "" + + +msgid "lang.ru" +msgstr "" + + +msgid "lang.es" +msgstr "" + + +msgid "heading.newident" +msgstr "" + + +msgid "dlg.newident.rsa.selfsign" +msgstr "" + + +msgid "dlg.newident.until" +msgstr "" + + +msgid "hint.newident.date" +msgstr "" + + +msgid "hint.newident.optional" +msgstr "" + + +msgid "dlg.newident.commonname" +msgstr "" + + +msgid "dlg.newident.temp" +msgstr "" + + +msgid "dlg.newident.notsaved" +msgstr "" + + +msgid "dlg.newident.email" +msgstr "" + + +msgid "dlg.newident.userid" +msgstr "" + + +msgid "dlg.newident.domain" +msgstr "" + + +msgid "dlg.newident.org" +msgstr "" + + +msgid "dlg.newident.country" +msgstr "" + + +msgid "dlg.newident.create" +msgstr "" + + +msgid "heading.feedcfg" +msgstr "" + + +msgid "heading.subscribe" +msgstr "" + + +msgid "dlg.feed.title" +msgstr "" + + +msgid "dlg.feed.entrytype" +msgstr "" + + +msgid "dlg.feed.type.gemini" +msgstr "" + + +msgid "dlg.feed.type.headings" +msgstr "" + + +msgid "dlg.feed.save" +msgstr "" + + +msgid "dlg.feed.sub" +msgstr "" + + +msgid "heading.bookmark.add" +msgstr "" + + +msgid "heading.bookmark.edit" +msgstr "" + + +msgid "dlg.bookmark.save" +msgstr "" + + +msgid "dlg.bookmark.title" +msgstr "" + + +msgid "dlg.bookmark.url" +msgstr "" + + +msgid "dlg.bookmark.tags" +msgstr "" + + +msgid "dlg.bookmark.icon" +msgstr "" + + +msgid "heading.prefs" +msgstr "" + + +msgid "heading.prefs.certs" +msgstr "" + + +msgid "heading.prefs.colors" +msgstr "" + + +msgid "heading.prefs.fonts" +msgstr "" + + +msgid "heading.prefs.general" +msgstr "" + + +msgid "heading.prefs.interface" +msgstr "" + + +msgid "heading.prefs.keys" +msgstr "" + + +msgid "heading.prefs.network" +msgstr "" + + +msgid "heading.prefs.paragraph" +msgstr "" + + +msgid "heading.prefs.pagecontent" +msgstr "" + + +msgid "heading.prefs.proxies" +msgstr "" + + +msgid "heading.prefs.scrolling" +msgstr "" + + +msgid "heading.prefs.sizing" +msgstr "" + + +msgid "heading.prefs.widelayout" +msgstr "" + + +msgid "heading.prefs.style" +msgstr "" + + +msgid "heading.prefs.userinterface" +msgstr "" + + +msgid "prefs.downloads" +msgstr "" + + +msgid "prefs.searchurl" +msgstr "" + + +msgid "prefs.hoverlink" +msgstr "" + + +msgid "prefs.centershort" +msgstr "" + + +msgid "prefs.smoothscroll" +msgstr "" + + +msgid "prefs.imageloadscroll" +msgstr "" + + +msgid "prefs.hidetoolbarscroll" +msgstr "" + + +msgid "prefs.ostheme" +msgstr "" + + +msgid "prefs.theme" +msgstr "" + + +msgid "prefs.theme.black" +msgstr "" + + +msgid "prefs.theme.dark" +msgstr "" + + +msgid "prefs.theme.light" +msgstr "" + + +msgid "prefs.theme.white" +msgstr "" + + +msgid "prefs.accent" +msgstr "" + + +msgid "prefs.accent.teal" +msgstr "" + + +msgid "prefs.accent.orange" +msgstr "" + + +msgid "prefs.uiscale" +msgstr "" + + +msgid "prefs.customframe" +msgstr "" + + +msgid "prefs.retainwindow" +msgstr "" + + +msgid "prefs.sideicon" +msgstr "" + + +msgid "prefs.doctheme.dark" +msgstr "" + + +msgid "prefs.doctheme.light" +msgstr "" + + +msgid "prefs.doctheme.name.colorfuldark" +msgstr "" + + +msgid "prefs.doctheme.name.colorfullight" +msgstr "" + + +msgid "prefs.doctheme.name.black" +msgstr "" + + +msgid "prefs.doctheme.name.gray" +msgstr "" + + +msgid "prefs.doctheme.name.white" +msgstr "" + + +msgid "prefs.doctheme.name.sepia" +msgstr "" + + +msgid "prefs.doctheme.name.highcontrast" +msgstr "" + + +msgid "prefs.saturation" +msgstr "" + + +msgid "prefs.headingfont" +msgstr "" + + +msgid "prefs.font" +msgstr "" + + +msgid "prefs.mono" +msgstr "" + + +msgid "prefs.mono.gemini" +msgstr "" + + +msgid "prefs.mono.gopher" +msgstr "" + + +msgid "prefs.linewidth" +msgstr "" + + +msgid "prefs.linewidth.normal" +msgstr "" + + +msgid "prefs.linewidth.fill" +msgstr "" + + +msgid "prefs.quoteicon" +msgstr "" + + +msgid "prefs.quoteicon.icon" +msgstr "" + + +msgid "prefs.quoteicon.line" +msgstr "" + + +msgid "prefs.biglede" +msgstr "" + + +msgid "prefs.plaintext.wrap" +msgstr "" + + +msgid "prefs.decodeurls" +msgstr "" + + +msgid "prefs.cachesize" +msgstr "" + + +msgid "prefs.ca.file" +msgstr "" + + +msgid "prefs.ca.path" +msgstr "" + + +msgid "prefs.proxy.gemini" +msgstr "" + + +msgid "prefs.proxy.gopher" +msgstr "" + + +msgid "prefs.proxy.http" +msgstr "" + + +msgid "menu.binding.reset" +msgstr "" + + +msgid "menu.binding.clear" +msgstr "" + + +msgid "keys.top" +msgstr "" + + +msgid "keys.bottom" +msgstr "" + + +msgid "keys.scroll.up" +msgstr "" + + +msgid "keys.scroll.down" +msgstr "" + + +msgid "keys.scroll.halfpage.up" +msgstr "" + + +msgid "keys.scroll.halfpage.down" +msgstr "" + + +msgid "keys.scroll.page.up" +msgstr "" + + +msgid "keys.scroll.page.down" +msgstr "" + + +msgid "keys.back" +msgstr "" + + +msgid "keys.forward" +msgstr "" + + +msgid "keys.parent" +msgstr "" + + +msgid "keys.root" +msgstr "" + + +msgid "keys.reload" +msgstr "" + + +msgid "keys.link.modkey" +msgstr "" + + +msgid "keys.link.homerow" +msgstr "" + + +msgid "keys.link.homerow.newtab" +msgstr "" + + +msgid "keys.link.homerow.hover" +msgstr "" + + +msgid "keys.link.homerow.next" +msgstr "" + + +msgid "keys.bookmark.add" +msgstr "" + + +msgid "keys.findtext" +msgstr "" + + +msgid "keys.zoom.in" +msgstr "" + + +msgid "keys.zoom.out" +msgstr "" + + +msgid "keys.zoom.reset" +msgstr "" + + +msgid "keys.fullscreen" +msgstr "" + + +msgid "keys.tab.new" +msgstr "" + + +msgid "keys.tab.close" +msgstr "" + + +msgid "keys.tab.prev" +msgstr "" + + +msgid "keys.tab.next" +msgstr "" + + +msgid "keys.hoverurl" +msgstr "" + diff --git a/res/lang/en.bin b/res/lang/en.bin index ab178d78..becb67ff 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/src/macos.m b/src/macos.m index 12575dd5..019533bd 100644 --- a/src/macos.m +++ b/src/macos.m @@ -369,6 +369,7 @@ void setupApplication_MacOS(void) { } void enableMenu_MacOS(const char *menuLabel, iBool enable) { + menuLabel = translateCStr_Lang(menuLabel); NSApplication *app = [NSApplication sharedApplication]; NSMenu *appMenu = [app mainMenu]; NSString *label = [NSString stringWithUTF8String:menuLabel]; diff --git a/src/ui/bindingswidget.c b/src/ui/bindingswidget.c index 558bdcd5..c73982b3 100644 --- a/src/ui/bindingswidget.c +++ b/src/ui/bindingswidget.c @@ -26,6 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "command.h" #include "util.h" #include "app.h" +#include "lang.h" #if defined (iPlatformAppleDesktop) # include "macos.h" #endif @@ -97,6 +98,7 @@ static void updateItems_BindingsWidget_(iBindingsWidget *d) { iBindingItem *item = new_BindingItem(); item->id = bind->id; set_String(&item->label, &bind->label); + translate_Lang(&item->label); toString_Sym(bind->key, bind->mods, &item->key); addItem_ListWidget(d->list, item); } @@ -118,8 +120,8 @@ void init_BindingsWidget(iBindingsWidget *d) { updateItems_BindingsWidget_(d); d->menu = makeMenu_Widget( w, - (iMenuItem[]){ { "Reset to Default", 0, 0, "binding.reset" }, - { uiTextCaution_ColorEscape "Clear", 0, 0, "binding.clear" } }, + (iMenuItem[]){ { "${menu.binding.reset}", 0, 0, "binding.reset" }, + { uiTextCaution_ColorEscape "${menu.binding.clear}", 0, 0, "binding.clear" } }, 2); } @@ -143,9 +145,9 @@ static void setActiveItem_BindingsWidget_(iBindingsWidget *d, size_t pos) { #if defined (iPlatformAppleDesktop) /* Native menus must be disabled while grabbing keys so the shortcuts don't trigger. */ const iBool enableNativeMenus = (d->activePos == iInvalidPos); - enableMenu_MacOS("Edit", enableNativeMenus); - enableMenu_MacOS("View", enableNativeMenus); - enableMenu_MacOS("Identity", enableNativeMenus); + enableMenu_MacOS("${menu.title.edit}", enableNativeMenus); + enableMenu_MacOS("${menu.title.view}", enableNativeMenus); + enableMenu_MacOS("${menu.title.identity}", enableNativeMenus); #endif } diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 699ed184..05b83b3d 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c @@ -26,6 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" #include "keys.h" #include "prefs.h" +#include "lang.h" #include "app.h" #include @@ -251,6 +252,7 @@ void setMaxLen_InputWidget(iInputWidget *d, size_t maxLen) { void setHint_InputWidget(iInputWidget *d, const char *hintText) { setCStr_String(&d->hint, hintText); + translate_Lang(&d->hint); /* TODO: Keep original for retranslations. */ } void setContentPadding_InputWidget(iInputWidget *d, int left, int right) { diff --git a/src/ui/keys.c b/src/ui/keys.c index 4d3f79f7..f59c5997 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c @@ -192,37 +192,37 @@ enum iBindFlag { /* TODO: This indirection could be used for localization, although all UI strings would need to be similarly handled. */ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] = { - { 1, { "Jump to top", SDLK_HOME, 0, "scroll.top" }, 0 }, - { 2, { "Jump to bottom", SDLK_END, 0, "scroll.bottom" }, 0 }, - { 10, { "Scroll up", SDLK_UP, 0, "scroll.step arg:-1" }, argRepeat_BindFlag }, - { 11, { "Scroll down", SDLK_DOWN, 0, "scroll.step arg:1" }, argRepeat_BindFlag }, - { 22, { "Scroll up half a page", SDLK_SPACE, KMOD_SHIFT, "scroll.page arg:-1" }, argRepeat_BindFlag }, - { 23, { "Scroll down half a page", SDLK_SPACE, 0, "scroll.page arg:1" }, argRepeat_BindFlag }, - { 24, { "Scroll up a page", SDLK_PAGEUP, 0, "scroll.page arg:-1 full:1" }, argRepeat_BindFlag }, - { 25, { "Scroll down a page", SDLK_PAGEDOWN, 0, "scroll.page arg:1 full:1" }, argRepeat_BindFlag }, - { 30, { "Go back", navigateBack_KeyShortcut, "navigate.back" }, 0 }, - { 31, { "Go forward", navigateForward_KeyShortcut, "navigate.forward" }, 0 }, - { 32, { "Go to parent directory", navigateParent_KeyShortcut, "navigate.parent" }, 0 }, - { 33, { "Go to site root", navigateRoot_KeyShortcut, "navigate.root" }, 0 }, - { 35, { "Reload page", reload_KeyShortcut, "document.reload" }, 0 }, - { 41, { "Open link via modifier key", SDLK_LALT, 0, "document.linkkeys arg:0" }, argRelease_BindFlag }, - { 42, { "Open link via home row keys", 'f', 0, "document.linkkeys arg:1" }, 0 }, - { 45, { "Open link in new tab via home row keys", 'f', KMOD_SHIFT, "document.linkkeys arg:1 newtab:1" }, 0 }, - { 46, { "Hover on link via home row keys", 'h', 0, "document.linkkeys arg:1 hover:1" }, 0 }, - { 47, { "Next set of home row key links", '.', 0, "document.linkkeys more:1" }, 0 }, - { 50, { "Add bookmark", 'd', KMOD_PRIMARY, "bookmark.add" }, 0 }, - { 60, { "Find text on page", 'f', KMOD_PRIMARY, "focus.set id:find.input" }, 0 }, - { 70, { "Zoom in", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" }, 0 }, - { 71, { "Zoom out", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" }, 0 }, - { 72, { "Reset zoom", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" }, 0 }, + { 1, { "${keys.top}", SDLK_HOME, 0, "scroll.top" }, 0 }, + { 2, { "${keys.bottom}", SDLK_END, 0, "scroll.bottom" }, 0 }, + { 10, { "${keys.scroll.up}", SDLK_UP, 0, "scroll.step arg:-1" }, argRepeat_BindFlag }, + { 11, { "${keys.scroll.down}", SDLK_DOWN, 0, "scroll.step arg:1" }, argRepeat_BindFlag }, + { 22, { "${keys.scroll.halfpage.up}", SDLK_SPACE, KMOD_SHIFT, "scroll.page arg:-1" }, argRepeat_BindFlag }, + { 23, { "${keys.scroll.halfpage.down}", SDLK_SPACE, 0, "scroll.page arg:1" }, argRepeat_BindFlag }, + { 24, { "${keys.scroll.page.up}", SDLK_PAGEUP, 0, "scroll.page arg:-1 full:1" }, argRepeat_BindFlag }, + { 25, { "${keys.scroll.page.down}", SDLK_PAGEDOWN, 0, "scroll.page arg:1 full:1" }, argRepeat_BindFlag }, + { 30, { "${keys.back}", navigateBack_KeyShortcut, "navigate.back" }, 0 }, + { 31, { "${keys.forward}", navigateForward_KeyShortcut, "navigate.forward" }, 0 }, + { 32, { "${keys.parent}", navigateParent_KeyShortcut, "navigate.parent" }, 0 }, + { 33, { "${keys.root}", navigateRoot_KeyShortcut, "navigate.root" }, 0 }, + { 35, { "${keys.reload}", reload_KeyShortcut, "document.reload" }, 0 }, + { 41, { "${keys.link.modkey}", SDLK_LALT, 0, "document.linkkeys arg:0" }, argRelease_BindFlag }, + { 42, { "${keys.link.homerow}", 'f', 0, "document.linkkeys arg:1" }, 0 }, + { 45, { "${keys.link.homerow.newtab}", 'f', KMOD_SHIFT, "document.linkkeys arg:1 newtab:1" }, 0 }, + { 46, { "${keys.link.homerow.hover}", 'h', 0, "document.linkkeys arg:1 hover:1" }, 0 }, + { 47, { "${keys.link.homerow.next}", '.', 0, "document.linkkeys more:1" }, 0 }, + { 50, { "${keys.bookmark.add}", 'd', KMOD_PRIMARY, "bookmark.add" }, 0 }, + { 60, { "${keys.findtext}", 'f', KMOD_PRIMARY, "focus.set id:find.input" }, 0 }, + { 70, { "${keys.zoom.in}", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" }, 0 }, + { 71, { "${keys.zoom.out}", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" }, 0 }, + { 72, { "${keys.zoom.reset}", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" }, 0 }, #if !defined (iPlatformApple) /* Ctrl-Cmd-F on macOS */ - { 73, { "Toggle fullscreen mode", SDLK_F11, 0, "window.fullscreen" }, 0 }, + { 73, { "${keys.fullscreen}", SDLK_F11, 0, "window.fullscreen" }, 0 }, #endif - { 76, { "New tab", newTab_KeyShortcut, "tabs.new" }, 0 }, - { 77, { "Close tab", closeTab_KeyShortcut, "tabs.close" }, 0 }, - { 80, { "Previous tab", prevTab_KeyShortcut, "tabs.prev" }, 0 }, - { 81, { "Next tab", nextTab_KeyShortcut, "tabs.next" }, 0 }, - { 100,{ "Toggle show URL on hover", '/', KMOD_PRIMARY, "prefs.hoverlink.toggle" }, 0 }, + { 76, { "${keys.tab.new}", newTab_KeyShortcut, "tabs.new" }, 0 }, + { 77, { "${keys.tab.close}", closeTab_KeyShortcut, "tabs.close" }, 0 }, + { 80, { "${keys.tab.prev}", prevTab_KeyShortcut, "tabs.prev" }, 0 }, + { 81, { "${keys.tab.next}", nextTab_KeyShortcut, "tabs.next" }, 0 }, + { 100,{ "${keys.hoverurl}", '/', KMOD_PRIMARY, "prefs.hoverlink.toggle" }, 0 }, /* The following cannot currently be changed (built-in duplicates). */ #if defined (iPlatformApple) { 1002, { NULL, SDLK_LEFTBRACKET, KMOD_PRIMARY, "navigate.back" }, 0 }, diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 7a704de7..8d025569 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -175,7 +175,8 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { if (today.year == on.year && today.month == on.month && today.day == on.day) { - appendCStr_String(text, " \u2014 ${feeds.today}"); + appendCStr_String(text, " \u2014 "); + appendCStr_String(text, cstr_Lang("feeds.today")); } set_String(&sep->meta, text); delete_String(text); diff --git a/src/ui/translation.c b/src/ui/translation.c index aaedfa4f..86607fc6 100644 --- a/src/ui/translation.c +++ b/src/ui/translation.c @@ -363,7 +363,7 @@ static iBool processResult_Translation_(iTranslation *d) { SDL_RemoveTimer(d->timer); d->timer = 0; if (status_TlsRequest(d->request) == error_TlsRequestStatus) { - setFailed_Translation_(d, explosion_Icon " Request Failed"); + setFailed_Translation_(d, explosion_Icon " ${dlg.translate.fail}"); return iFalse; } iBlock *resultData = collect_Block(readAll_TlsRequest(d->request)); @@ -417,7 +417,7 @@ static iBool processResult_Translation_(iTranslation *d) { delete_String(translation); } else { - setFailed_Translation_(d, unhappy_Icon " Service Unavailable"); + setFailed_Translation_(d, unhappy_Icon " ${dlg.translate.unavail}"); return iFalse; } return iTrue; diff --git a/src/ui/util.c b/src/ui/util.c index 5a08ec20..94690bc6 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -1137,7 +1137,7 @@ void finalizeSheet_Widget(iWidget *sheet) { pushBack_PtrArray(panelButtons, addChildFlags_Widget(topPanel, iClob(panelButton = makePanelButton_( - i == 1 ? "User Interface" : cstr_String(text), + i == 1 ? "${heading.prefs.userinterface}" : cstr_String(text), "panel.open")), (i == 0 ? borderTop_WidgetFlag : 0) | chevron_WidgetFlag)); @@ -1332,10 +1332,10 @@ void finalizeSheet_Widget(iWidget *sheet) { if (isPrefs) { addChild_Widget(topPanel, iClob(makePadding_Widget(lineHeight_Text(defaultBig_FontId)))); addChildFlags_Widget(topPanel, - iClob(makePanelButton_(info_Icon " Help", "panel.showhelp")), + iClob(makePanelButton_(info_Icon " ${menu.help}", "panel.showhelp")), borderTop_WidgetFlag); addChildFlags_Widget(topPanel, - iClob(makePanelButton_(planet_Icon " About", "panel.about")), + iClob(makePanelButton_(planet_Icon " ${menu.about}", "panel.about")), chevron_WidgetFlag); } else { @@ -1362,7 +1362,7 @@ void finalizeSheet_Widget(iWidget *sheet) { setBackgroundColor_Widget(navi, uiBackground_ColorId); addChild_Widget(navi, iClob(makePadding_Widget(0))); iLabelWidget *back = addChildFlags_Widget(navi, - iClob(new_LabelWidget(leftAngle_Icon " Back", "panel.close")), + iClob(new_LabelWidget(leftAngle_Icon " ${panel.back}", "panel.close")), noBackground_WidgetFlag | frameless_WidgetFlag | alignLeft_WidgetFlag | extraPadding_WidgetFlag); checkIcon_LabelWidget(back); @@ -1577,11 +1577,11 @@ iWidget *makeDialogButtons_Widget(const iMenuItem *actions, size_t numActions) { kmods = 0; } if (label == NULL) { - label = uiTextAction_ColorEscape " OK "; + label = format_CStr(uiTextAction_ColorEscape "%s", cstr_Lang("dlg.default")); } } iLabelWidget *button = - addChild_Widget(div, iClob(newKeyMods_LabelWidget(actions[i].label, key, kmods, cmd))); + addChild_Widget(div, iClob(newKeyMods_LabelWidget(label, key, kmods, cmd))); setFont_LabelWidget(button, isDefault ? fonts[1] : fonts[0]); } return div; @@ -1655,7 +1655,7 @@ static iBool messageHandler_(iWidget *msg, const char *cmd) { iWidget *makeMessage_Widget(const char *title, const char *msg) { iWidget *dlg = - makeQuestion_Widget(title, msg, (iMenuItem[]){ { "Continue", 0, 0, "message.ok" } }, 1); + makeQuestion_Widget(title, msg, (iMenuItem[]){ { "${dlg.message.ok}", 0, 0, "message.ok" } }, 1); addAction_Widget(dlg, SDLK_ESCAPE, 0, "message.ok"); addAction_Widget(dlg, SDLK_SPACE, 0, "message.ok"); return dlg; @@ -1679,12 +1679,14 @@ iWidget *makeQuestion_Widget(const char *title, const char *msg, void setToggle_Widget(iWidget *d, iBool active) { if (d) { + const char *YES = cstr_Lang("toggle.yes"); + const char *NO = cstr_Lang("toggle.no"); setFlags_Widget(d, selected_WidgetFlag, active); iLabelWidget *label = (iLabelWidget *) d; - if (!cmp_String(text_LabelWidget(label), "YES") || - !cmp_String(text_LabelWidget(label), "NO")) { + if (!cmp_String(text_LabelWidget(label), YES) || + !cmp_String(text_LabelWidget(label), NO)) { updateText_LabelWidget((iLabelWidget *) d, - collectNewFormat_String("%s", isSelected_Widget(d) ? "YES" : "NO")); + collectNewCStr_String(isSelected_Widget(d) ? YES : NO)); } else { refresh_Widget(d); @@ -1788,85 +1790,85 @@ static void addFontButtons_(iWidget *parent, const char *id) { iWidget *makePreferences_Widget(void) { iWidget *dlg = makeSheet_Widget("prefs"); addChildFlags_Widget(dlg, - iClob(new_LabelWidget(uiHeading_ColorEscape "PREFERENCES", NULL)), + iClob(new_LabelWidget(uiHeading_ColorEscape "${heading.prefs}", NULL)), frameless_WidgetFlag); iWidget *tabs = makeTabs_Widget(dlg); setBackgroundColor_Widget(findChild_Widget(tabs, "tabs.buttons"), uiBackgroundSidebar_ColorId); setId_Widget(tabs, "prefs.tabs"); iWidget *headings, *values; /* General preferences. */ { - appendTwoColumnPage_(tabs, "General", '1', &headings, &values); + appendTwoColumnPage_(tabs, "${heading.prefs.general}", '1', &headings, &values); #if defined (LAGRANGE_DOWNLOAD_EDIT) - addChild_Widget(headings, iClob(makeHeading_Widget("Downloads folder:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.downloads}"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.downloads"); #endif - addChild_Widget(headings, iClob(makeHeading_Widget("Search URL:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.searchurl}"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.searchurl"); - addChild_Widget(headings, iClob(makeHeading_Widget("Show URL on hover:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.hoverlink}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink"))); - addChild_Widget(headings, iClob(makeHeading_Widget("Vertical centering:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.centershort}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.centershort"))); - makeTwoColumnHeading_("SCROLLING", headings, values); - addChild_Widget(headings, iClob(makeHeading_Widget("Smooth scrolling:"))); + makeTwoColumnHeading_("${heading.prefs.scrolling}", headings, values); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.smoothscroll}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.smoothscroll"))); - addChild_Widget(headings, iClob(makeHeading_Widget("Load image on scroll:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.imageloadscroll}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.imageloadscroll"))); if (deviceType_App() == phone_AppDeviceType) { - addChild_Widget(headings, iClob(makeHeading_Widget("Hide toolbar on scroll:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.hidetoolbarscroll}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.hidetoolbarscroll"))); } } /* Window. */ { - appendTwoColumnPage_(tabs, "Interface", '2', &headings, &values); + appendTwoColumnPage_(tabs, "${heading.prefs.interface}", '2', &headings, &values); #if defined (iPlatformApple) || defined (iPlatformMSys) - addChild_Widget(headings, iClob(makeHeading_Widget("Use system theme:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.ostheme}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.ostheme"))); #endif - addChild_Widget(headings, iClob(makeHeading_Widget("Theme:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.theme}"))); iWidget *themes = new_Widget(); /* Themes. */ { - setId_Widget(addChild_Widget(themes, iClob(new_LabelWidget("Pure Black", "theme.set arg:0"))), "prefs.theme.0"); - setId_Widget(addChild_Widget(themes, iClob(new_LabelWidget("Dark", "theme.set arg:1"))), "prefs.theme.1"); - setId_Widget(addChild_Widget(themes, iClob(new_LabelWidget("Light", "theme.set arg:2"))), "prefs.theme.2"); - setId_Widget(addChild_Widget(themes, iClob(new_LabelWidget("Pure White", "theme.set arg:3"))), "prefs.theme.3"); + setId_Widget(addChild_Widget(themes, iClob(new_LabelWidget("${prefs.theme.black}", "theme.set arg:0"))), "prefs.theme.0"); + setId_Widget(addChild_Widget(themes, iClob(new_LabelWidget("${prefs.theme.dark}", "theme.set arg:1"))), "prefs.theme.1"); + setId_Widget(addChild_Widget(themes, iClob(new_LabelWidget("${prefs.theme.light}", "theme.set arg:2"))), "prefs.theme.2"); + setId_Widget(addChild_Widget(themes, iClob(new_LabelWidget("${prefs.theme.white}", "theme.set arg:3"))), "prefs.theme.3"); } addChildFlags_Widget(values, iClob(themes), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); /* Accents. */ iWidget *accent = new_Widget(); { - setId_Widget(addChild_Widget(accent, iClob(new_LabelWidget("Teal", "accent.set arg:0"))), "prefs.accent.0"); - setId_Widget(addChild_Widget(accent, iClob(new_LabelWidget("Orange", "accent.set arg:1"))), "prefs.accent.1"); + setId_Widget(addChild_Widget(accent, iClob(new_LabelWidget("${prefs.accent.teal}", "accent.set arg:0"))), "prefs.accent.0"); + setId_Widget(addChild_Widget(accent, iClob(new_LabelWidget("${prefs.accent.orange}", "accent.set arg:1"))), "prefs.accent.1"); } - addChild_Widget(headings, iClob(makeHeading_Widget("Accent color:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.accent}"))); addChildFlags_Widget(values, iClob(accent), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); #if defined (LAGRANGE_CUSTOM_FRAME) - addChild_Widget(headings, iClob(makeHeading_Widget("Custom window frame:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.customframe}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.customframe"))); #endif - makeTwoColumnHeading_("SIZING", headings, values); - addChild_Widget(headings, iClob(makeHeading_Widget("UI scale factor:"))); + makeTwoColumnHeading_("${heading.prefs.sizing}", headings, values); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.uiscale}"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(8))), "prefs.uiscale"); - addChild_Widget(headings, iClob(makeHeading_Widget("Retain placement:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.retainwindow}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.retainwindow"))); - makeTwoColumnHeading_("WIDE LAYOUT", headings, values); - addChild_Widget(headings, iClob(makeHeading_Widget("Site icon:"))); + makeTwoColumnHeading_("${heading.prefs.widelayout}", headings, values); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.sideicon}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.sideicon"))); } /* Colors. */ { - appendTwoColumnPage_(tabs, "Colors", '3', &headings, &values); - makeTwoColumnHeading_("PAGE CONTENT", headings, values); + appendTwoColumnPage_(tabs, "${heading.prefs.colors}", '3', &headings, &values); + makeTwoColumnHeading_("${heading.prefs.pagecontent}", headings, values); for (int i = 0; i < 2; ++i) { const iBool isDark = (i == 0); const char *mode = isDark ? "dark" : "light"; const iMenuItem themes[] = { - { "Colorful Dark", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, colorfulDark_GmDocumentTheme) }, - { "Colorful Light", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, colorfulLight_GmDocumentTheme) }, - { "Black", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, black_GmDocumentTheme) }, - { "Gray", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, gray_GmDocumentTheme) }, - { "White", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, white_GmDocumentTheme) }, - { "Sepia", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, sepia_GmDocumentTheme) }, - { "High Contrast", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, highContrast_GmDocumentTheme) }, + { "${prefs.doctheme.name.colorfuldark}", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, colorfulDark_GmDocumentTheme) }, + { "${prefs.doctheme.name.colorfullight}", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, colorfulLight_GmDocumentTheme) }, + { "${prefs.doctheme.name.black}", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, black_GmDocumentTheme) }, + { "${prefs.doctheme.name.gray}", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, gray_GmDocumentTheme) }, + { "${prefs.doctheme.name.white}", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, white_GmDocumentTheme) }, + { "${prefs.doctheme.name.sepia}", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, sepia_GmDocumentTheme) }, + { "${prefs.doctheme.name.highcontrast}", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, highContrast_GmDocumentTheme) }, }; - addChild_Widget(headings, iClob(makeHeading_Widget(isDark ? "Dark theme:" : "Light theme:"))); + addChild_Widget(headings, iClob(makeHeading_Widget(isDark ? "${prefs.doctheme.dark}" : "${prefs.doctheme.light}"))); iLabelWidget *button = makeMenuButton_LabelWidget(themes[1].label, themes, iElemCount(themes)); // setFrameColor_Widget(findChild_Widget(as_Widget(button), "menu"), @@ -1875,7 +1877,7 @@ iWidget *makePreferences_Widget(void) { setId_Widget(addChildFlags_Widget(values, iClob(button), alignLeft_WidgetFlag), format_CStr("prefs.doctheme.%s", mode)); } - addChild_Widget(headings, iClob(makeHeading_Widget("Saturation:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.saturation}"))); iWidget *sats = new_Widget(); /* Saturation levels. */ { addRadioButton_(sats, "prefs.saturation.3", "100 %%", "saturation.set arg:100"); @@ -1886,75 +1888,75 @@ iWidget *makePreferences_Widget(void) { addChildFlags_Widget(values, iClob(sats), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); } /* Layout. */ { - appendTwoColumnPage_(tabs, "Style", '4', &headings, &values); - makeTwoColumnHeading_("FONTS", headings, values); + appendTwoColumnPage_(tabs, "${heading.prefs.style}", '4', &headings, &values); + makeTwoColumnHeading_("${heading.prefs.fonts}", headings, values); /* Fonts. */ { iWidget *fonts; - addChild_Widget(headings, iClob(makeHeading_Widget("Heading font:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.headingfont}"))); addFontButtons_(values, "headingfont"); - addChild_Widget(headings, iClob(makeHeading_Widget("Body font:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font}"))); addFontButtons_(values, "font"); - addChild_Widget(headings, iClob(makeHeading_Widget("Monospace body:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.mono}"))); iWidget *mono = new_Widget(); /* TODO: Needs labels! */ setTextCStr_LabelWidget( - addChild_Widget(mono, iClob(makeToggle_Widget("prefs.mono.gemini"))), "Gemini"); + addChild_Widget(mono, iClob(makeToggle_Widget("prefs.mono.gemini"))), "${prefs.mono.gemini}"); setTextCStr_LabelWidget( - addChild_Widget(mono, iClob(makeToggle_Widget("prefs.mono.gopher"))), "Gopher"); + addChild_Widget(mono, iClob(makeToggle_Widget("prefs.mono.gopher"))), "${prefs.mono.gopher}"); addChildFlags_Widget(values, iClob(mono), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); } - makeTwoColumnHeading_("PARAGRAPH", headings, values); - addChild_Widget(headings, iClob(makeHeading_Widget("Line width:"))); + makeTwoColumnHeading_("${heading.prefs.paragraph}", headings, values); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.linewidth}"))); iWidget *widths = new_Widget(); /* Line widths. */ { addRadioButton_(widths, "prefs.linewidth.30", "\u20132", "linewidth.set arg:30"); addRadioButton_(widths, "prefs.linewidth.34", "\u20131", "linewidth.set arg:34"); - addRadioButton_(widths, "prefs.linewidth.38", "Normal", "linewidth.set arg:38"); + addRadioButton_(widths, "prefs.linewidth.38", "${prefs.linewidth.normal}", "linewidth.set arg:38"); addRadioButton_(widths, "prefs.linewidth.43", "+1", "linewidth.set arg:43"); addRadioButton_(widths, "prefs.linewidth.48", "+2", "linewidth.set arg:48"); - addRadioButton_(widths, "prefs.linewidth.1000", "Window", "linewidth.set arg:1000"); + addRadioButton_(widths, "prefs.linewidth.1000", "${prefs.linewidth.fill}", "linewidth.set arg:1000"); } addChildFlags_Widget(values, iClob(widths), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); - addChild_Widget(headings, iClob(makeHeading_Widget("Quote indicator:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.quoteicon}"))); iWidget *quote = new_Widget(); { - addRadioButton_(quote, "prefs.quoteicon.1", "Icon", "quoteicon.set arg:1"); - addRadioButton_(quote, "prefs.quoteicon.0", "Line", "quoteicon.set arg:0"); + addRadioButton_(quote, "prefs.quoteicon.1", "${prefs.quoteicon.icon}", "quoteicon.set arg:1"); + addRadioButton_(quote, "prefs.quoteicon.0", "${prefs.quoteicon.line}", "quoteicon.set arg:0"); } addChildFlags_Widget(values, iClob(quote), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); - addChild_Widget(headings, iClob(makeHeading_Widget("Big 1st paragaph:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.biglede}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.biglede"))); - addChild_Widget(headings, iClob(makeHeading_Widget("Wrap plain text:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.plaintext.wrap}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.plaintext.wrap"))); } /* Network. */ { - appendTwoColumnPage_(tabs, "Network", '5', &headings, &values); - addChild_Widget(headings, iClob(makeHeading_Widget("Decode URLs:"))); + appendTwoColumnPage_(tabs, "${heading.prefs.network}", '5', &headings, &values); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.decodeurls}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.decodeurls"))); - addChild_Widget(headings, iClob(makeHeading_Widget("Cache size:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.cachesize}"))); iWidget *cacheGroup = new_Widget(); { iInputWidget *cache = new_InputWidget(4); setSelectAllOnFocus_InputWidget(cache, iTrue); setId_Widget(addChild_Widget(cacheGroup, iClob(cache)), "prefs.cachesize"); - addChildFlags_Widget(cacheGroup, iClob(new_LabelWidget("MB", NULL)), frameless_WidgetFlag); + addChildFlags_Widget(cacheGroup, iClob(new_LabelWidget("${mb}", NULL)), frameless_WidgetFlag); } addChildFlags_Widget(values, iClob(cacheGroup), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); - makeTwoColumnHeading_("CERTIFICATES", headings, values); - addChild_Widget(headings, iClob(makeHeading_Widget("CA file:"))); + makeTwoColumnHeading_("${heading.prefs.certs}", headings, values); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.ca.file}"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.ca.file"); - addChild_Widget(headings, iClob(makeHeading_Widget("CA path:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.ca.path}"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.ca.path"); - makeTwoColumnHeading_("PROXIES", headings, values); - addChild_Widget(headings, iClob(makeHeading_Widget("Gemini proxy:"))); + makeTwoColumnHeading_("${heading.prefs.proxies}", headings, values); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.proxy.gemini}"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.proxy.gemini"); - addChild_Widget(headings, iClob(makeHeading_Widget("Gopher proxy:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.proxy.gopher}"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.proxy.gopher"); - addChild_Widget(headings, iClob(makeHeading_Widget("HTTP proxy:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.proxy.http}"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.proxy.http"); } /* Keybindings. */ if (deviceType_App() == desktop_AppDeviceType) { iBindingsWidget *bind = new_BindingsWidget(); - appendFramelessTabPage_(tabs, iClob(bind), "Keys", '6', KMOD_PRIMARY); + appendFramelessTabPage_(tabs, iClob(bind), "${heading.prefs.keys}", '6', KMOD_PRIMARY); } addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); resizeToLargestPage_Widget(tabs); @@ -1980,20 +1982,20 @@ iWidget *makeBookmarkEditor_Widget(void) { iWidget *dlg = makeSheet_Widget("bmed"); setId_Widget(addChildFlags_Widget( dlg, - iClob(new_LabelWidget(uiHeading_ColorEscape "EDIT BOOKMARK", NULL)), + iClob(new_LabelWidget(uiHeading_ColorEscape "${heading.bookmark.edit}", NULL)), frameless_WidgetFlag), "bmed.heading"); iWidget *headings, *values; addChild_Widget(dlg, iClob(makeTwoColumnWidget_(&headings, &values))); iInputWidget *inputs[4]; - addChild_Widget(headings, iClob(makeHeading_Widget("Title:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.bookmark.title}"))); setId_Widget(addChild_Widget(values, iClob(inputs[0] = new_InputWidget(0))), "bmed.title"); - addChild_Widget(headings, iClob(makeHeading_Widget("URL:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.bookmark.url}"))); setId_Widget(addChild_Widget(values, iClob(inputs[1] = new_InputWidget(0))), "bmed.url"); setUrlContent_InputWidget(inputs[1], iTrue); - addChild_Widget(headings, iClob(makeHeading_Widget("Tags:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.bookmark.tags}"))); setId_Widget(addChild_Widget(values, iClob(inputs[2] = new_InputWidget(0))), "bmed.tags"); - addChild_Widget(headings, iClob(makeHeading_Widget("Icon:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.bookmark.icon}"))); setId_Widget(addChild_Widget(values, iClob(inputs[3] = new_InputWidget(1))), "bmed.icon"); arrange_Widget(dlg); for (int i = 0; i < 3; ++i) { @@ -2002,7 +2004,7 @@ iWidget *makeBookmarkEditor_Widget(void) { addChild_Widget( dlg, iClob(makeDialogButtons_Widget((iMenuItem[]){ { "${cancel}", 0, 0, NULL }, - { uiTextCaution_ColorEscape "Save Bookmark", + { uiTextCaution_ColorEscape "${dlg.bookmark.save}", SDLK_RETURN, KMOD_PRIMARY, "bmed.accept" } }, @@ -2045,7 +2047,7 @@ iWidget *makeBookmarkCreation_Widget(const iString *url, const iString *title, i iWidget *dlg = makeBookmarkEditor_Widget(); setId_Widget(dlg, "bmed.create"); setTextCStr_LabelWidget(findChild_Widget(dlg, "bmed.heading"), - uiHeading_ColorEscape "ADD BOOKMARK"); + uiHeading_ColorEscape "${heading.bookmark.add}"); iUrl parts; init_Url(&parts, url); setTextCStr_InputWidget(findChild_Widget(dlg, "bmed.title"), @@ -2112,28 +2114,28 @@ iWidget *makeFeedSettings_Widget(uint32_t bookmarkId) { iWidget *dlg = makeSheet_Widget("feedcfg"); setId_Widget(addChildFlags_Widget( dlg, - iClob(new_LabelWidget(bookmarkId ? uiHeading_ColorEscape "FEED SETTINGS" - : uiHeading_ColorEscape "SUBSCRIBE TO PAGE", + iClob(new_LabelWidget(bookmarkId ? uiHeading_ColorEscape "${heading.feedcfg}" + : uiHeading_ColorEscape "${heading.subscribe}", NULL)), frameless_WidgetFlag), "feedcfg.heading"); iWidget *headings, *values; addChild_Widget(dlg, iClob(makeTwoColumnWidget_(&headings, &values))); - addChild_Widget(headings, iClob(makeHeading_Widget("Title:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.feed.title}"))); iInputWidget *input = new_InputWidget(0); setId_Widget(addChild_Widget(values, iClob(input)), "feedcfg.title"); - addChild_Widget(headings, iClob(makeHeading_Widget("Entry type:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.feed.entrytype}"))); iWidget *types = new_Widget(); { - addRadioButton_(types, "feedcfg.type.gemini", "YYYY-MM-DD Links", "feedcfg.type arg:0"); - addRadioButton_(types, "feedcfg.type.headings", "New Headings", "feedcfg.type arg:1"); + addRadioButton_(types, "feedcfg.type.gemini", "${dlg.feed.type.gemini}", "feedcfg.type arg:0"); + addRadioButton_(types, "feedcfg.type.headings", "${dlg.feed.type.headings}", "feedcfg.type arg:1"); } addChildFlags_Widget(values, iClob(types), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); iWidget *buttons = addChild_Widget(dlg, iClob(makeDialogButtons_Widget( (iMenuItem[]){ { "${cancel}", 0, 0, NULL }, - { bookmarkId ? uiTextCaution_ColorEscape "Save Settings" - : uiTextCaution_ColorEscape "Subscribe", + { bookmarkId ? uiTextCaution_ColorEscape "${dlg.feed.save}" + : uiTextCaution_ColorEscape "${dlg.feed.sub}", SDLK_RETURN, KMOD_PRIMARY, format_CStr("feedcfg.accept bmid:%d", bookmarkId) } }, @@ -2161,14 +2163,14 @@ iWidget *makeIdentityCreation_Widget(void) { iWidget *dlg = makeSheet_Widget("ident"); setId_Widget(addChildFlags_Widget( dlg, - iClob(new_LabelWidget(uiHeading_ColorEscape "NEW IDENTITY", NULL)), + iClob(new_LabelWidget(uiHeading_ColorEscape "${heading.newident}", NULL)), frameless_WidgetFlag), "ident.heading"); iWidget *page = new_Widget(); addChildFlags_Widget( dlg, iClob( - new_LabelWidget("Creating a self-signed 2048-bit RSA certificate.", NULL)), + new_LabelWidget("${dlg.newident.rsa.selfsign}", NULL)), frameless_WidgetFlag); addChild_Widget(dlg, iClob(page)); setFlags_Widget(page, arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag, iTrue); @@ -2177,35 +2179,35 @@ iWidget *makeIdentityCreation_Widget(void) { iWidget *values = addChildFlags_Widget( page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); iInputWidget *inputs[6]; - addChild_Widget(headings, iClob(makeHeading_Widget("Valid until:"))); - setId_Widget(addChild_Widget(values, iClob(newHint_InputWidget(19, "YYYY-MM-DD HH:MM:SS"))), "ident.until"); - addChild_Widget(headings, iClob(makeHeading_Widget("Common name:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.until}"))); + setId_Widget(addChild_Widget(values, iClob(newHint_InputWidget(19, "${hint.newident.date}"))), "ident.until"); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.commonname}"))); setId_Widget(addChild_Widget(values, iClob(inputs[0] = new_InputWidget(0))), "ident.common"); /* Temporary? */ { - addChild_Widget(headings, iClob(makeHeading_Widget("Temporary:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.temp}"))); iWidget *tmpGroup = new_Widget(); setFlags_Widget(tmpGroup, arrangeSize_WidgetFlag | arrangeHorizontal_WidgetFlag, iTrue); addChild_Widget(tmpGroup, iClob(makeToggle_Widget("ident.temp"))); setId_Widget( addChildFlags_Widget( tmpGroup, - iClob(new_LabelWidget(uiTextCaution_ColorEscape "\u26a0 not saved to disk", NULL)), + iClob(new_LabelWidget(uiTextCaution_ColorEscape "\u26a0 ${dlg.newident.notsaved}", NULL)), hidden_WidgetFlag | frameless_WidgetFlag), "ident.temp.note"); addChild_Widget(values, iClob(tmpGroup)); } addChild_Widget(headings, iClob(makePadding_Widget(gap_UI))); addChild_Widget(values, iClob(makePadding_Widget(gap_UI))); - addChild_Widget(headings, iClob(makeHeading_Widget("Email:"))); - setId_Widget(addChild_Widget(values, iClob(inputs[1] = newHint_InputWidget(0, "optional"))), "ident.email"); - addChild_Widget(headings, iClob(makeHeading_Widget("User ID:"))); - setId_Widget(addChild_Widget(values, iClob(inputs[2] = newHint_InputWidget(0, "optional"))), "ident.userid"); - addChild_Widget(headings, iClob(makeHeading_Widget("Domain:"))); - setId_Widget(addChild_Widget(values, iClob(inputs[3] = newHint_InputWidget(0, "optional"))), "ident.domain"); - addChild_Widget(headings, iClob(makeHeading_Widget("Organization:"))); - setId_Widget(addChild_Widget(values, iClob(inputs[4] = newHint_InputWidget(0, "optional"))), "ident.org"); - addChild_Widget(headings, iClob(makeHeading_Widget("Country:"))); - setId_Widget(addChild_Widget(values, iClob(inputs[5] = newHint_InputWidget(0, "optional"))), "ident.country"); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.email}"))); + setId_Widget(addChild_Widget(values, iClob(inputs[1] = newHint_InputWidget(0, "${hint.newident.optional}"))), "ident.email"); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.userid}"))); + setId_Widget(addChild_Widget(values, iClob(inputs[2] = newHint_InputWidget(0, "${hint.newident.optional}"))), "ident.userid"); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.domain}"))); + setId_Widget(addChild_Widget(values, iClob(inputs[3] = newHint_InputWidget(0, "${hint.newident.optional}"))), "ident.domain"); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.org}"))); + setId_Widget(addChild_Widget(values, iClob(inputs[4] = newHint_InputWidget(0, "${hint.newident.optional}"))), "ident.org"); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.country}"))); + setId_Widget(addChild_Widget(values, iClob(inputs[5] = newHint_InputWidget(0, "${hint.newident.optional}"))), "ident.country"); arrange_Widget(dlg); for (size_t i = 0; i < iElemCount(inputs); ++i) { as_Widget(inputs[i])->rect.size.x = 100 * gap_UI - headings->rect.size.x; @@ -2213,7 +2215,7 @@ iWidget *makeIdentityCreation_Widget(void) { addChild_Widget( dlg, iClob(makeDialogButtons_Widget((iMenuItem[]){ { "${cancel}", 0, 0, NULL }, - { uiTextAction_ColorEscape "Create Identity", + { uiTextAction_ColorEscape "${dlg.newident.create}", SDLK_RETURN, KMOD_PRIMARY, "ident.accept" } }, @@ -2224,17 +2226,17 @@ iWidget *makeIdentityCreation_Widget(void) { } static const iMenuItem languages[] = { - { "Arabic", 0, 0, "xlt.lang id:ar" }, - { "Chinese", 0, 0, "xlt.lang id:zh" }, - { "English", 0, 0, "xlt.lang id:en" }, - { "French", 0, 0, "xlt.lang id:fr" }, - { "German", 0, 0, "xlt.lang id:de" }, - { "Hindi", 0, 0, "xlt.lang id:hi" }, - { "Italian", 0, 0, "xlt.lang id:it" }, - { "Japanese", 0, 0, "xlt.lang id:ja" }, - { "Portuguese", 0, 0, "xlt.lang id:pt" }, - { "Russian", 0, 0, "xlt.lang id:ru" }, - { "Spanish", 0, 0, "xlt.lang id:es" }, + { "${lang.ar}", 0, 0, "xlt.lang id:ar" }, + { "${lang.zh}", 0, 0, "xlt.lang id:zh" }, + { "${lang.en}", 0, 0, "xlt.lang id:en" }, + { "${lang.fr}", 0, 0, "xlt.lang id:fr" }, + { "${lang.de}", 0, 0, "xlt.lang id:de" }, + { "${lang.hi}", 0, 0, "xlt.lang id:hi" }, + { "${lang.it}", 0, 0, "xlt.lang id:it" }, + { "${lang.ja}", 0, 0, "xlt.lang id:ja" }, + { "${lang.pt}", 0, 0, "xlt.lang id:pt" }, + { "${lang.ru}", 0, 0, "xlt.lang id:ru" }, + { "${lang.es}", 0, 0, "xlt.lang id:es" }, }; static iBool translationHandler_(iWidget *dlg, const char *cmd) { @@ -2251,7 +2253,7 @@ static iBool translationHandler_(iWidget *dlg, const char *cmd) { const char *languageId_String(const iString *menuItemLabel) { iForIndices(i, languages) { - if (!cmp_String(menuItemLabel, languages[i].label)) { + if (!cmp_String(menuItemLabel, translateCStr_Lang(languages[i].label))) { return cstr_Rangecc(range_Command(languages[i].command, "id")); } } @@ -2272,7 +2274,7 @@ iWidget *makeTranslation_Widget(iWidget *parent) { setFlags_Widget(dlg, keepOnTop_WidgetFlag, iFalse); setCommandHandler_Widget(dlg, translationHandler_); addChildFlags_Widget(dlg, - iClob(new_LabelWidget(uiHeading_ColorEscape "TRANSLATE PAGE", NULL)), + iClob(new_LabelWidget(uiHeading_ColorEscape "${heading.translate}", NULL)), frameless_WidgetFlag); addChild_Widget(dlg, iClob(makePadding_Widget(lineHeight_Text(uiLabel_FontId)))); iWidget *headings, *values; @@ -2281,11 +2283,11 @@ iWidget *makeTranslation_Widget(iWidget *parent) { setId_Widget(page, "xlt.langs"); iLabelWidget *fromLang, *toLang; /* Source language. */ { - addChild_Widget(headings, iClob(makeHeading_Widget("From:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.translate.from}"))); setId_Widget( addChildFlags_Widget(values, iClob(fromLang = makeMenuButton_LabelWidget( - "Portuguese", languages, iElemCount(languages))), + "${lang.pt}", languages, iElemCount(languages))), alignLeft_WidgetFlag), "xlt.from"); iWidget *langMenu = findChild_Widget(as_Widget(fromLang), "menu"); @@ -2294,10 +2296,10 @@ iWidget *makeTranslation_Widget(iWidget *parent) { setBackgroundColor_Widget(langMenu, uiBackgroundMenu_ColorId); } /* Target language. */ { - addChild_Widget(headings, iClob(makeHeading_Widget("To:"))); + addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.translate.to}"))); setId_Widget(addChildFlags_Widget(values, iClob(toLang = makeMenuButton_LabelWidget( - "Portuguese", languages, iElemCount(languages))), + "${lang.pt}", languages, iElemCount(languages))), alignLeft_WidgetFlag), "xlt.to"); iWidget *langMenu = findChild_Widget(as_Widget(toLang), "menu"); @@ -2311,7 +2313,7 @@ iWidget *makeTranslation_Widget(iWidget *parent) { iClob(makeDialogButtons_Widget( (iMenuItem[]){ { "${cancel}", SDLK_ESCAPE, 0, "translation.cancel" }, - { uiTextAction_ColorEscape "Translate", SDLK_RETURN, 0, "translation.submit" } }, + { uiTextAction_ColorEscape "${dlg.translate}", SDLK_RETURN, 0, "translation.submit" } }, 2))); addChild_Widget(parent, iClob(dlg)); arrange_Widget(dlg); -- cgit v1.2.3