Localize alert messages in admin pages

This commit is contained in:
hishamco
2020-12-09 21:12:00 +03:00
parent 3c71282379
commit a29d7b524c
46 changed files with 163 additions and 162 deletions

View File

@ -74,7 +74,7 @@
{
if (url == string.Empty || _folderId == -1)
{
AddModuleMessage("You Must Enter A Url And Select A Folder", MessageType.Warning);
AddModuleMessage(Localizer["You Must Enter A Url And Select A Folder"], MessageType.Warning);
return;
}
@ -83,13 +83,13 @@
if (!Constants.UploadableFiles.Split(',')
.Contains(Path.GetExtension(filename).ToLower().Replace(".", "")))
{
AddModuleMessage("File Could Not Be Downloaded From Url Due To Its File Extension", MessageType.Warning);
AddModuleMessage(Localizer["File Could Not Be Downloaded From Url Due To Its File Extension"], MessageType.Warning);
return;
}
if (!filename.IsPathOrFileValid())
{
AddModuleMessage("You Must Enter A Url With A Valid File Name", MessageType.Warning);
AddModuleMessage(Localizer["You Must Enter A Url With A Valid File Name"], MessageType.Warning);
return;
}
@ -97,12 +97,12 @@
{
await FileService.UploadFileAsync(url, _folderId);
await logger.LogInformation("File Downloaded Successfully From Url {Url}", url);
AddModuleMessage("File Downloaded Successfully From Url", MessageType.Success);
AddModuleMessage(Localizer["File Downloaded Successfully From Url"], MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading File From Url {Url} {Error}", url, ex.Message);
AddModuleMessage("Error Downloading File From Url. Please Verify That The Url Is Valid.", MessageType.Error);
AddModuleMessage(Localizer["Error Downloading File From Url. Please Verify That The Url Is Valid."], MessageType.Error);
}
}
}