|
2 | 2 |
|
3 | 3 | #include "global/io/fileinfo.h"
|
4 | 4 | #include "global/serialization/zipreader.h"
|
| 5 | +#include "global/translation.h" |
5 | 6 | #include "global/uuid.h"
|
6 | 7 |
|
7 | 8 | #include "../extensionstypes.h"
|
@@ -41,24 +42,27 @@ Ret ExtensionInstaller::installExtension(const io::path_t srcPath)
|
41 | 42 | if (alreadyInstalled && existingManifest.version == m.version) {
|
42 | 43 | LOGI() << "already installed: " << m.uri;
|
43 | 44 |
|
44 |
| - interactive()->info("Info", "The extension is already installed.", { interactive()->buttonData(IInteractive::Button::Ok) }); |
| 45 | + interactive()->info(trc("extensions", "The extension is already installed."), std::string(), |
| 46 | + { interactive()->buttonData(IInteractive::Button::Ok) }); |
45 | 47 |
|
46 | 48 | return make_ok();
|
47 | 49 | }
|
48 | 50 |
|
49 | 51 | if (alreadyInstalled && !existingManifest.isUserExtension) {
|
50 |
| - interactive()->error("Error", "This extension cannot be updated.", { interactive()->buttonData(IInteractive::Button::Ok) }); |
| 52 | + interactive()->error(trc("extensions", "This extension cannot be updated."), std::string(), |
| 53 | + { interactive()->buttonData(IInteractive::Button::Ok) }); |
51 | 54 |
|
52 | 55 | return make_ok();
|
53 | 56 | }
|
54 | 57 |
|
55 | 58 | if (alreadyInstalled) {
|
56 |
| - std::stringstream text; |
57 |
| - text << "The extension \"" << existingManifest.title.toStdString() << |
58 |
| - "\" is already installed in a different version.\nDo you want to upgrade?\n\nCurrent version: " << |
59 |
| - existingManifest.version.toStdString() << "\nNew version: " << m.version.toStdString(); |
60 |
| - IInteractive::Result result = interactive()->question("Update Extension", text.str(), { |
61 |
| - interactive()->buttonData(IInteractive::Button::Cancel), interactive()->buttonData(IInteractive::Button::Ok) |
| 59 | + std::string text = qtrc("extensions", "Another version of the extension “%1” is already installed (version %2). " |
| 60 | + "Do you want to replace it with version %3?") |
| 61 | + .arg(existingManifest.title, existingManifest.version, m.version).toStdString(); |
| 62 | + |
| 63 | + IInteractive::Result result = interactive()->question(trc("extensions", "Update Extension"), text, { |
| 64 | + interactive()->buttonData(IInteractive::Button::Cancel), |
| 65 | + interactive()->buttonData(IInteractive::Button::Ok) |
62 | 66 | });
|
63 | 67 |
|
64 | 68 | if (result.button() == int(IInteractive::Button::Ok)) {
|
|
0 commit comments