diff options
-rw-r--r-- | po/en.po | 39 | ||||
-rw-r--r-- | src/ui/certimportwidget.c | 36 |
2 files changed, 58 insertions, 17 deletions
@@ -593,6 +593,39 @@ msgstr "The received certificate is for the wrong domain (%s). This may be a ser | |||
593 | msgid "dlg.certwarn.domain.expired" | 593 | msgid "dlg.certwarn.domain.expired" |
594 | msgstr "The received certificate is expired AND for the wrong domain." | 594 | msgstr "The received certificate is expired AND for the wrong domain." |
595 | 595 | ||
596 | msgid "heading.certimport" | ||
597 | msgstr "IMPORT IDENTITY" | ||
598 | |||
599 | msgid "dlg.certimport.help" | ||
600 | msgstr "Paste a PEM-encoded certificate and/or private key,\nor drop a .crt/.key file on the window." | ||
601 | |||
602 | msgid "dlg.certimport.notfound" | ||
603 | msgstr "No certificate or private key was found." | ||
604 | |||
605 | msgid "dlg.certimport.notfound.page" | ||
606 | msgstr "No certificate/key found on the current page." | ||
607 | |||
608 | msgid "heading.certimport.pasted" | ||
609 | msgstr "PASTED FROM CLIPBOARD" | ||
610 | |||
611 | msgid "heading.certimport.dropped" | ||
612 | msgstr "DROPPED FILE" | ||
613 | |||
614 | msgid "dlg.certimport.import" | ||
615 | msgstr "Import" | ||
616 | |||
617 | msgid "dlg.certimport.notes" | ||
618 | msgstr "Notes:" | ||
619 | |||
620 | msgid "hint.certimport.description" | ||
621 | msgstr "description" | ||
622 | |||
623 | msgid "dlg.certimport.nocert" | ||
624 | msgstr "No Certificate" | ||
625 | |||
626 | msgid "dlg.certimport.nokey" | ||
627 | msgstr "No Private Key" | ||
628 | |||
596 | msgid "link.hint.audio" | 629 | msgid "link.hint.audio" |
597 | msgstr "Play Audio" | 630 | msgstr "Play Audio" |
598 | 631 | ||
@@ -629,6 +662,9 @@ msgstr "Chinese" | |||
629 | msgid "lang.en" | 662 | msgid "lang.en" |
630 | msgstr "English" | 663 | msgstr "English" |
631 | 664 | ||
665 | msgid "lang.fi" | ||
666 | msgstr "Finnish" | ||
667 | |||
632 | msgid "lang.fr" | 668 | msgid "lang.fr" |
633 | msgstr "French" | 669 | msgstr "French" |
634 | 670 | ||
@@ -843,6 +879,9 @@ msgstr "Teal" | |||
843 | msgid "prefs.accent.orange" | 879 | msgid "prefs.accent.orange" |
844 | msgstr "Orange" | 880 | msgstr "Orange" |
845 | 881 | ||
882 | msgid "prefs.uilang" | ||
883 | msgstr "Language:" | ||
884 | |||
846 | msgid "prefs.uiscale" | 885 | msgid "prefs.uiscale" |
847 | msgstr "UI scale factor:" | 886 | msgstr "UI scale factor:" |
848 | 887 | ||
diff --git a/src/ui/certimportwidget.c b/src/ui/certimportwidget.c index d47851f5..43e8ff97 100644 --- a/src/ui/certimportwidget.c +++ b/src/ui/certimportwidget.c | |||
@@ -47,8 +47,7 @@ struct Impl_CertImportWidget { | |||
47 | iTlsCertificate *cert; | 47 | iTlsCertificate *cert; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static const char *infoText_ = "Paste a PEM-encoded certificate and/or private key,\n" | 50 | static const char *infoText_ = "${dlg.certimport.help}"; |
51 | "or drop a .crt/.key file on the window."; | ||
52 | 51 | ||
53 | static iBool tryImport_CertImportWidget_(iCertImportWidget *d, const iBlock *data) { | 52 | static iBool tryImport_CertImportWidget_(iCertImportWidget *d, const iBlock *data) { |
54 | iBool ok = iFalse; | 53 | iBool ok = iFalse; |
@@ -84,7 +83,7 @@ static iBool tryImport_CertImportWidget_(iCertImportWidget *d, const iBlock *dat | |||
84 | setFrameColor_Widget(as_Widget(d->crtLabel), uiTextAction_ColorId); | 83 | setFrameColor_Widget(as_Widget(d->crtLabel), uiTextAction_ColorId); |
85 | } | 84 | } |
86 | else { | 85 | else { |
87 | setTextCStr_LabelWidget(d->crtLabel, uiTextCaution_ColorEscape "No Certificate"); | 86 | setTextCStr_LabelWidget(d->crtLabel, uiTextCaution_ColorEscape "${dlg.certimport.nocert}"); |
88 | setFrameColor_Widget(as_Widget(d->crtLabel), uiTextCaution_ColorId); | 87 | setFrameColor_Widget(as_Widget(d->crtLabel), uiTextCaution_ColorId); |
89 | } | 88 | } |
90 | if (d->cert && hasPrivateKey_TlsCertificate(d->cert)) { | 89 | if (d->cert && hasPrivateKey_TlsCertificate(d->cert)) { |
@@ -96,7 +95,7 @@ static iBool tryImport_CertImportWidget_(iCertImportWidget *d, const iBlock *dat | |||
96 | setFrameColor_Widget(as_Widget(d->keyLabel), uiTextAction_ColorId); | 95 | setFrameColor_Widget(as_Widget(d->keyLabel), uiTextAction_ColorId); |
97 | } | 96 | } |
98 | else { | 97 | else { |
99 | setTextCStr_LabelWidget(d->keyLabel, uiTextCaution_ColorEscape "No Private Key"); | 98 | setTextCStr_LabelWidget(d->keyLabel, uiTextCaution_ColorEscape "${dlg.certimport.nokey}"); |
100 | setFrameColor_Widget(as_Widget(d->keyLabel), uiTextCaution_ColorId); | 99 | setFrameColor_Widget(as_Widget(d->keyLabel), uiTextCaution_ColorId); |
101 | } | 100 | } |
102 | } | 101 | } |
@@ -118,9 +117,10 @@ void init_CertImportWidget(iCertImportWidget *d) { | |||
118 | overflowScrollable_WidgetFlag, | 117 | overflowScrollable_WidgetFlag, |
119 | iTrue); | 118 | iTrue); |
120 | } | 119 | } |
121 | addChildFlags_Widget(w, | 120 | addChildFlags_Widget( |
122 | iClob(new_LabelWidget(uiHeading_ColorEscape "IMPORT IDENTITY", NULL)), | 121 | w, |
123 | frameless_WidgetFlag); | 122 | iClob(new_LabelWidget(uiHeading_ColorEscape "${heading.certimport}", NULL)), |
123 | frameless_WidgetFlag); | ||
124 | d->info = addChildFlags_Widget(w, iClob(new_LabelWidget(infoText_, NULL)), frameless_WidgetFlag); | 124 | d->info = addChildFlags_Widget(w, iClob(new_LabelWidget(infoText_, NULL)), frameless_WidgetFlag); |
125 | addChild_Widget(w, iClob(makePadding_Widget(gap_UI))); | 125 | addChild_Widget(w, iClob(makePadding_Widget(gap_UI))); |
126 | d->crtLabel = new_LabelWidget("", NULL); { | 126 | d->crtLabel = new_LabelWidget("", NULL); { |
@@ -141,9 +141,9 @@ void init_CertImportWidget(iCertImportWidget *d) { | |||
141 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); | 141 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); |
142 | iWidget *values = addChildFlags_Widget( | 142 | iWidget *values = addChildFlags_Widget( |
143 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); | 143 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); |
144 | addChild_Widget(headings, iClob(makeHeading_Widget("Notes:"))); | 144 | addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.certimport.notes}"))); |
145 | addChild_Widget(values, iClob(d->notes = new_InputWidget(0))); | 145 | addChild_Widget(values, iClob(d->notes = new_InputWidget(0))); |
146 | setHint_InputWidget(d->notes, "description"); | 146 | setHint_InputWidget(d->notes, "${hint.certimport.description}"); |
147 | as_Widget(d->notes)->rect.size.x = gap_UI * 70; | 147 | as_Widget(d->notes)->rect.size.x = gap_UI * 70; |
148 | } | 148 | } |
149 | addChild_Widget(w, iClob(page)); | 149 | addChild_Widget(w, iClob(page)); |
@@ -153,9 +153,11 @@ void init_CertImportWidget(iCertImportWidget *d) { | |||
153 | /* Buttons. */ | 153 | /* Buttons. */ |
154 | addChild_Widget(w, iClob(makePadding_Widget(gap_UI))); | 154 | addChild_Widget(w, iClob(makePadding_Widget(gap_UI))); |
155 | iWidget *buttons = makeDialogButtons_Widget( | 155 | iWidget *buttons = makeDialogButtons_Widget( |
156 | (iMenuItem[]){ | 156 | (iMenuItem[]){ { "${cancel}", 0, 0, NULL }, |
157 | { "${cancel}", 0, 0, NULL }, | 157 | { uiTextAction_ColorEscape "${dlg.certimport.import}", |
158 | { uiTextAction_ColorEscape "Import", SDLK_RETURN, KMOD_PRIMARY, "certimport.accept" } }, | 158 | SDLK_RETURN, |
159 | KMOD_PRIMARY, | ||
160 | "certimport.accept" } }, | ||
159 | 2); | 161 | 2); |
160 | addChild_Widget(w, iClob(buttons)); | 162 | addChild_Widget(w, iClob(buttons)); |
161 | arrange_Widget(w); | 163 | arrange_Widget(w); |
@@ -182,7 +184,7 @@ void setPageContent_CertImportWidget(iCertImportWidget *d, const iBlock *content | |||
182 | } | 184 | } |
183 | else { | 185 | else { |
184 | setTextCStr_LabelWidget( | 186 | setTextCStr_LabelWidget( |
185 | d->info, format_CStr("No certificate/key found on the current page.\n%s", infoText_)); | 187 | d->info, format_CStr("${dlg.certimport.notfound.page}\n%s", infoText_)); |
186 | } | 188 | } |
187 | arrange_Widget(as_Widget(d)); | 189 | arrange_Widget(as_Widget(d)); |
188 | } | 190 | } |
@@ -198,8 +200,8 @@ static iBool processEvent_CertImportWidget_(iCertImportWidget *d, const SDL_Even | |||
198 | const int mods = keyMods_Sym(ev->key.keysym.mod); | 200 | const int mods = keyMods_Sym(ev->key.keysym.mod); |
199 | if (key == SDLK_v && mods == KMOD_PRIMARY) { | 201 | if (key == SDLK_v && mods == KMOD_PRIMARY) { |
200 | if (!tryImportFromClipboard_CertImportWidget_(d)) { | 202 | if (!tryImportFromClipboard_CertImportWidget_(d)) { |
201 | makeMessage_Widget(uiTextCaution_ColorEscape "PASTED FROM CLIPBOARD", | 203 | makeMessage_Widget(uiTextCaution_ColorEscape "${heading.certimport.pasted}", |
202 | "No certificate or private key was found."); | 204 | "${dlg.certimport.notfound}"); |
203 | } | 205 | } |
204 | postRefresh_App(); | 206 | postRefresh_App(); |
205 | return iTrue; | 207 | return iTrue; |
@@ -232,8 +234,8 @@ static iBool processEvent_CertImportWidget_(iCertImportWidget *d, const SDL_Even | |||
232 | } | 234 | } |
233 | } | 235 | } |
234 | else { | 236 | else { |
235 | makeMessage_Widget(uiTextCaution_ColorEscape "DROPPED FILE", | 237 | makeMessage_Widget(uiTextCaution_ColorEscape "${heading.certimport.dropped}", |
236 | "No certificate or private key was found."); | 238 | "${dlg.certimport.notfound}"); |
237 | } | 239 | } |
238 | } | 240 | } |
239 | iRelease(f); | 241 | iRelease(f); |