From 7c5877156da5aeb7237c4d2dfa96403144173b28 Mon Sep 17 00:00:00 2001 From: Thomas Levesque Date: Mon, 26 Nov 2018 13:30:43 +0100 Subject: [PATCH] Update README --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 258f631..968c8fe 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,14 @@ Console.WriteLine("The size of '{0}' is {1}", f, formatter.Format(f.Length)); Localization ------------ -At this stage, HumanBytes only supports English and French. However, if you need support for another language, it's very easy: there are only 3 terms that need to be translated, so it shouldn't take more than a minute. Here are the steps: +At this stage, HumanBytes only supports English and French. However, if you need support for another language, it's very easy, as there are only 3 terms that need to be translated. Just create an instance of `ByteSizeFormatter` as shown above, and set the following properties: -- add a `Resources.xx.resx` file (where `xx` is the language code) in the `HumanBytes/Properties` folder, and translate the terms -- edit `HumanBytes/HumanBytes.csproj` to include the new resource file -- edit `NuGet\HumanBytes.nuspec` to include the new satellite assembly +- `ByteSymbol`: the symbol for byte, e.g. "B" in English. +- `ByteWord`: the word for byte, e.g. "byte" in English. +- `ByteWords`: the word for several bytes, e.g. "bytes" in English. + +The values set on these properties will be used instead of the ones defined in resources. + +If you would like to add permanent support for another language, you'll have to modify the library itself. Just clone the project, add a `Resources.xx.resx` file (where `xx` is the language code) in the `HumanBytes/Properties` folder, translate the terms, and build. I'll be glad to accept pull requests to support more languages.