tidy-fix automàtic (sense naming)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user