feat(i18n): data-driven language picker + Weblate translation guard #5

Merged
makiolaj merged 4 commits from feat/translations into main 2026-06-18 08:41:47 +00:00
4 changed files with 18 additions and 3 deletions
Showing only changes of commit bab6fd175a - Show all commits

View File

@@ -3,9 +3,9 @@ package de.jeanlucmakiola.calendula
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
@@ -24,7 +24,7 @@ import de.jeanlucmakiola.calendula.ui.theme.CalendulaTheme
import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDate
@AndroidEntryPoint @AndroidEntryPoint
class MainActivity : ComponentActivity() { class MainActivity : AppCompatActivity() {
// The occurrence a reminder notification was tapped for (eventId, begin, // The occurrence a reminder notification was tapped for (eventId, begin,
// end — the detail screen's key shape). singleTop + onNewIntent route a // end — the detail screen's key shape). singleTop + onNewIntent route a

View File

@@ -0,0 +1,6 @@
<resources>
<!-- Dark-scheme window backdrop, matching the Compose dark background/surface
(#101316) so activity recreation (e.g. language switch) doesn't flash a
lighter grey. See values/colors.xml. -->
<color name="window_background">#FF101316</color>
</resources>

View File

@@ -3,4 +3,8 @@
<color name="seed">#FF5C6B7A</color> <color name="seed">#FF5C6B7A</color>
<!-- Adaptive icon background --> <!-- Adaptive icon background -->
<color name="ic_launcher_background">#FF5C6B7A</color> <color name="ic_launcher_background">#FF5C6B7A</color>
<!-- Window backdrop shown during activity recreation (e.g. on a language
switch). Matches the Compose light scheme background/surface so the
recreation is seamless; overridden for dark in values-night. -->
<color name="window_background">#FFFBFCFE</color>
</resources> </resources>

View File

@@ -1,5 +1,10 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.Calendula" parent="android:Theme.Material.Light.NoActionBar"> <!-- AppCompat (DayNight) parent so MainActivity can be an AppCompatActivity,
which is required for AppCompatDelegate.setApplicationLocales (the in-app
language picker) to sync to the system. Actual colours are driven by the
Compose theme; this is essentially the launch/backdrop theme. -->
<style name="Theme.Calendula" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@color/window_background</item>
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>