Ken Van Hoeylandt 8c8ccd8783
Merge develop into main (#305)
## New features

- Implement translations for apps
- Created `tt::settings::setLanguage` and `::getLanguage()`
- External app errors are now reported to the user via an AlertDialog
- Store system settings in `/data/settings.properties`
- Created a "Region & Language" app and moved the timezone setting there.

## Other changes

- Change `/data` and `/system` filesystem sector size from 4096 to 512 bytes to allow for more small files (60+ files of 4kB were over the limit of 256kB for the filesystem)
- Increased size of `/data` and `/system`
- Moved `tt::time::*` to `tt::settings`
- Removed the timezone setting from the "Time & Date" setting app
- Reverse encoder direction of Lilygo T-Lora Pager
- Improved partability of `Time.cpp` (removed separate set of functions for PC/sim)
2025-08-28 21:50:29 +02:00

43 lines
920 B
C++

#include "tt_time.h"
#include <Tactility/settings/Time.h>
#include <cstring>
using namespace tt;
extern "C" {
void tt_timezone_set(const char* name, const char* code) {
settings::setTimeZone(name, code);
}
bool tt_timezone_get_name(char* buffer, size_t bufferSize) {
auto name = settings::getTimeZoneName();
if (bufferSize < (name.length() + 1)) {
return false;
} else {
strcpy(buffer, name.c_str());
return true;
}
}
bool tt_timezone_get_code(char* buffer, size_t bufferSize) {
auto code = settings::getTimeZoneCode();
if (bufferSize < (code.length() + 1)) {
return false;
} else {
strcpy(buffer, code.c_str());
return true;
}
}
bool tt_timezone_is_format_24_hour() {
return settings::isTimeFormat24Hour();
}
void tt_timezone_set_format_24_hour(bool show24Hour) {
return settings::setTimeFormat24Hour(show24Hour);
}
}