-
Notifications
You must be signed in to change notification settings - Fork 967
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for the Maltese Language
- Loading branch information
Showing
12 changed files
with
1,490 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package> | ||
<metadata minClientVersion="2.12"> | ||
<id>Humanizer.Core.mt</id> | ||
<version>$version$</version> | ||
<title>Humanizer Locale (mt)</title> | ||
<authors>Mehdi Khalili, Oren Novotny</authors> | ||
<projectUrl>https://github.com/Humanizr/Humanizer</projectUrl> | ||
<iconUrl>https://raw.github.com/Humanizr/Humanizer/master/logo.png</iconUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>Humanizer Locale (mt)</description> | ||
<copyright>Copyright (c) .NET Foundation and Contributors</copyright> | ||
<licenseUrl>https://raw.githubusercontent.com/Humanizr/Humanizer/master/LICENSE</licenseUrl> | ||
<repository type="$RepositoryType$" url="$RepositoryUrl$" commit="$RepositoryCommit$" /> | ||
<language>mt</language> | ||
<dependencies> | ||
<dependency id="Humanizer.Core" version="[$version$]" /> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="Humanizer\bin\Release\netstandard1.0\mt\*.*" target="lib\netstandard1.0\mt" /> | ||
<file src="Humanizer\bin\Release\netstandard2.0\mt\*.*" target="lib\netstandard2.0\mt" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
src/Humanizer.Tests.Shared/Localisation/mt/DateHumanizeTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
using Humanizer.Localisation; | ||
using Xunit; | ||
|
||
namespace Humanizer.Tests.Localisation.mt | ||
{ | ||
|
||
[UseCulture("mt")] | ||
public class DateHumanizeTests | ||
{ | ||
|
||
[Theory] | ||
[InlineData(-3, "3 jiem ilu")] | ||
[InlineData(-2, "jumejn ilu")] | ||
[InlineData(-1, "il-bieraħ")] | ||
public void DaysAgo(int days, string expected) | ||
{ | ||
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past); | ||
} | ||
|
||
[Theory] | ||
[InlineData(3, "3 jiem oħra")] | ||
[InlineData(2, "pitgħada")] | ||
[InlineData(1, "għada")] | ||
public void DaysFromNow(int days, string expected) | ||
{ | ||
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future); | ||
} | ||
|
||
[Theory] | ||
[InlineData(-3, "3 siegħat ilu")] | ||
[InlineData(-2, "sagħtejn ilu")] | ||
[InlineData(-1, "siegħa ilu")] | ||
public void HoursAgo(int hours, string expected) | ||
{ | ||
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past); | ||
} | ||
|
||
[Theory] | ||
[InlineData(3, "3 siegħat oħra")] | ||
[InlineData(2, "sagħtejn oħra")] | ||
[InlineData(1, "siegħa oħra")] | ||
public void HoursFromNow(int hours, string expected) | ||
{ | ||
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future); | ||
} | ||
|
||
[Theory] | ||
[InlineData(-3, "3 minuti ilu")] | ||
[InlineData(-2, "2 minuti ilu")] | ||
[InlineData(-1, "minuta ilu")] | ||
[InlineData(60, "siegħa ilu")] | ||
public void MinutesAgo(int minutes, string expected) | ||
{ | ||
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past); | ||
} | ||
|
||
[Theory] | ||
[InlineData(2, "2 minuti oħra")] | ||
[InlineData(1, "minuta oħra")] | ||
public void MinutesFromNow(int minutes, string expected) | ||
{ | ||
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future); | ||
} | ||
|
||
[Theory] | ||
[InlineData(-3, "3 xhur ilu")] | ||
[InlineData(-2, "xahrejn ilu")] | ||
[InlineData(-1, "xahar ilu")] | ||
public void MonthsAgo(int months, string expected) | ||
{ | ||
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past); | ||
} | ||
|
||
[Theory] | ||
[InlineData(3, "3 xhur oħra")] | ||
[InlineData(2, "xahrejn oħra")] | ||
[InlineData(1, "xahar ieħor")] | ||
public void MonthsFromNow(int months, string expected) | ||
{ | ||
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future); | ||
} | ||
|
||
[Theory] | ||
[InlineData(-2, "2 sekondi ilu")] | ||
[InlineData(-1, "sekonda ilu")] | ||
public void SecondsAgo(int seconds, string expected) | ||
{ | ||
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past); | ||
} | ||
|
||
[Theory] | ||
[InlineData(2, "2 sekondi oħra")] | ||
[InlineData(1, "sekonda oħra")] | ||
public void SecondsFromNow(int seconds, string expected) | ||
{ | ||
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future); | ||
} | ||
|
||
[Theory] | ||
[InlineData(-3, "3 snin ilu")] | ||
[InlineData(-2, "sentejn ilu")] | ||
[InlineData(-1, "sena ilu")] | ||
public void YearsAgo(int years, string expected) | ||
{ | ||
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past); | ||
} | ||
|
||
[Theory] | ||
[InlineData(3, "3 snin oħra")] | ||
[InlineData(2, "sentejn oħra")] | ||
[InlineData(1, "sena oħra")] | ||
public void YearsFromNow(int years, string expected) | ||
{ | ||
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future); | ||
} | ||
|
||
[Theory] | ||
[InlineData(0, "issa")] | ||
public void Now(int years, string expected) | ||
{ | ||
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future); | ||
} | ||
} | ||
} |
Oops, something went wrong.