Skip to content

Commit

Permalink
Removes UnitPreposition to avoid warnings in Win 8.1 apps
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiK committed Dec 24, 2014
1 parent 4582279 commit 771373e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Humanizer/Localisation/Formatters/RomanianFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions src/Humanizer/Properties/Resources.ro.resx
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@
<data name="DateHumanize_SingleYearFromNow" xml:space="preserve">
<value>peste un an</value>
</data>
<data name="UnitPreposition" xml:space="preserve">
<value> de</value>
</data>
<data name="TimeSpanHumanize_MultipleDays" xml:space="preserve">
<value>{0}{1} zile</value>
</data>
Expand Down

0 comments on commit 771373e

Please sign in to comment.