mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
commit
667381cd32
@ -84,6 +84,24 @@ std::vector<std::string> AceApplicationInfoImpl::GetLocaleFallback(const std::ve
|
||||
return fileList;
|
||||
}
|
||||
|
||||
std::vector<std::string> AceApplicationInfoImpl::GetResourceFallback(const std::vector<std::string>& resourceList) const
|
||||
{
|
||||
ACE_SCOPED_TRACE("GetResourceFallback");
|
||||
std::vector<std::string> fileList;
|
||||
std::string deviceConfigTag = GetCurrentDeviceResTag();
|
||||
AceResConfig::MatchAndSortResConfigs(resourceList, deviceConfigTag, fileList);
|
||||
return fileList;
|
||||
}
|
||||
|
||||
std::string AceApplicationInfoImpl::GetCurrentDeviceResTag() const
|
||||
{
|
||||
ResolutionType resolutionType = AceResConfig::GetResolutionType(SystemProperties::GetResolution());
|
||||
AceResConfig deviceResConfig = AceResConfig(SystemProperties::GetMcc(), SystemProperties::GetMnc(),
|
||||
SystemProperties::GetDevcieOrientation(), SystemProperties::GetColorMode(), SystemProperties::GetDeviceType(),
|
||||
resolutionType);
|
||||
return AceResConfig::ConvertResConfigToTag(deviceResConfig);
|
||||
}
|
||||
|
||||
void AceApplicationInfoImpl::SetLocale(
|
||||
const std::string& language,
|
||||
const std::string& countryOrRegion,
|
||||
|
@ -37,12 +37,9 @@ public:
|
||||
const std::string& keywordsAndValues) override;
|
||||
void ChangeLocale(const std::string& language, const std::string& countryOrRegion) override;
|
||||
std::vector<std::string> GetLocaleFallback(const std::vector<std::string>& localeList) const override;
|
||||
std::vector<std::string> GetResourceFallback(const std::vector<std::string>& resourceList) const override
|
||||
{
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
std::vector<std::string> GetResourceFallback(const std::vector<std::string>& resourceList) const override;
|
||||
double GetLifeTime() const override { return 0.0f; }
|
||||
std::string GetCurrentDeviceResTag() const override { return std::string(); };
|
||||
std::string GetCurrentDeviceResTag() const override;
|
||||
bool GetFiles(const std::string& filePath, std::vector<std::string>& fileList) const override;
|
||||
|
||||
bool GetBundleInfo(const std::string& packageName, AceBundleInfo& bundleInfo) override;
|
||||
|
@ -154,6 +154,8 @@ void FrontendDelegateImpl::GetConfigurationCommon(const std::string& filePath, s
|
||||
std::vector<std::string> priorityFileName;
|
||||
if (filePath.compare(I18N_FOLDER) == 0) {
|
||||
priorityFileName = AceApplicationInfo::GetInstance().GetLocaleFallback(fileNameList);
|
||||
} else {
|
||||
priorityFileName = AceApplicationInfo::GetInstance().GetResourceFallback(fileNameList);
|
||||
}
|
||||
|
||||
for (const auto& fileName : priorityFileName) {
|
||||
|
Loading…
Reference in New Issue
Block a user