diff --git a/modules/cert.cpp b/modules/cert.cpp index e06245a8..6054b156 100644 --- a/modules/cert.cpp +++ b/modules/cert.cpp @@ -25,36 +25,35 @@ class CCertMod : public CModule { public: void Delete(const CString& line) { if (CFile::Delete(PemFile())) { - PutModule("Pem file deleted"); + PutModule(t("Pem file deleted")); } else { - PutModule( + PutModule(t( "The pem file doesn't exist or there was a error deleting the " - "pem file."); + "pem file.")); } } void Info(const CString& line) { if (HasPemFile()) { - PutModule("You have a certificate in: " + PemFile()); + PutModule(f("You have a certificate in {1}")(PemFile())); } else { - PutModule( + PutModule(t( "You do not have a certificate. Please use the web interface " - "to add a certificate"); + "to add a certificate")); if (GetUser()->IsAdmin()) { - PutModule("Alternatively you can either place one at " + - PemFile()); + PutModule(f( + "Alternatively you can either place one at {1}")( + PemFile())); } } } MODCONSTRUCTOR(CCertMod) { AddHelpCommand(); - AddCommand("delete", - static_cast(&CCertMod::Delete), "", - "Delete the current certificate"); - AddCommand("info", - static_cast(&CCertMod::Info), "", - "Show the current certificate"); + AddCommand("delete", "", d("Delete the current certificate"), + [=](const CString& sLine) { Delete(sLine); }); + AddCommand("info", "", d("Show the current certificate"), + [=](const CString& sLine) { Info(sLine); }); } ~CCertMod() override {} @@ -71,7 +70,7 @@ class CCertMod : public CModule { return CONTINUE; } - CString GetWebMenuTitle() override { return "Certificate"; } + CString GetWebMenuTitle() override { return t("Certificate"); } bool OnWebRequest(CWebSock& WebSock, const CString& sPageName, CTemplate& Tmpl) override { @@ -104,4 +103,4 @@ void TModInfo(CModInfo& Info) { Info.SetWikiPage("cert"); } -NETWORKMODULEDEFS(CCertMod, "Use a ssl certificate to connect to a server") +NETWORKMODULEDEFS(CCertMod, t("Use a ssl certificate to connect to a server")) diff --git a/modules/data/cert/tmpl/index.tmpl b/modules/data/cert/tmpl/index.tmpl index 0885cb15..332339c4 100644 --- a/modules/data/cert/tmpl/index.tmpl +++ b/modules/data/cert/tmpl/index.tmpl @@ -1,23 +1,25 @@ + -

You already have a certificate set, use the form below to overwrite the current certificate. Alternatively click here to delete your certificate.

+ +

-

You do not have a cert.

+

-

Certificate

+

-
PEM File:
+
- + " />
diff --git a/modules/po/cert.pot b/modules/po/cert.pot new file mode 100644 index 00000000..cabadf17 --- /dev/null +++ b/modules/po/cert.pot @@ -0,0 +1,59 @@ +#: cert.cpp:28 +msgid "Pem file deleted" +msgstr "" + +#: cert.cpp:31 +msgid "The pem file doesn't exist or there was a error deleting the pem file." +msgstr "" + +#: cert.cpp:38 +msgid "You have a certificate in {1}" +msgstr "" + +#: cert.cpp:41 +msgid "" +"You do not have a certificate. Please use the web interface to add a " +"certificate" +msgstr "" + +#: cert.cpp:45 +msgid "Alternatively you can either place one at {1}" +msgstr "" + +#: cert.cpp:53 +msgid "Delete the current certificate" +msgstr "" + +#: cert.cpp:55 +msgid "Show the current certificate" +msgstr "" + +#: cert.cpp:73 modules/po/../data/cert/tmpl/index.tmpl:14 +msgid "Certificate" +msgstr "" + +#: cert.cpp:106 +msgid "Use a ssl certificate to connect to a server" +msgstr "" + +#: modules/po/../data/cert/tmpl/index.tmpl:5 +msgid "here" +msgstr "" + +#: modules/po/../data/cert/tmpl/index.tmpl:6 +msgid "" +"You already have a certificate set, use the form below to overwrite the " +"current certificate. Alternatively click {1} to delete your certificate." +msgstr "" + +#: modules/po/../data/cert/tmpl/index.tmpl:8 +msgid "You do not have a certificate yet." +msgstr "" + +#: modules/po/../data/cert/tmpl/index.tmpl:18 +msgid "PEM File:" +msgstr "" + +#: modules/po/../data/cert/tmpl/index.tmpl:22 +msgid "Update" +msgstr ""