UI: Internationalization support (#21212)

* rough multiple language demo

* more wrappings

* stash

* add some bad translations

* updates

* map from french to spanish still has same problem of needing to call setText on everything

* add files

* restart UI

* use return code

* relative path

* more translations

* don't loop restart

* Toggle and prime translations

* try on device

* try QComboBox with readable style

* stash

* not yet scrollable

* stash

* dynamic translations (doesn't work for dynamic widget strings yet)

* clean up multiple option selector

* store languages in json

* try transparent

* Try transparent popup

* see how this looks

* tweaks

* clean up

* update names

* Add Chinese (Simplified) translations

* Do missing French translations

* unit tests caught that :)

* fix test

* fix other test (on PC)

* add entries to dialog to test

* add cancel button, clean up a bit

* just chinese

* some clean up

* use quotes

* clean up

* Just quit, set timeout to 0

* half a second

* use exitcode

* don't print if it's expected

* this comment is outdated

* update translations

* Update translations

* re-order input classes

* Update line numbers

* use enabled property for button style

* Get rid of ListWidget

* Update line numbers

* Log failed to load language

* Log failed to load language

* Move to utils and fix english logging

extra line

* Update translations

* spacing

* looks a bit better

* try this instead of exitcode

fixes

fix

* only one function

* comment

* Update line numbers

* fixup some japanese translations

* clean up multi option dialog

* Update line numbers
old-commit-hash: 949de4d2b6
This commit is contained in:
Shane Smiskol
2022-07-08 20:25:54 -07:00
committed by GitHub
parent c9dc7a9458
commit 23de7b166e
19 changed files with 410 additions and 259 deletions

View File

@@ -129,6 +129,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"IsUpdateAvailable", CLEAR_ON_MANAGER_START},
{"JoystickDebugMode", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF},
{"LaikadEphemeris", PERSISTENT | DONT_LOG},
{"LanguageSetting", PERSISTENT},
{"LastAthenaPingTime", CLEAR_ON_MANAGER_START},
{"LastGPSPosition", PERSISTENT},
{"LastManagerExitReason", CLEAR_ON_MANAGER_START},

View File

@@ -1,12 +1,9 @@
#include "common/watchdog.h"
#include "common/timing.h"
#include "common/util.h"
const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + <pid>
bool watchdog_kick() {
bool watchdog_kick(uint64_t ts) {
static std::string fn = watchdog_fn_prefix + std::to_string(getpid());
uint64_t ts = nanos_since_boot();
return util::write_file(fn.c_str(), &ts, sizeof(ts), O_WRONLY | O_CREAT) > 0;
}

View File

@@ -1,3 +1,5 @@
#pragma once
bool watchdog_kick();
#include <cstdint>
bool watchdog_kick(uint64_t ts);