Add comprehensive i18n localization for KMM and iOS

KMM (Android/Shared):
- Add strings.xml with 200+ localized strings
- Add translation files for es, fr, de, pt languages
- Update all screens to use stringResource() for i18n
- Add Accept-Language header to API client for all platforms

iOS:
- Add L10n.swift helper with type-safe string accessors
- Add Localizable.xcstrings with translations for all 5 languages
- Update all SwiftUI views to use L10n.* for localized strings
- Localize Auth, Residence, Task, Contractor, Document, and Profile views

Supported languages: English, Spanish, French, German, Portuguese

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-02 02:02:00 -06:00
parent e62e7d4371
commit c726320c1e
59 changed files with 19839 additions and 757 deletions

View File

@@ -2,13 +2,23 @@ package com.example.casera.network
import io.ktor.client.*
import io.ktor.client.engine.darwin.*
import io.ktor.client.plugins.*
import io.ktor.client.plugins.contentnegotiation.*
import io.ktor.client.plugins.logging.*
import io.ktor.serialization.kotlinx.json.*
import kotlinx.serialization.json.Json
import platform.Foundation.NSLocale
import platform.Foundation.preferredLanguages
actual fun getLocalhostAddress(): String = "127.0.0.1"
actual fun getDeviceLanguage(): String {
val preferredLanguages = NSLocale.preferredLanguages
val firstLanguage = preferredLanguages.firstOrNull() as? String
// Extract just the language code (e.g., "en" from "en-US")
return firstLanguage?.split("-")?.firstOrNull() ?: "en"
}
actual fun createHttpClient(): HttpClient {
return HttpClient(Darwin) {
install(ContentNegotiation) {
@@ -24,6 +34,10 @@ actual fun createHttpClient(): HttpClient {
level = LogLevel.ALL
}
install(DefaultRequest) {
headers.append("Accept-Language", getDeviceLanguage())
}
engine {
configureRequest {
setAllowsCellularAccess(true)