fix #2464 - translation install/upgrade experience
This commit is contained in:
@ -47,7 +47,7 @@ namespace Oqtane.Controllers
|
||||
var code = Path.GetFileName(Path.GetDirectoryName(file));
|
||||
if (!languages.Any(item => item.Code == code))
|
||||
{
|
||||
languages.Add(new Language { Code = code, Name = CultureInfo.GetCultureInfo(code).DisplayName, Version = FileVersionInfo.GetVersionInfo(file).FileVersion, IsDefault = false });
|
||||
languages.Add(new Language { Code = code, Name = CultureInfo.GetCultureInfo(code).DisplayName, Version = FileVersionInfo.GetVersionInfo(file).ProductVersion, IsDefault = false });
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -62,7 +62,7 @@ namespace Oqtane.Controllers
|
||||
var code = Path.GetFileName(Path.GetDirectoryName(file));
|
||||
if (languages.Any(item => item.Code == code))
|
||||
{
|
||||
languages.Single(item => item.Code == code).Version = FileVersionInfo.GetVersionInfo(file).FileVersion;
|
||||
languages.Single(item => item.Code == code).Version = FileVersionInfo.GetVersionInfo(file).ProductVersion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,18 @@ namespace Oqtane.Controllers
|
||||
|
||||
// GET: api/localization
|
||||
[HttpGet()]
|
||||
public IEnumerable<Culture> Get()
|
||||
public IEnumerable<Culture> Get(bool installed)
|
||||
{
|
||||
var cultures = _localizationManager.GetSupportedCultures().Select(c => new Culture
|
||||
string[] culturecodes;
|
||||
if (installed)
|
||||
{
|
||||
culturecodes = _localizationManager.GetInstalledCultures();
|
||||
}
|
||||
else
|
||||
{
|
||||
culturecodes = _localizationManager.GetSupportedCultures();
|
||||
}
|
||||
var cultures = culturecodes.Select(c => new Culture
|
||||
{
|
||||
Name = CultureInfo.GetCultureInfo(c).Name,
|
||||
DisplayName = CultureInfo.GetCultureInfo(c).DisplayName,
|
||||
|
Reference in New Issue
Block a user