Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
Animeboynz committed Dec 25, 2024
1 parent 38fbcdf commit 4e75adb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ object SettingsDataScreen : SearchableSettings {
// Write CSV data to output stream
outputStream.write(csvData.toByteArray())
outputStream.flush()

context.toast(MR.strings.library_exported)
}
}
}
Expand All @@ -380,18 +382,21 @@ object SettingsDataScreen : SearchableSettings {
}

return Preference.PreferenceGroup(
title = "Export",
title = stringResource(MR.strings.export),
preferenceItems = persistentListOf(
Preference.PreferenceItem.TextPreference(
title = "Library List",
title = stringResource(MR.strings.library_list),
onClick = { showDialog = true },
),
),
)
}

private fun escapeCsvField(field: String): String {
return field.replace("\"", "\"\"").replace("\r\n", "\n").replace("\r", "\n")
return field
.replace("\"", "\"\"")
.replace("\r\n", "\n")
.replace("\r", "\n")
}

@Composable
Expand All @@ -409,7 +414,7 @@ object SettingsDataScreen : SearchableSettings {
AlertDialog(
onDismissRequest = onDismissRequest,
title = {
Text(text = "Select Fields")
Text(text = stringResource(MR.strings.migration_dialog_what_to_include))
},
text = {
Column {
Expand Down Expand Up @@ -439,7 +444,7 @@ object SettingsDataScreen : SearchableSettings {
onCheckedChange = { authorSelected = it },
enabled = titleSelected,
)
Text(text = "Author")
Text(text = stringResource(MR.strings.author))
}

// Artist checkbox, disabled if Title is not selected
Expand All @@ -451,7 +456,7 @@ object SettingsDataScreen : SearchableSettings {
onCheckedChange = { artistSelected = it },
enabled = titleSelected,
)
Text(text = "Artist")
Text(text = stringResource(MR.strings.artist))
}
}
},
Expand All @@ -462,7 +467,7 @@ object SettingsDataScreen : SearchableSettings {
onDismissRequest()
},
) {
Text(text = "Save")
Text(text = stringResource(MR.strings.action_save))
}
},
dismissButton = {
Expand Down
6 changes: 6 additions & 0 deletions i18n/src/commonMain/moko-resources/base/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@
<string name="cache_deleted">Cache cleared, %1$d files deleted</string>
<string name="cache_delete_error">Error occurred while clearing</string>
<string name="pref_auto_clear_chapter_cache">Clear chapter cache on app launch</string>
<string name="export">Export</string>
<string name="library_list">Library List</string>
<string name="library_exported">Library Exported</string>


<!-- Sync section -->
<string name="syncing_library">Syncing library</string>
Expand Down Expand Up @@ -687,6 +691,8 @@
<string name="ongoing">Ongoing</string>
<string name="unknown">Unknown</string>
<string name="unknown_author">Unknown author</string>
<string name="author">Author</string>
<string name="artist">Artist</string>
<!-- reserved for #6163 -->
<string name="unknown_status">Unknown status</string>
<string name="licensed">Licensed</string>
Expand Down

0 comments on commit 4e75adb

Please sign in to comment.