-
Notifications
You must be signed in to change notification settings - Fork 8
/
LanguageWorker_Romanian.cs
71 lines (65 loc) · 1.25 KB
/
LanguageWorker_Romanian.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Verse.LanguageWorker_Romanian
using Verse;
public class LanguageWorker_Romanian : LanguageWorker
{
public override string WithIndefiniteArticle(string str, Gender gender, bool plural = false, bool name = false)
{
if (name)
{
return str;
}
if (plural)
{
if (gender != Gender.Male)
{
return str + "e";
}
return str + "i";
}
return ((gender == Gender.Female) ? "a " : "un ") + str;
}
public override string WithDefiniteArticle(string str, Gender gender, bool plural = false, bool name = false)
{
if (str.NullOrEmpty())
{
return str;
}
if (name)
{
return str;
}
char ch = str[str.Length - 1];
if (plural)
{
if (gender != Gender.Male)
{
return str + "e";
}
return str + "i";
}
if (!IsVowel(ch))
{
return str + "ul";
}
if (gender == Gender.Male)
{
return str + "le";
}
return str + "a";
}
public bool IsVowel(char ch)
{
return "aeiouăâîAEIOUĂÂÎ".IndexOf(ch) >= 0;
}
/*
public override string OrdinalNumber(int number, Gender gender = Gender.None) {
// TODO
}
public override string Pluralize(string str, Gender gender, int count = -1) {
// TODO
}
public override string PostProcessed(string str) {
// TODO
}
*/
}