-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Added kyrgyz language #166
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -23,6 +23,7 @@ public enum ValueConverters { | |
SLOVAK_INTEGER(Container.slovakContainer().getIntegerConverter(), "sk"), | ||
LATVIAN_INTEGER(Container.latvianContainer().getIntegerConverter(), "lv"), | ||
KAZAKH_INTEGER(Container.kazakhContainer().getIntegerConverter(), "kk"), | ||
KYRGYZ_INTEGER(Container.kyrgyzContainer().getIntegerConverter(), "kg"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be "ky", because of locale |
||
UKRAINIAN_INTEGER(Container.ukrainianContainer().getIntegerConverter(), "uk"), | ||
SERBIAN_INTEGER(Container.serbianContainer().getIntegerConverter(), Arrays.asList("sr", getLanguageCodeFor("sr", "Latn"))), | ||
SERBIAN_CYRILLIC_INTEGER(Container.serbianCyrillicContainer().getIntegerConverter(), getLanguageCodeFor("sr", "Cyrl")), | ||
|
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
23 changes: 23 additions & 0 deletions
23
src/main/java/pl/allegro/finance/tradukisto/internal/languages/kyrgyz/KyrgyzPluralForms.java
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,23 @@ | ||
package pl.allegro.finance.tradukisto.internal.languages.kyrgyz; | ||
|
||
import pl.allegro.finance.tradukisto.internal.languages.GenderType; | ||
import pl.allegro.finance.tradukisto.internal.languages.PluralForms; | ||
|
||
public class KyrgyzPluralForms implements PluralForms { | ||
|
||
private String form; | ||
|
||
public KyrgyzPluralForms(String form) { | ||
this.form = form; | ||
} | ||
|
||
@Override | ||
public String formFor(Integer value) { | ||
return form; | ||
} | ||
|
||
@Override | ||
public GenderType genderType() { | ||
return GenderType.NON_APPLICABLE; | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
src/main/java/pl/allegro/finance/tradukisto/internal/languages/kyrgyz/KyrgyzValues.java
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,77 @@ | ||
package pl.allegro.finance.tradukisto.internal.languages.kyrgyz; | ||
|
||
import pl.allegro.finance.tradukisto.internal.BaseValues; | ||
import pl.allegro.finance.tradukisto.internal.languages.GenderForms; | ||
import pl.allegro.finance.tradukisto.internal.languages.PluralForms; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static pl.allegro.finance.tradukisto.internal.support.BaseNumbersBuilder.baseNumbersBuilder; | ||
|
||
public class KyrgyzValues implements BaseValues { | ||
|
||
@Override | ||
public Map<Integer, GenderForms> baseNumbers() { | ||
return baseNumbersBuilder() | ||
.put(0, "нөл") | ||
.put(1, "бир") | ||
.put(2, "эки") | ||
.put(3, "үч") | ||
.put(4, "төрт") | ||
.put(5, "беш") | ||
.put(6, "алты") | ||
.put(7, "жети") | ||
.put(8, "сегиз") | ||
.put(9, "тогуз") | ||
.put(10, "он") | ||
.put(11, "он бир") | ||
.put(12, "он эки") | ||
.put(13, "он үч") | ||
.put(14, "он төрт") | ||
.put(15, "он беш") | ||
.put(16, "он алты") | ||
.put(17, "он жети") | ||
.put(18, "он сегиз") | ||
.put(19, "он тогуз") | ||
.put(20, "жыйырма") | ||
.put(30, "отуз") | ||
.put(40, "кырк") | ||
.put(50, "элүү") | ||
.put(60, "алтымыш") | ||
.put(70, "жетимиш") | ||
.put(80, "сексен") | ||
.put(90, "токсон") | ||
.put(100, "жүз") | ||
.put(200, "эки жүз") | ||
.put(300, "үч жүз") | ||
.put(400, "төрт жүз") | ||
.put(500, "беш жүз") | ||
.put(600, "алты жүз") | ||
.put(700, "жети жүз") | ||
.put(800, "сегиз жүз") | ||
.put(900, "тогуз жүз") | ||
.build(); | ||
} | ||
|
||
@Override | ||
public List<PluralForms> pluralForms() { | ||
return Arrays.asList( | ||
new KyrgyzPluralForms(""), | ||
new KyrgyzPluralForms("миң"), | ||
new KyrgyzPluralForms("миллион"), | ||
new KyrgyzPluralForms("миллиард") | ||
); | ||
} | ||
|
||
@Override | ||
public String currency() { | ||
return "сом"; | ||
} | ||
|
||
@Override | ||
public char twoDigitsNumberSeparator() { | ||
return ' '; | ||
} | ||
} |
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
118 changes: 118 additions & 0 deletions
118
...st/groovy/pl/allegro/finance/tradukisto/internal/languages/kyrgyz/KyrgyzValuesTest.groovy
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,118 @@ | ||
package pl.allegro.finance.tradukisto.internal.languages.kyrgyz | ||
|
||
import spock.lang.Ignore | ||
import spock.lang.Specification | ||
import spock.lang.Unroll | ||
|
||
import static pl.allegro.finance.tradukisto.internal.Container.kyrgyzContainer | ||
|
||
class KyrgyzValuesTest extends Specification { | ||
|
||
static intConverter = kyrgyzContainer().getIntegerConverter() | ||
static longConverter = kyrgyzContainer().getLongConverter() | ||
|
||
@Unroll | ||
def "should convert #value to '#words' in Kazakh"() { | ||
expect: | ||
intConverter.asWords(value) == words | ||
|
||
where: | ||
value | words | ||
|
||
0 | "нөл" | ||
1 | "бир" | ||
2 | "эки" | ||
3 | "үч" | ||
4 | "төрт" | ||
5 | "беш" | ||
6 | "алты" | ||
7 | "жети" | ||
8 | "сегиз" | ||
9 | "тогуз" | ||
10 | "он" | ||
|
||
11 | "он бир" | ||
12 | "он эки" | ||
13 | "он үч" | ||
14 | "он төрт" | ||
15 | "он беш" | ||
16 | "он алты" | ||
17 | "он жети" | ||
18 | "он сегиз" | ||
19 | "он тогуз" | ||
|
||
20 | "жыйырма" | ||
30 | "отуз" | ||
40 | "кырк" | ||
50 | "элүү" | ||
60 | "алтымыш" | ||
70 | "жетимиш" | ||
80 | "сексен" | ||
90 | "токсон" | ||
100 | "жүз" | ||
|
||
200 | "эки жүз" | ||
300 | "үч жүз" | ||
400 | "төрт жүз" | ||
500 | "беш жүз" | ||
600 | "алты жүз" | ||
700 | "жети жүз" | ||
800 | "сегиз жүз" | ||
900 | "тогуз жүз" | ||
1000 | "бир миң" | ||
|
||
1_000_000 | "бир миллион" | ||
1_000_000_000 | "бир миллиард" | ||
|
||
25 | "жыйырма беш" | ||
34 | "отуз төрт" | ||
51 | "элүү бир" | ||
89 | "сексен тогуз" | ||
144 | "жүз кырк төрт" | ||
233 | "эки жүз отуз үч" | ||
377 | "үч жүз жетимиш жети" | ||
610 | "алты жүз он" | ||
987 | "тогуз жүз сексен жети" | ||
1_597 | "бир миң беш жүз токсон жети" | ||
2_584 | "эки миң беш жүз сексен төрт" | ||
4_181 | "төрт миң жүз сексен бир" | ||
6_765 | "алты миң жети жүз алтымыш беш" | ||
10_946 | "он миң тогуз жүз кырк алты" | ||
17_711 | "он жети миң жети жүз он бир" | ||
28_657 | "жыйырма сегиз миң алты жүз элүү жети" | ||
46_368 | "кырк алты миң үч жүз алтымыш сегиз" | ||
75_025 | "жетимиш беш миң жыйырма беш" | ||
121_393 | "жүз жыйырма бир миң үч жүз токсон үч" | ||
196_418 | "жүз токсон алты миң төрт жүз он сегиз" | ||
317_811 | "үч жүз он жети миң сегиз жүз он бир" | ||
514_229 | "беш жүз он төрт миң эки жүз жыйырма тогуз" | ||
832_040 | "сегиз жүз отуз эки миң кырк" | ||
1_346_269 | "бир миллион үч жүз кырк алты миң эки жүз алтымыш тогуз" | ||
2_178_309 | "эки миллион жүз жетимиш сегиз миң үч жүз тогуз" | ||
|
||
1_836_311_903 | "бир миллиард сегиз жүз отуз алты миллион үч жүз он бир миң тогуз жүз үч" | ||
} | ||
|
||
@Ignore("Needs kyrgyz long converter and values for trillion, quadrillion, quintillion") | ||
@Unroll | ||
def "should convert long #value to '#words' in Kyrgyz"() { | ||
expect: | ||
longConverter.asWords(value) == words | ||
|
||
where: | ||
value | words | ||
5_000_000_000 | "" | ||
|
||
1_000_000_000_000 | "" | ||
2_000_000_000_000 | "" | ||
5_000_000_000_000 | "" | ||
|
||
1_000_000_000_000_000 | "" | ||
2_000_000_000_000_000 | "" | ||
5_000_000_000_000_000 | "" | ||
|
||
1_000_000_000_000_000_000 | "" | ||
2_000_000_000_000_000_000 | "" | ||
Long.MAX_VALUE | "" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please revert old imports?