diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app.c | 15 | ||||
-rw-r--r-- | src/gempub.c | 26 | ||||
-rw-r--r-- | src/ui/documentwidget.c | 2 | ||||
-rw-r--r-- | src/ui/root.c | 16 |
4 files changed, 28 insertions, 31 deletions
@@ -1591,8 +1591,8 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | |||
1591 | const iString *country = text_InputWidget (findChild_Widget(dlg, "ident.country")); | 1591 | const iString *country = text_InputWidget (findChild_Widget(dlg, "ident.country")); |
1592 | const iBool isTemp = isSelected_Widget(findChild_Widget(dlg, "ident.temp")); | 1592 | const iBool isTemp = isSelected_Widget(findChild_Widget(dlg, "ident.temp")); |
1593 | if (isEmpty_String(commonName)) { | 1593 | if (isEmpty_String(commonName)) { |
1594 | makeSimpleMessage_Widget(orange_ColorEscape "MISSING INFO", | 1594 | makeSimpleMessage_Widget(orange_ColorEscape "${heading.newident.missing}", |
1595 | "A \"Common name\" must be specified."); | 1595 | "${dlg.newindent.missing.commonname}"); |
1596 | return iTrue; | 1596 | return iTrue; |
1597 | } | 1597 | } |
1598 | iDate until; | 1598 | iDate until; |
@@ -1606,11 +1606,8 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | |||
1606 | "%04u-%u-%u %u:%u:%u", | 1606 | "%04u-%u-%u %u:%u:%u", |
1607 | &val[0], &val[1], &val[2], &val[3], &val[4], &val[5]); | 1607 | &val[0], &val[1], &val[2], &val[3], &val[4], &val[5]); |
1608 | if (n <= 0) { | 1608 | if (n <= 0) { |
1609 | makeSimpleMessage_Widget(orange_ColorEscape "INVALID DATE", | 1609 | makeSimpleMessage_Widget(orange_ColorEscape "${heading.newident.date.bad}", |
1610 | "Please check the \"Valid until\" date. Examples:\n" | 1610 | "${dlg.newident.date.example}"); |
1611 | "\u2022 2030\n" | ||
1612 | "\u2022 2025-06-30\n" | ||
1613 | "\u2022 2021-12-31 23:59:59"); | ||
1614 | return iTrue; | 1611 | return iTrue; |
1615 | } | 1612 | } |
1616 | until.year = val[0]; | 1613 | until.year = val[0]; |
@@ -1625,8 +1622,8 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | |||
1625 | initCurrent_Time(&now); | 1622 | initCurrent_Time(&now); |
1626 | init_Time(&t, &until); | 1623 | init_Time(&t, &until); |
1627 | if (cmp_Time(&t, &now) <= 0) { | 1624 | if (cmp_Time(&t, &now) <= 0) { |
1628 | makeSimpleMessage_Widget(orange_ColorEscape "INVALID DATE", | 1625 | makeSimpleMessage_Widget(orange_ColorEscape "${heading.newident.date.bad}", |
1629 | "Expiration date must be in the future."); | 1626 | "${dlg.newident.date.past}"); |
1630 | return iTrue; | 1627 | return iTrue; |
1631 | } | 1628 | } |
1632 | } | 1629 | } |
diff --git a/src/gempub.c b/src/gempub.c index 448349c8..c9b1c242 100644 --- a/src/gempub.c +++ b/src/gempub.c | |||
@@ -79,7 +79,7 @@ static iBool parseMetadata_Gempub_(iGempub *d) { | |||
79 | "cover:", | 79 | "cover:", |
80 | }; | 80 | }; |
81 | /* Default values. */ | 81 | /* Default values. */ |
82 | setCStr_String(&d->props[title_GempubProperty], "Untitled Book"); | 82 | setCStr_String(&d->props[title_GempubProperty], "${gempub.cover.untitled}"); |
83 | setCStr_String(&d->props[cover_GempubProperty], | 83 | setCStr_String(&d->props[cover_GempubProperty], |
84 | entryCStr_Archive(d->arch, "cover.jpg") ? "cover.jpg" : | 84 | entryCStr_Archive(d->arch, "cover.jpg") ? "cover.jpg" : |
85 | entryCStr_Archive(d->arch, "cover.png") ? "cover.png" : ""); | 85 | entryCStr_Archive(d->arch, "cover.png") ? "cover.png" : ""); |
@@ -173,38 +173,38 @@ iString *coverPageSource_Gempub(const iGempub *d) { | |||
173 | appendFormat_String(out, "%s\n", cstr_String(&d->props[description_GempubProperty])); | 173 | appendFormat_String(out, "%s\n", cstr_String(&d->props[description_GempubProperty])); |
174 | } | 174 | } |
175 | appendCStr_String(out, "\n"); | 175 | appendCStr_String(out, "\n"); |
176 | appendProperty_Gempub_(d, "Author:", author_GempubProperty, out); | 176 | appendProperty_Gempub_(d, "${gempub.meta.author}:", author_GempubProperty, out); |
177 | if (!isRemote_Gempub_(d)) { | 177 | if (!isRemote_Gempub_(d)) { |
178 | appendFormat_String(out, "\n=> %s " book_Icon " View Gempub contents\n", | 178 | appendFormat_String(out, "\n=> %s " book_Icon " ${gempub.cover.view}\n", |
179 | cstrCollect_String(concat_Path(baseUrl, &d->props[index_GempubProperty]))); | 179 | cstrCollect_String(concat_Path(baseUrl, &d->props[index_GempubProperty]))); |
180 | if (hasProperty_Gempub_(d, cover_GempubProperty)) { | 180 | if (hasProperty_Gempub_(d, cover_GempubProperty)) { |
181 | appendFormat_String(out, "\n=> %s Cover image\n", | 181 | appendFormat_String(out, "\n=> %s ${gempub.cover.image}\n", |
182 | cstrCollect_String(concat_Path(baseUrl, &d->props[cover_GempubProperty]))); | 182 | cstrCollect_String(concat_Path(baseUrl, &d->props[cover_GempubProperty]))); |
183 | } | 183 | } |
184 | } | 184 | } |
185 | else { | 185 | else { |
186 | iString *key = collectNew_String(); /* TODO: add a helper for this */ | 186 | iString *key = collectNew_String(); /* TODO: add a helper for this */ |
187 | toString_Sym(SDLK_s, KMOD_PRIMARY, key); | 187 | toString_Sym(SDLK_s, KMOD_PRIMARY, key); |
188 | appendCStr_String(out, "\nThis Gempub book can be viewed after it has been saved locally. "); | 188 | appendCStr_String(out, "\n${gempub.cover.viewlocal} "); |
189 | appendFormat_String(out, | 189 | appendFormat_String(out, |
190 | cstr_Lang("error.unsupported.suggestsave"), | 190 | cstr_Lang("error.unsupported.suggestsave"), |
191 | cstr_String(key), | 191 | cstr_String(key), |
192 | saveToDownloads_Label); | 192 | saveToDownloads_Label); |
193 | translate_Lang(out); | ||
194 | appendCStr_String(out, "\n"); | 193 | appendCStr_String(out, "\n"); |
195 | } | 194 | } |
196 | appendCStr_String(out, "\n## About this book\n"); | 195 | appendCStr_String(out, "\n## ${gempub.cover.aboutbook}\n"); |
197 | appendProperty_Gempub_(d, "Version:", version_GempubProperty, out); | 196 | appendProperty_Gempub_(d, "${gempub.meta.version}:", version_GempubProperty, out); |
198 | appendProperty_Gempub_(d, "Revision date:", revisionDate_GempubProperty, out); | 197 | appendProperty_Gempub_(d, "${gempub.meta.revdate}:", revisionDate_GempubProperty, out); |
199 | if (hasProperty_Gempub_(d, publishDate_GempubProperty)) { | 198 | if (hasProperty_Gempub_(d, publishDate_GempubProperty)) { |
200 | appendProperty_Gempub_(d, "Publish date:", publishDate_GempubProperty, out); | 199 | appendProperty_Gempub_(d, "${gempub.meta.pubdate}:", publishDate_GempubProperty, out); |
201 | } | 200 | } |
202 | else { | 201 | else { |
203 | appendProperty_Gempub_(d, "Published:", published_GempubProperty, out); | 202 | appendProperty_Gempub_(d, "${gempub.meta.pub}:", published_GempubProperty, out); |
204 | } | 203 | } |
205 | appendProperty_Gempub_(d, "Language:", language_GempubProperty, out); | 204 | appendProperty_Gempub_(d, "${gempub.meta.lang}:", language_GempubProperty, out); |
206 | appendProperty_Gempub_(d, "License:", license_GempubProperty, out); | 205 | appendProperty_Gempub_(d, "${gempub.meta.license}:", license_GempubProperty, out); |
207 | appendProperty_Gempub_(d, "\u00a9", copyright_GempubProperty, out); | 206 | appendProperty_Gempub_(d, "\u00a9", copyright_GempubProperty, out); |
207 | translate_Lang(out); | ||
208 | return out; | 208 | return out; |
209 | } | 209 | } |
210 | 210 | ||
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 290bf95e..4158b719 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -1762,7 +1762,7 @@ static void saveToDownloads_(const iString *url, const iString *mime, const iBlo | |||
1762 | exportDownloadedFile_iOS(savePath); | 1762 | exportDownloadedFile_iOS(savePath); |
1763 | #else | 1763 | #else |
1764 | const iMenuItem items[2] = { | 1764 | const iMenuItem items[2] = { |
1765 | { "Open Downloaded File", 0, 0, | 1765 | { "${dlg.save.opendownload}", 0, 0, |
1766 | format_CStr("!open url:%s", cstrCollect_String(makeFileUrl_String(savePath))) }, | 1766 | format_CStr("!open url:%s", cstrCollect_String(makeFileUrl_String(savePath))) }, |
1767 | { "${dlg.message.ok}", 0, 0, "message.ok" }, | 1767 | { "${dlg.message.ok}", 0, 0, "message.ok" }, |
1768 | }; | 1768 | }; |
diff --git a/src/ui/root.c b/src/ui/root.c index d660c468..17682125 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -1252,16 +1252,16 @@ void createUserInterface_Root(iRoot *d) { | |||
1252 | }, | 1252 | }, |
1253 | 4); | 1253 | 4); |
1254 | iWidget *splitMenu = makeMenu_Widget(root, (iMenuItem[]){ | 1254 | iWidget *splitMenu = makeMenu_Widget(root, (iMenuItem[]){ |
1255 | { "Merge Tabs", '1', 0, "ui.split arg:0" }, | 1255 | { "${menu.split.merge}", '1', 0, "ui.split arg:0" }, |
1256 | { "Swap Sides", SDLK_x, 0, "ui.split swap:1" }, | 1256 | { "${menu.split.swap}", SDLK_x, 0, "ui.split swap:1" }, |
1257 | { "---", 0, 0, NULL }, | 1257 | { "---", 0, 0, NULL }, |
1258 | { "Horizontal", '2', 0, "ui.split arg:3 axis:0" }, | 1258 | { "${menu.split.horizontal}", '2', 0, "ui.split arg:3 axis:0" }, |
1259 | { "Horizontal 1:2", SDLK_d, 0, "ui.split arg:1 axis:0" }, | 1259 | { "${menu.split.horizontal} 1:2", SDLK_d, 0, "ui.split arg:1 axis:0" }, |
1260 | { "Horizontal 2:1", SDLK_e, 0, "ui.split arg:2 axis:0" }, | 1260 | { "${menu.split.horizontal} 2:1", SDLK_e, 0, "ui.split arg:2 axis:0" }, |
1261 | { "---", 0, 0, NULL }, | 1261 | { "---", 0, 0, NULL }, |
1262 | { "Vertical", '3', 0, "ui.split arg:3 axis:1" }, | 1262 | { "${menu.split.vertical}", '3', 0, "ui.split arg:3 axis:1" }, |
1263 | { "Vertical 1:2", SDLK_f, 0, "ui.split arg:1 axis:1" }, | 1263 | { "${menu.split.vertical} 1:2", SDLK_f, 0, "ui.split arg:1 axis:1" }, |
1264 | { "Vertical 2:1", SDLK_r, 0, "ui.split arg:2 axis:1" }, | 1264 | { "${menu.split.vertical} 2:1", SDLK_r, 0, "ui.split arg:2 axis:1" }, |
1265 | }, 10); | 1265 | }, 10); |
1266 | setFlags_Widget(splitMenu, disabledWhenHidden_WidgetFlag, iTrue); /* enabled when open */ | 1266 | setFlags_Widget(splitMenu, disabledWhenHidden_WidgetFlag, iTrue); /* enabled when open */ |
1267 | setId_Widget(tabsMenu, "doctabs.menu"); | 1267 | setId_Widget(tabsMenu, "doctabs.menu"); |