Skip to content

Commit

Permalink
Update LanguageManager.cs with SlovenianLanguage (#1327)
Browse files Browse the repository at this point in the history
* Update LanguageManager.cs

* Add SlovenianLanguage

* Add missing license header, convert spaces to tabs, fix braces layout

* Update changelog.

Co-authored-by: Jeremy Skinner <jeremy@jeremyskinner.co.uk>
  • Loading branch information
bostjankosi and JeremySkinner committed Feb 20, 2020
1 parent 7ff8ac2 commit 76160de
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Translations of default error messages into other languages are now lazily-loade
PropertyValidator.ShouldValidateAsync reanamed to ShouldValidateAsynchronously to remove confusion where the naming suggested this was an async method
PropertyValidatorContext.Instance renamed to InstanceToValidate for consistency with ValidationContext.
Removed various methods from MessageFormatter that were deprecated in 8.x
Added Slovenian translations of default error messages.

8.6.0 - 4 December 2019
Add support for ASP.NET Core 3.1
Expand Down
1 change: 1 addition & 0 deletions src/FluentValidation/FluentValidation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Changes in 9.0.0:
* Remove DisplayAttribute integration and reference to DataAnnotations.
* ComparisonProperty placeholder is now formatted like PropertyName
* Translations of default error messages into other languages are now lazily-loaded
* Added Slovenian translations of default error messages.

Full release notes can be found at https://github.com/JeremySkinner/FluentValidation/blob/master/Changelog.txt
</PackageReleaseNotes>
Expand Down
1 change: 1 addition & 0 deletions src/FluentValidation/Resources/LanguageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class LanguageManager : ILanguageManager {
RomanianLanguage.Culture => new RomanianLanguage(),
RussianLanguage.Culture => new RussianLanguage(),
SlovakLanguage.Culture => new SlovakLanguage(),
SlovenianLanguage.Culture => new SlovenianLanguage(),
SpanishLanguage.Culture => new SpanishLanguage(),
SwedishLanguage.Culture => new SwedishLanguage(),
TurkishLanguage.Culture => new TurkishLanguage(),
Expand Down
60 changes: 60 additions & 0 deletions src/FluentValidation/Resources/Languages/SlovenianLanguage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#region License
// Copyright (c) Jeremy Skinner (http://www.jeremyskinner.co.uk)
// and contributors.
//
// 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.
//
// The latest version of this file can be found at https://github.com/FluentValidation/FluentValidation
#endregion

namespace FluentValidation.Resources {
using Validators;

internal class SlovenianLanguage : Language {
public const string Culture = "sl";
public override string Name => Culture;

public SlovenianLanguage() {
Translate<EmailValidator>("'{PropertyName}' ni veljaven e-poštni naslov.");
Translate<GreaterThanOrEqualValidator>("'{PropertyName}' mora biti večji ali enak '{ComparisonValue}'.");
Translate<GreaterThanValidator>("'{PropertyName}' mora biti večji od '{ComparisonValue}'.");
Translate<LengthValidator>("'{PropertyName}' mora imeti dolžino med {MinLength} in {MaxLength} znakov. Vnesli ste {TotalLength} znakov.");
Translate<MinimumLengthValidator>("'{PropertyName}' mora imeti dolžino večjo ali enako {MinLength}. Vnesli ste {TotalLength} znakova.");
Translate<MaximumLengthValidator>("'{PropertyName}' mora imeti dolžino manjšo ali enako {MaxLength}. Vnesli ste {TotalLength} znakova.");
Translate<LessThanOrEqualValidator>("'{PropertyName}' mora biti manjši ali enak '{ComparisonValue}'.");
Translate<LessThanValidator>("'{PropertyName}' mora biti manjši od '{ComparisonValue}'.");
Translate<NotEmptyValidator>("'{PropertyName}' ne sme biti prazen.");
Translate<NotEqualValidator>("'{PropertyName}' ne sme biti enak '{ComparisonValue}'.");
Translate<NotNullValidator>("'{PropertyName}' ne sme biti prazen.");
Translate<PredicateValidator>("Določen pogoj ni bil izpolnjen za '{PropertyName}'.");
Translate<AsyncPredicateValidator>("Določen pogoj ni bil izpolnjen za '{PropertyName}'.");
Translate<RegularExpressionValidator>("'{PropertyName}' ni v pravilni obliki.");
Translate<EqualValidator>("'{PropertyName}' mora biti enak '{ComparisonValue}'.");
Translate<ExactLengthValidator>("'{PropertyName}' mora imeti {MaxLength} znakov. Vnesli ste {TotalLength} znakov.");
Translate<InclusiveBetweenValidator>("'{PropertyName}' mora biti med {From} in {To}. Vnesli ste {Value}.");
Translate<ExclusiveBetweenValidator>("'{PropertyName}' mora biti med {From} in {To} (izključno). Vnesli ste {Value}.");
Translate<CreditCardValidator>("'{PropertyName}' ni veljavna številka kreditne kartice.");
Translate<ScalePrecisionValidator>("'{PropertyName}' ne sme biti več kot {ExpectedPrecision} natančno števk in {ExpectedScale} decimalk. Vnesli ste {Digits} števk in {ActualScale} decimalk.");
Translate<EmptyValidator>("'{PropertyName}' mora biti prazen.");
Translate<NullValidator>("'{PropertyName}' mora biti prazen.");
Translate<EnumValidator>("'{PropertyName}' ima obseg vrednosti, ki ne vključuje '{PropertyValue}'.");
// Additional fallback messages used by clientside validation integration.
Translate("Length_Simple", "'{PropertyName}' imeti dolžino med {MinLength} in {MaxLength} znakov. ");
Translate("MinimumLength_Simple", "'{PropertyName}' mora imeti dolžino večjo ali enako {MinLength}.");
Translate("MaximumLength_Simple", "'{PropertyName}' mora imeti dolžino manjšo ali enako {MaxLength}.");
Translate("ExactLength_Simple", "'{PropertyName}' mora imeti {MaxLength} znakov.");
Translate("InclusiveBetween_Simple", "'{PropertyName}' mora biti med {From} in {To}.");
}
}
}

0 comments on commit 76160de

Please sign in to comment.