fix(location): correct UI layout and translation keys

Resolve vertical text rendering issue by using Modifier.weight(1f) in
ConfigSelector. Add proper translation keys to the 'better_location'
block in en_US.json so they are accessible to BetterLocationRoot.
Update key references to match the new structure.

- Add keys: location_search_provider_title, google_maps_api_key_title,
  option_osm, option_google_maps.
- Fix UI layout to handle text wrapping properly.
This commit is contained in:
daplugg23
2026-02-05 17:40:13 -06:00
parent 46e9b7e7f5
commit 8d6dcdb227
2 changed files with 15 additions and 7 deletions

View File

@@ -427,9 +427,13 @@ class BetterLocationRoot : Routes.Route() {
.padding(horizontal = 16.dp, vertical = 12.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(text = text)
Spacer(modifier = Modifier.weight(1f))
Text(text = value, color = PurrfectPalette.textSecondary, fontSize = 14.sp)
Text(text = text, modifier = Modifier.weight(1f))
Text(
text = value,
color = PurrfectPalette.textSecondary,
fontSize = 14.sp,
modifier = Modifier.padding(start = 8.dp)
)
}
}
@@ -440,13 +444,13 @@ class BetterLocationRoot : Routes.Route() {
val currentProvider = context.config.root.global.betterLocation.locationSearchProvider.get()
ConfigSelector(
text = translation["properties.location_search_provider.name"],
value = context.translation["options.location_search_provider.$currentProvider"]
text = translation["location_search_provider_title"],
value = translation["option_$currentProvider"]
) { showProviderDialog = true }
if (currentProvider == "google_maps") {
ConfigInput(
text = translation["properties.google_maps_api_key.name"],
text = translation["google_maps_api_key_title"],
value = context.config.root.global.betterLocation.googleMapsApiKey.get()
) { showApiKeyDialog = true }
}

View File

@@ -444,7 +444,11 @@
"no_friends_map": "No friends on the map",
"no_friends_found": "No friends found",
"include_saved_locations": "Include Saved Locations",
"include_saved_locations_description": "Export your saved location coordinates"
"include_saved_locations_description": "Export your saved location coordinates",
"location_search_provider_title": "Location Search Provider",
"google_maps_api_key_title": "Google Maps API Key",
"option_osm": "OpenStreetMap (Free)",
"option_google_maps": "Google Maps"
}
},
"dialogs": {