mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2024-11-22 04:36:05 -06:00
Add Kashubian language (#2579)
This commit is contained in:
parent
7f6a2435d0
commit
d0ad5028d8
1
.gitignore
vendored
1
.gitignore
vendored
@ -71,6 +71,7 @@ captures/
|
||||
.idea/deploymentTargetDropDown.xml
|
||||
.idea/deploymentTargetSelector.xml
|
||||
.idea/kotlinc.xml
|
||||
.idea/studiobot.xml
|
||||
|
||||
# Keystore files
|
||||
*.jks
|
||||
|
@ -1,14 +1,32 @@
|
||||
package io.github.wulkanowy.utils
|
||||
|
||||
import java.text.SimpleDateFormat
|
||||
import java.time.*
|
||||
import java.time.DayOfWeek.*
|
||||
import java.time.DayOfWeek.FRIDAY
|
||||
import java.time.DayOfWeek.MONDAY
|
||||
import java.time.DayOfWeek.SATURDAY
|
||||
import java.time.DayOfWeek.SUNDAY
|
||||
import java.time.Instant
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalDateTime
|
||||
import java.time.Month
|
||||
import java.time.ZoneId
|
||||
import java.time.ZoneOffset
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.temporal.TemporalAdjusters.*
|
||||
import java.util.*
|
||||
import java.time.temporal.TemporalAdjusters.firstInMonth
|
||||
import java.time.temporal.TemporalAdjusters.next
|
||||
import java.time.temporal.TemporalAdjusters.previous
|
||||
import java.util.Locale
|
||||
|
||||
private const val DEFAULT_DATE_PATTERN = "dd.MM.yyyy"
|
||||
|
||||
fun getDefaultLocaleWithFallback(): Locale {
|
||||
val locale = Locale.getDefault()
|
||||
if (locale.language == "csb") {
|
||||
return Locale.forLanguageTag("pl")
|
||||
}
|
||||
return locale
|
||||
}
|
||||
|
||||
fun LocalDate.toTimestamp(): Long = atStartOfDay()
|
||||
.toInstant(ZoneOffset.UTC)
|
||||
.toEpochMilli()
|
||||
@ -23,7 +41,7 @@ fun String.toLocalDate(format: String = DEFAULT_DATE_PATTERN): LocalDate =
|
||||
LocalDate.parse(this, DateTimeFormatter.ofPattern(format))
|
||||
|
||||
fun LocalDate.toFormattedString(pattern: String = DEFAULT_DATE_PATTERN): String =
|
||||
format(DateTimeFormatter.ofPattern(pattern))
|
||||
format(DateTimeFormatter.ofPattern(pattern, getDefaultLocaleWithFallback()))
|
||||
|
||||
fun Instant.toFormattedString(
|
||||
pattern: String = DEFAULT_DATE_PATTERN,
|
||||
@ -31,7 +49,7 @@ fun Instant.toFormattedString(
|
||||
): String = atZone(tz).format(DateTimeFormatter.ofPattern(pattern))
|
||||
|
||||
fun Month.getFormattedName(): String {
|
||||
val formatter = SimpleDateFormat("LLLL", Locale.getDefault())
|
||||
val formatter = SimpleDateFormat("LLLL", getDefaultLocaleWithFallback())
|
||||
|
||||
val date = LocalDateTime.now().withMonth(value)
|
||||
return formatter.format(date.toInstant(ZoneOffset.UTC).toEpochMilli()).capitalise()
|
||||
@ -76,7 +94,7 @@ inline val LocalDate.previousOrSameSchoolDay: LocalDate
|
||||
}
|
||||
|
||||
inline val LocalDate.weekDayName: String
|
||||
get() = format(DateTimeFormatter.ofPattern("EEEE", Locale.getDefault()))
|
||||
get() = format(DateTimeFormatter.ofPattern("EEEE", getDefaultLocaleWithFallback()))
|
||||
|
||||
inline val LocalDate.monday: LocalDate get() = with(MONDAY)
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 minut</item>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 minutów</item>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 Minuten</item>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 minut</item>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 минут</item>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 minút</item>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="services_interval_entries">
|
||||
<item>15 хвилин</item>
|
||||
|
@ -40,6 +40,7 @@
|
||||
<item>Deutsch</item>
|
||||
<item>Čeština</item>
|
||||
<item>Slovenčina</item>
|
||||
<item>Kaszëbsczi</item>
|
||||
</string-array>
|
||||
<string-array name="app_language_values" translatable="false">
|
||||
<item>system</item>
|
||||
@ -50,6 +51,7 @@
|
||||
<item>de</item>
|
||||
<item>cs</item>
|
||||
<item>sk</item>
|
||||
<item>csb</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="services_interval_entries">
|
||||
|
Loading…
Reference in New Issue
Block a user