Skip to content

Commit

Permalink
Merge pull request #91 from yeldar-nurpeissov/main
Browse files Browse the repository at this point in the history
Add Kazakh/kk language
  • Loading branch information
jacobras authored Sep 2, 2024
2 parents 3cf0160 + 26b3b00 commit b99fc22
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
69 changes: 69 additions & 0 deletions src/commonMain/libres/strings/time_units_kk.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="seconds">
<item quantity="one">секунд</item>
<item quantity="other">секунд</item>
</plurals>
<plurals name="seconds_future">
<item quantity="one">секундтан</item>
<item quantity="other">секундтан</item>
</plurals>

<plurals name="minutes">
<item quantity="one">минут</item>
<item quantity="other">минут</item>
</plurals>
<plurals name="minutes_future">
<item quantity="one">минуттан</item>
<item quantity="other">минуттан</item>
</plurals>

<plurals name="hours">
<item quantity="one">сағат</item>
<item quantity="other">сағат</item>
</plurals>
<plurals name="hours_future">
<item quantity="one">сағаттан</item>
<item quantity="other">сағаттан</item>
</plurals>

<plurals name="days">
<item quantity="one">күн</item>
<item quantity="other">күн</item>
</plurals>
<plurals name="days_future">
<item quantity="one">күннен</item>
<item quantity="other">күннен</item>
</plurals>

<plurals name="weeks">
<item quantity="one">апта</item>
<item quantity="other">апта</item>
</plurals>
<plurals name="weeks_future">
<item quantity="one">аптадан</item>
<item quantity="other">аптадан</item>
</plurals>

<plurals name="months">
<item quantity="one">ай</item>
<item quantity="other">ай</item>
</plurals>
<plurals name="months_future">
<item quantity="one">айдан</item>
<item quantity="other">айдан</item>
</plurals>

<plurals name="years">
<item quantity="one">жыл</item>
<item quantity="other">жыл</item>
</plurals>
<plurals name="years_future">
<item quantity="one">жылдан</item>
<item quantity="other">жылдан</item>
</plurals>

<string name="time_ago">${time} бұрын</string>
<string name="time_in_future">${time} кейін</string>
<string name="now">қазір</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,27 @@ import kotlin.time.Duration.Companion.seconds
class LocalizedTests {

private val now: Instant = Clock.System.now()
private val twoSeconds = 2.seconds
private val twoSecondsAgo = now - twoSeconds
private val twoSecondsFromNow = now + twoSeconds
private val oneMinute = 1.minutes
private val oneMinuteAgo = now - oneMinute
private val oneMinuteFromNow = now + oneMinute
private val oneHour = 60.minutes
private val oneHourAgo = now - oneHour
private val oneHourFromNow = now + oneHour
private val oneDay = 1.days
private val oneDayAgo = now - oneDay
private val oneDayFromNow = now + oneDay
private val oneWeek = 7.days
private val oneWeekAgo = now - oneWeek
private val oneWeekFromNow = now + oneWeek
private val twoMonths = 60.days
private val twoMonthsAgo = now - twoMonths
private val twoMonthsFromNow = now + twoMonths
private val oneYear = 365.days
private val oneYearAgo = now - oneYear
private val oneYearFromNow = now + oneYear

@Test
fun cs() {
Expand Down Expand Up @@ -82,6 +97,33 @@ class LocalizedTests {
assertThat(HumanReadable.duration(2.seconds)).isEqualTo("2 秒")
}

@Test
fun kk() {
LibresSettings.languageCode = "kk"
assertThat(HumanReadable.timeAgo(now)).isEqualTo("қазір")
assertThat(HumanReadable.duration(twoSeconds)).isEqualTo("2 секунд")
assertThat(HumanReadable.timeAgo(twoSecondsAgo, baseInstant = now)).isEqualTo("2 секунд бұрын")
assertThat(HumanReadable.timeAgo(twoSecondsFromNow, baseInstant = now)).isEqualTo("2 секундтан кейін")
assertThat(HumanReadable.duration(oneMinute)).isEqualTo("1 минут")
assertThat(HumanReadable.timeAgo(oneMinuteAgo, baseInstant = now)).isEqualTo("1 минут бұрын")
assertThat(HumanReadable.timeAgo(oneMinuteFromNow, baseInstant = now)).isEqualTo("1 минуттан кейін")
assertThat(HumanReadable.duration(oneHour)).isEqualTo("1 сағат")
assertThat(HumanReadable.timeAgo(oneHourAgo, baseInstant = now)).isEqualTo("1 сағат бұрын")
assertThat(HumanReadable.timeAgo(oneHourFromNow, baseInstant = now)).isEqualTo("1 сағаттан кейін")
assertThat(HumanReadable.duration(oneDay)).isEqualTo("1 күн")
assertThat(HumanReadable.timeAgo(oneDayAgo, baseInstant = now)).isEqualTo("1 күн бұрын")
assertThat(HumanReadable.timeAgo(oneDayFromNow, baseInstant = now)).isEqualTo("1 күннен кейін")
assertThat(HumanReadable.duration(oneWeek)).isEqualTo("1 апта")
assertThat(HumanReadable.timeAgo(oneWeekAgo, baseInstant = now)).isEqualTo("1 апта бұрын")
assertThat(HumanReadable.timeAgo(oneWeekFromNow, baseInstant = now)).isEqualTo("1 аптадан кейін")
assertThat(HumanReadable.duration(twoMonths)).isEqualTo("2 ай")
assertThat(HumanReadable.timeAgo(twoMonthsAgo, baseInstant = now)).isEqualTo("2 ай бұрын")
assertThat(HumanReadable.timeAgo(twoMonthsFromNow, baseInstant = now)).isEqualTo("2 айдан кейін")
assertThat(HumanReadable.duration(oneYear)).isEqualTo("1 жыл")
assertThat(HumanReadable.timeAgo(oneYearAgo, baseInstant = now)).isEqualTo("1 жыл бұрын")
assertThat(HumanReadable.timeAgo(oneYearFromNow, baseInstant = now)).isEqualTo("1 жылдан кейін")
}

@Test
fun ko() {
LibresSettings.languageCode = "ko"
Expand Down

0 comments on commit b99fc22

Please sign in to comment.