tidy-fix automàtic (sense naming)
This commit is contained in:
1 parent
358e91ea30
commit
b7a551c158
81 files changed
+1549
-831
No files matched your search
@@ -15,7 +15,7 @@ namespace Locale {
|
||||
static void traverse(const fkyaml::node& node, const std::string& prefix) {
|
||||
if (node.is_mapping()) {
|
||||
for (auto it = node.begin(); it != node.end(); ++it) {
|
||||
std::string key = it.key().get_value<std::string>();
|
||||
auto key = it.key().get_value<std::string>();
|
||||
std::string full = prefix.empty() ? key : prefix + "." + key;
|
||||
traverse(it.value(), full);
|
||||
}
|
||||
@@ -26,7 +26,7 @@ namespace Locale {
|
||||
}
|
||||
}
|
||||
|
||||
bool load(const char* filename) {
|
||||
auto load(const char* filename) -> bool {
|
||||
auto buffer = ResourceHelper::loadFile(filename);
|
||||
if (buffer.empty()) {
|
||||
std::cerr << "Locale: unable to load " << filename << '\n';
|
||||
@@ -48,7 +48,9 @@ namespace Locale {
|
||||
|
||||
auto get(const char* key) -> const char* {
|
||||
auto it = strings_.find(key);
|
||||
if (it != strings_.end()) return it->second.c_str();
|
||||
if (it != strings_.end()) {
|
||||
return it->second.c_str();
|
||||
}
|
||||
return key; // fallback: retorna la clau mateixa
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Les claus són nested amb notació punt ("menu.items.zoom").
|
||||
// Si una clau no existeix, Locale::get torna la clau mateixa (útil per debug).
|
||||
namespace Locale {
|
||||
bool load(const char* filename);
|
||||
auto load(const char* filename) -> bool;
|
||||
|
||||
// Retorna la cadena associada a la clau. El punter és estable durant tota la
|
||||
// sessió (no canvia), per tant es pot guardar en const char*.
|
||||
|
||||
Reference in new issue
Block a user