mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Welcome to Beta screen: Locale fix
This commit is contained in:
@@ -91,9 +91,10 @@ class WelcomeToBeta {
|
||||
horizontalArrangement = Arrangement
|
||||
.spacedBy(20.dp)
|
||||
){
|
||||
val locale = LocalLocale.current
|
||||
Image(
|
||||
painter = painterResource("logo.svg"),
|
||||
contentDescription = "Processing Logo",
|
||||
contentDescription = locale["beta.logo"],
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterVertically)
|
||||
.size(100.dp, 100.dp)
|
||||
@@ -107,7 +108,6 @@ class WelcomeToBeta {
|
||||
alignment = Alignment.CenterVertically
|
||||
)
|
||||
) {
|
||||
val locale = LocalLocale.current
|
||||
Text(
|
||||
text = locale["beta.title"],
|
||||
style = MaterialTheme.typography.subtitle1,
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.compositionLocalOf
|
||||
import processing.app.LocalPreferences
|
||||
import processing.app.Messages
|
||||
import processing.app.Platform
|
||||
import processing.app.PlatformStart
|
||||
import processing.app.watchFile
|
||||
@@ -21,10 +22,12 @@ class Locale(language: String = "") : Properties() {
|
||||
}
|
||||
|
||||
@Deprecated("Use get instead", ReplaceWith("get(key)"))
|
||||
override fun getProperty(key: String?): String {
|
||||
return super.getProperty(key)
|
||||
override fun getProperty(key: String?, default: String): String {
|
||||
val value = super.getProperty(key, default)
|
||||
if(value == default) Messages.log("Missing translation for $key")
|
||||
return value
|
||||
}
|
||||
operator fun get(key: String): String = getProperty(key)
|
||||
operator fun get(key: String): String = getProperty(key, key)
|
||||
}
|
||||
val LocalLocale = compositionLocalOf { Locale() }
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user