summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--po/en.po39
-rw-r--r--src/ui/certimportwidget.c36
2 files changed, 58 insertions, 17 deletions
diff --git a/po/en.po b/po/en.po
index a6c3d5e7..44f3de9b 100644
--- a/po/en.po
+++ b/po/en.po
@@ -593,6 +593,39 @@ msgstr "The received certificate is for the wrong domain (%s). This may be a ser
593msgid "dlg.certwarn.domain.expired" 593msgid "dlg.certwarn.domain.expired"
594msgstr "The received certificate is expired AND for the wrong domain." 594msgstr "The received certificate is expired AND for the wrong domain."
595 595
596msgid "heading.certimport"
597msgstr "IMPORT IDENTITY"
598
599msgid "dlg.certimport.help"
600msgstr "Paste a PEM-encoded certificate and/or private key,\nor drop a .crt/.key file on the window."
601
602msgid "dlg.certimport.notfound"
603msgstr "No certificate or private key was found."
604
605msgid "dlg.certimport.notfound.page"
606msgstr "No certificate/key found on the current page."
607
608msgid "heading.certimport.pasted"
609msgstr "PASTED FROM CLIPBOARD"
610
611msgid "heading.certimport.dropped"
612msgstr "DROPPED FILE"
613
614msgid "dlg.certimport.import"
615msgstr "Import"
616
617msgid "dlg.certimport.notes"
618msgstr "Notes:"
619
620msgid "hint.certimport.description"
621msgstr "description"
622
623msgid "dlg.certimport.nocert"
624msgstr "No Certificate"
625
626msgid "dlg.certimport.nokey"
627msgstr "No Private Key"
628
596msgid "link.hint.audio" 629msgid "link.hint.audio"
597msgstr "Play Audio" 630msgstr "Play Audio"
598 631
@@ -629,6 +662,9 @@ msgstr "Chinese"
629msgid "lang.en" 662msgid "lang.en"
630msgstr "English" 663msgstr "English"
631 664
665msgid "lang.fi"
666msgstr "Finnish"
667
632msgid "lang.fr" 668msgid "lang.fr"
633msgstr "French" 669msgstr "French"
634 670
@@ -843,6 +879,9 @@ msgstr "Teal"
843msgid "prefs.accent.orange" 879msgid "prefs.accent.orange"
844msgstr "Orange" 880msgstr "Orange"
845 881
882msgid "prefs.uilang"
883msgstr "Language:"
884
846msgid "prefs.uiscale" 885msgid "prefs.uiscale"
847msgstr "UI scale factor:" 886msgstr "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
50static const char *infoText_ = "Paste a PEM-encoded certificate and/or private key,\n" 50static const char *infoText_ = "${dlg.certimport.help}";
51 "or drop a .crt/.key file on the window.";
52 51
53static iBool tryImport_CertImportWidget_(iCertImportWidget *d, const iBlock *data) { 52static 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);