Return GetNames languages, to avoid hardcoded language lists in callers

This makes the code cleaner and also leads to some user-visible changes:

The wx game properties will no longer let the user
select WAD languages that don't have any names.

The Qt game list will now display names using the languages
set in the configuration instead of always using
English for PAL GC games and Japanese for WADs.

If a WAD doesn't have a name in the user's preferred language,
English is now selected as a fallback before Japanese.
This commit is contained in:
JosJuice
2015-04-09 17:44:53 +02:00
parent 87a63713f4
commit 235ecfbed7
30 changed files with 399 additions and 340 deletions

View File

@ -5,6 +5,7 @@
#pragma once
#include <string>
#include <utility>
#include <vector>
#include "Common/Common.h"
@ -24,11 +25,14 @@ public:
bool IsValid() const {return m_Valid;}
const std::string& GetFileName() const {return m_FileName;}
std::string GetBannerName(int index) const;
std::string GetVolumeName(int index) const;
std::string GetName(int index) const;
std::string GetBannerName(IVolume::ELanguage language) const;
std::string GetVolumeName(IVolume::ELanguage language) const;
std::string GetName(IVolume::ELanguage language) const;
std::string GetName() const;
std::string GetCompany() const;
std::string GetDescription(int index = 0) const;
std::string GetDescription(IVolume::ELanguage language) const;
std::string GetDescription() const;
std::vector<IVolume::ELanguage> GetLanguages() const;
int GetRevision() const { return m_Revision; }
const std::string& GetUniqueID() const {return m_UniqueID;}
const std::string GetWiiFSPath() const;
@ -58,12 +62,12 @@ private:
std::string m_FileName;
// TODO: eliminate this and overwrite with names from banner when available?
std::vector<std::string> m_volume_names;
std::map<IVolume::ELanguage, std::string> m_volume_names;
// Stuff from banner
std::string m_company;
std::vector<std::string> m_banner_names;
std::vector<std::string> m_descriptions;
std::map<IVolume::ELanguage, std::string> m_banner_names;
std::map<IVolume::ELanguage, std::string> m_descriptions;
std::string m_UniqueID;