diff options
author | Alexander Paramonov <sasha110397@gmail.com> | 2024-04-23 16:35:40 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-04-29 19:32:35 +0300 |
commit | 3ad903a76521547d2372c56a34c9c2e2c30ec98d (patch) | |
tree | 19c458d1827f99c2fe685a08a0dcb954e96b3fe8 | |
parent | 499b5b4dcbf3a936e65694de24219e65e3268e4d (diff) | |
download | bmcweb-3ad903a76521547d2372c56a34c9c2e2c30ec98d.tar.xz |
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 <Sasha110397@gmail.com>
-rw-r--r-- | redfish-core/lib/message_registries.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
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) |