Add JSON language support for sysmodule notifications.
Load Ultrahand locale translations from /config/horizon-oc/lang so user-facing hoc-clk alerts match the overlay language.
This commit is contained in:
19 files changed
+413
-16
No files matched your search
@@ -15,6 +15,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lang.hpp"
|
||||
#include "notification.h"
|
||||
|
||||
namespace notification {
|
||||
@@ -27,13 +28,15 @@ namespace notification {
|
||||
}
|
||||
fclose(flagFile);
|
||||
|
||||
const std::string translated = lang::translate(message);
|
||||
|
||||
std::string filename = "hoc-" + std::to_string(std::time(nullptr)) + ".notify";
|
||||
std::string fullPath = "sdmc:/config/ultrahand/notifications/" + filename;
|
||||
|
||||
FILE *file = fopen(fullPath.c_str(), "w");
|
||||
if (file) {
|
||||
fprintf(file, "{\n");
|
||||
fprintf(file, " \"text\": \"%s\",\n", message.c_str());
|
||||
fprintf(file, " \"text\": \"%s\",\n", translated.c_str());
|
||||
fprintf(file, " \"fontSize\": 28\n");
|
||||
fprintf(file, "}\n");
|
||||
fclose(file);
|
||||
|
||||
Reference in new issue
Block a user