From 3ad903a76521547d2372c56a34c9c2e2c30ec98d Mon Sep 17 00:00:00 2001 From: Alexander Paramonov Date: Tue, 23 Apr 2024 16:35:40 +0300 Subject: Use actual language for registries list Use language from header for registries list instead of hardcoded 'en'. Language from header is already being used in some parts of code[1], but is hardcoded sometimes. This commit fixes inconsistency. TESTED: current language in header with Redfish definition is now consistently taken into account. [1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/70741/1/redfish-core/lib/message_registries.hpp#b214 Change-Id: Ic5e8e5e76d171b1cb18953e5602f09132b222f3b Signed-off-by: Alexander Paramonov --- redfish-core/lib/message_registries.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'redfish-core') diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp index ead4e38a67..92721eb762 100644 --- a/redfish-core/lib/message_registries.hpp +++ b/redfish-core/lib/message_registries.hpp @@ -122,12 +122,12 @@ inline void handleMessageRoutesMessageRegistryFileGet( asyncResp->res.jsonValue["Id"] = header->registryPrefix; asyncResp->res.jsonValue["Registry"] = header->id; nlohmann::json::array_t languages; - languages.emplace_back("en"); + languages.emplace_back(header->language); asyncResp->res.jsonValue["Languages@odata.count"] = languages.size(); asyncResp->res.jsonValue["Languages"] = std::move(languages); nlohmann::json::array_t locationMembers; nlohmann::json::object_t location; - location["Language"] = "en"; + location["Language"] = header->language; location["Uri"] = "/redfish/v1/Registries/" + registry + "/" + registry; if (url != nullptr) -- cgit v1.2.3