Skip to content

Commit

Permalink
Merge pull request #211 from EsseFNC/master
Browse files Browse the repository at this point in the history
Adds italian natural strategy
  • Loading branch information
joaomatossilva authored Nov 11, 2024
2 parents 6bf1022 + 3bba251 commit 4c766f6
Showing 1 changed file with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#region License

//
// Copyright (c) 2011-2012, Jo�o Matos Silva <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#endregion

using DateTimeExtensions.Common;

namespace DateTimeExtensions.NaturalText.CultureStrategies
{
[Locale("it-IT")]
public class IT_ITNaturalTimeStrategy : NaturalTimeStrategyBase
{
protected override string YearText
{
get { return "Anno"; }
}

protected override string MonthText
{
get { return "Mese"; }
}

protected override string DayText
{
get { return "Giorno"; }
}

protected override string HourText
{
get { return "Ora"; }
}

protected override string MinuteText
{
get { return "Minuto"; }
}

protected override string SecondText
{
get { return "Secondo"; }
}

protected override string Pluralize(string text, int value)
{
// referring to hours
if (text.EndsWith("a"))
{
return text.Remove(text.Length -1, 1) + "e";
}

// referring to years, months, days, minutes and seconds
return text.Remove(text.Length -1, 1) + "i";
}
}
}

0 comments on commit 4c766f6

Please sign in to comment.