File tree Expand file tree Collapse file tree
app/src/processing/app/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,9 +91,10 @@ class WelcomeToBeta {
9191 horizontalArrangement = Arrangement
9292 .spacedBy(20 .dp)
9393 ){
94+ val locale = LocalLocale .current
9495 Image (
9596 painter = painterResource(" logo.svg" ),
96- contentDescription = " Processing Logo " ,
97+ contentDescription = locale[ " beta.logo " ] ,
9798 modifier = Modifier
9899 .align(Alignment .CenterVertically )
99100 .size(100 .dp, 100 .dp)
@@ -107,7 +108,6 @@ class WelcomeToBeta {
107108 alignment = Alignment .CenterVertically
108109 )
109110 ) {
110- val locale = LocalLocale .current
111111 Text (
112112 text = locale[" beta.title" ],
113113 style = MaterialTheme .typography.subtitle1,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import androidx.compose.runtime.Composable
44import androidx.compose.runtime.CompositionLocalProvider
55import androidx.compose.runtime.compositionLocalOf
66import processing.app.LocalPreferences
7+ import processing.app.Messages
78import processing.app.Platform
89import processing.app.PlatformStart
910import processing.app.watchFile
@@ -21,10 +22,12 @@ class Locale(language: String = "") : Properties() {
2122 }
2223
2324 @Deprecated(" Use get instead" , ReplaceWith (" get(key)" ))
24- override fun getProperty (key : String? ): String {
25- return super .getProperty(key)
25+ override fun getProperty (key : String? , default : String ): String {
26+ val value = super .getProperty(key, default)
27+ if (value == default) Messages .log(" Missing translation for $key " )
28+ return value
2629 }
27- operator fun get (key : String ): String = getProperty(key)
30+ operator fun get (key : String ): String = getProperty(key, key )
2831}
2932val LocalLocale = compositionLocalOf { Locale () }
3033@Composable
You can’t perform that action at this time.
0 commit comments