Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes UnitPreposition to avoid warnings in Win 8.1 apps #366

Merged
merged 1 commit into from
Dec 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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