1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Use correct language for scan-objects

This commit is contained in:
Ted John
2018-04-27 18:23:39 +01:00
parent 238079ef7f
commit 7075f6ca25
8 changed files with 38 additions and 9 deletions

View File

@@ -101,7 +101,7 @@ public:
}
public:
std::tuple<bool, ObjectRepositoryItem> Create(const std::string &path) const override
std::tuple<bool, ObjectRepositoryItem> Create(sint32 language, const std::string &path) const override
{
auto extension = Path::GetExtension(path);
if (String::Equals(extension, ".json", true))
@@ -112,7 +112,7 @@ public:
ObjectRepositoryItem item = { 0 };
item.ObjectEntry = *object->GetObjectEntry();
item.Path = String::Duplicate(path);
item.Name = String::Duplicate(object->GetName());
item.Name = String::Duplicate(object->GetName(language));
object->SetRepositoryItem(&item);
delete object;
return std::make_tuple(true, item);
@@ -446,7 +446,8 @@ private:
void ScanObject(const std::string &path)
{
auto result = _fileIndex.Create(path);
auto language = LocalisationService_GetCurrentLanguage();
auto result = _fileIndex.Create(language, path);
if (std::get<0>(result))
{
auto ori = std::get<1>(result);