Skip to content

Commit 6ba5eab

Browse files
committed
Localize welcome survey text and fix resource paths
Added localized strings for the welcome survey title and description in PDE.properties. Updated WelcomeSurvey.kt to use these localized strings. Fixed resource loading paths in Locale.kt to correctly reference the 'languages' directory.
1 parent 307ef46 commit 6ba5eab

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

app/src/main/resources/languages/PDE.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ beta.window.title = Welcome to Beta
633633
beta.title = Thanks for testing this Processing Beta!
634634
beta.message = This preview release lets us gather feedback and fix issues before the final version. **Some features may not work as expected.** If you encounter problems, [please post on the forum](https://discourse.processing.org) or [open a GitHub issue](https://github.com/processing/processing4/issues).
635635
beta.button = Ok
636+
# Welcome
637+
welcome.survey.title=Take the Community Survey
638+
welcome.survey.description=Processing is free, open-source, and shaped by its community. Your answers help us focus on what matters most.
636639

637640
# ---------------------------------------
638641
# Color Chooser

app/src/processing/app/ui/WelcomeSurvey.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ fun addSurveyToWelcomeScreen(): JComponent {
5555
modifier = Modifier.padding(12.dp),
5656
) {
5757
Text(
58-
text = "Survey",
58+
text = locale["welcome.survey.title"],
5959
style = MaterialTheme.typography.subtitle1.copy(fontWeight = FontWeight.Bold)
6060
)
6161
Text(
62-
text = "click here to take part in the survey and help us improve Processing!",
62+
text = locale["welcome.survey.description"],
6363
)
6464

6565
}

app/src/processing/app/ui/theme/Locale.kt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package processing.app.ui.theme
33
import androidx.compose.runtime.Composable
44
import androidx.compose.runtime.CompositionLocalProvider
55
import androidx.compose.runtime.compositionLocalOf
6-
import processing.app.LocalPreferences
76
import processing.app.Messages
87
import processing.app.Platform
98
import processing.app.PlatformStart
@@ -15,10 +14,19 @@ import java.util.*
1514
class Locale(language: String = "") : Properties() {
1615
init {
1716
val locale = java.util.Locale.getDefault()
18-
load(ClassLoader.getSystemResourceAsStream("PDE.properties"))
19-
load(ClassLoader.getSystemResourceAsStream("PDE_${locale.language}.properties") ?: InputStream.nullInputStream())
20-
load(ClassLoader.getSystemResourceAsStream("PDE_${locale.toLanguageTag()}.properties") ?: InputStream.nullInputStream())
21-
load(ClassLoader.getSystemResourceAsStream("PDE_${language}.properties") ?: InputStream.nullInputStream())
17+
load(ClassLoader.getSystemResourceAsStream("languages/PDE.properties"))
18+
load(
19+
ClassLoader.getSystemResourceAsStream("languages/PDE_${locale.language}.properties")
20+
?: InputStream.nullInputStream()
21+
)
22+
load(
23+
ClassLoader.getSystemResourceAsStream("languages/PDE_${locale.toLanguageTag()}.properties")
24+
?: InputStream.nullInputStream()
25+
)
26+
load(
27+
ClassLoader.getSystemResourceAsStream("languages/PDE_${language}.properties")
28+
?: InputStream.nullInputStream()
29+
)
2230
}
2331

2432
@Deprecated("Use get instead", ReplaceWith("get(key)"))

0 commit comments

Comments
 (0)