From 771373eb6dcd07d654b340a77faf016d06ad5d32 Mon Sep 17 00:00:00 2001 From: MehdiK Date: Wed, 24 Dec 2014 16:04:55 +1000 Subject: [PATCH] Removes UnitPreposition to avoid warnings in Win 8.1 apps --- release_notes.md | 2 +- .../Localisation/Formatters/RomanianFormatter.cs | 10 +++++----- src/Humanizer/Properties/Resources.ro.resx | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/release_notes.md b/release_notes.md index cbe7a6bdf..7883f0a91 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,5 @@ ###In Development - + - [#366](https://github.com/MehdiK/Humanizer/pull/366): Removed UnitPreposition to avoid warnings in Win 8.1 apps - [#365](https://github.com/MehdiK/Humanizer/pull/365): Added ByteSizeExtensions method for long inputs - [#364](https://github.com/MehdiK/Humanizer/pull/364): Added "campuses" as plural of "campus" - [#363](https://github.com/MehdiK/Humanizer/pull/363): Use RegexOptions.Compiled if available diff --git a/src/Humanizer/Localisation/Formatters/RomanianFormatter.cs b/src/Humanizer/Localisation/Formatters/RomanianFormatter.cs index 362194002..545f3610c 100644 --- a/src/Humanizer/Localisation/Formatters/RomanianFormatter.cs +++ b/src/Humanizer/Localisation/Formatters/RomanianFormatter.cs @@ -8,24 +8,24 @@ internal class RomanianFormatter : DefaultFormatter private const int PrepositionIndicatingDecimals = 2; private const int MaxNumeralWithNoPreposition = 19; private const int MinNumeralWithNoPreposition = 1; - private const string PrepositionResourceKey = "UnitPreposition"; + private const string UnitPreposition = " de"; private const string RomanianCultureCode = "ro"; private static readonly double Divider = Math.Pow(10, PrepositionIndicatingDecimals); - private readonly CultureInfo romanianCulture; + private readonly CultureInfo _romanianCulture; public RomanianFormatter() : base(RomanianCultureCode) { - romanianCulture = new CultureInfo(RomanianCultureCode); + _romanianCulture = new CultureInfo(RomanianCultureCode); } protected override string Format(string resourceKey, int number) { - var format = Resources.GetResource(GetResourceKey(resourceKey, number), romanianCulture); + var format = Resources.GetResource(GetResourceKey(resourceKey, number), _romanianCulture); var preposition = ShouldUsePreposition(number) - ? Resources.GetResource(PrepositionResourceKey, romanianCulture) + ? UnitPreposition : string.Empty; return format.FormatWith(number, preposition); diff --git a/src/Humanizer/Properties/Resources.ro.resx b/src/Humanizer/Properties/Resources.ro.resx index ba393d2d7..8dadb6f11 100644 --- a/src/Humanizer/Properties/Resources.ro.resx +++ b/src/Humanizer/Properties/Resources.ro.resx @@ -192,9 +192,6 @@ peste un an - - de - {0}{1} zile