Fix/peek/file size (#28051)

* [Peek] displaying file size in correct grammatical format

* Update Directory.Packages.props

* removed unnecessary file
This commit is contained in:
Deepak Sangle 2023-08-21 14:28:50 +05:30 committed by GitHub
parent 08337a9578
commit a8b7d4d627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -73,4 +73,4 @@
<PackageVersion Include="Microsoft.VariantAssignment.Client" Version="2.4.17140001" />
<PackageVersion Include="Microsoft.VariantAssignment.Contract" Version="3.0.16990001" />
</ItemGroup>
</Project>
</Project>

View File

@ -17,7 +17,9 @@ namespace Peek.Common.Helpers
var resourceLoader = ResourceLoaderInstance.ResourceLoader;
List<string> format = new List<string>
{
resourceLoader.GetString("ReadableString_ByteAbbreviationFormat"), // "B"
(bytes == 1) ?
resourceLoader.GetString("ReadableString_ByteAbbreviationFormat") : // "byte"
resourceLoader.GetString("ReadableString_BytesAbbreviationFormat"), // "bytes"
resourceLoader.GetString("ReadableString_KiloByteAbbreviationFormat"), // "KB"
resourceLoader.GetString("ReadableString_MegaByteAbbreviationFormat"), // "MB"
resourceLoader.GetString("ReadableString_GigaByteAbbreviationFormat"), // "GB"

View File

@ -154,7 +154,7 @@
<comment>Date Modified label for the unsupported files view. {0} is the date.</comment>
</data>
<data name="ReadableString_ByteAbbreviationFormat" xml:space="preserve">
<value>{0} bytes</value>
<value>{0} byte</value>
<comment>Abbreviation for the size unit byte.</comment>
</data>
<data name="ReadableString_KiloByteAbbreviationFormat" xml:space="preserve">
@ -233,4 +233,8 @@
<value>{0} (extracted {1})</value>
<comment>{0} is the size of the archive, {1} is the extracted size</comment>
</data>
<data name="ReadableString_BytesAbbreviationFormat" xml:space="preserve">
<value>{0} bytes</value>
<comment>Abbreviation for the size bytes</comment>
</data>
</root>