Home screen: extract strings
This commit is contained in:
committed by
pynicolas
parent
5c7d603c3e
commit
2c64ebc972
@@ -53,7 +53,6 @@ import org.mydomain.myscan.ui.theme.MyScanTheme
|
|||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
// FIXME Extract strings
|
|
||||||
fun HomeScreen(
|
fun HomeScreen(
|
||||||
hasCameraPermission: Boolean,
|
hasCameraPermission: Boolean,
|
||||||
currentDocument: DocumentUiModel,
|
currentDocument: DocumentUiModel,
|
||||||
@@ -82,7 +81,7 @@ fun HomeScreen(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon = Icons.Default.PhotoCamera,
|
icon = Icons.Default.PhotoCamera,
|
||||||
text = "Start a new scan",
|
text = stringResource(R.string.start_a_new_scan),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(12.dp)
|
.padding(12.dp)
|
||||||
.height(48.dp),
|
.height(48.dp),
|
||||||
@@ -101,7 +100,7 @@ fun HomeScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!currentDocument.isEmpty()) {
|
if (!currentDocument.isEmpty()) {
|
||||||
SectionTitle("Current document")
|
SectionTitle(stringResource(R.string.current_document))
|
||||||
CurrentDocumentCard(currentDocument, navigation)
|
CurrentDocumentCard(currentDocument, navigation)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,16 +124,14 @@ private fun CameraPermissionRationale() {
|
|||||||
) {
|
) {
|
||||||
Column(Modifier.padding(16.dp)) {
|
Column(Modifier.padding(16.dp)) {
|
||||||
Text(
|
Text(
|
||||||
"The app requires camera access to scan documents. " +
|
stringResource(R.string.camera_permission_rationale),
|
||||||
"Captured images are stored only on this device and will be deleted " +
|
|
||||||
"when you close the current document.",
|
|
||||||
style = MaterialTheme.typography.bodyMedium
|
style = MaterialTheme.typography.bodyMedium
|
||||||
)
|
)
|
||||||
Spacer(Modifier.height(8.dp))
|
Spacer(Modifier.height(8.dp))
|
||||||
Button(onClick = {
|
Button(onClick = {
|
||||||
requestPermissionLauncher.launch(Manifest.permission.CAMERA)
|
requestPermissionLauncher.launch(Manifest.permission.CAMERA)
|
||||||
}) {
|
}) {
|
||||||
Text("Grant permission")
|
Text(stringResource(R.string.grant_permission))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,7 +164,7 @@ private fun CurrentDocumentCard(
|
|||||||
Column(Modifier.weight(1f)) {
|
Column(Modifier.weight(1f)) {
|
||||||
Text(pageCountText(currentDocument.pageCount()))
|
Text(pageCountText(currentDocument.pageCount()))
|
||||||
}
|
}
|
||||||
MainActionButton(navigation.toDocumentScreen, "Open")
|
MainActionButton(navigation.toDocumentScreen, stringResource(R.string.open))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
<string name="app_tagline">Une application simple et respectueuse pour scanner vos documents.</string>
|
<string name="app_tagline">Une application simple et respectueuse pour scanner vos documents.</string>
|
||||||
<string name="back">Retour</string>
|
<string name="back">Retour</string>
|
||||||
<string name="camera_permission_denied">L\'autorisation d\'accès à la caméra a été refusée</string>
|
<string name="camera_permission_denied">L\'autorisation d\'accès à la caméra a été refusée</string>
|
||||||
|
<string name="camera_permission_rationale">L’application a besoin d’accéder à l’appareil photo pour scanner des documents. Les images capturées sont enregistrées uniquement sur cet appareil et seront supprimées lorsque vous fermerez le document en cours.</string>
|
||||||
<string name="cancel">Annuler</string>
|
<string name="cancel">Annuler</string>
|
||||||
<string name="close">Fermer</string>
|
<string name="close">Fermer</string>
|
||||||
<string name="close_document">Fermer le document</string>
|
<string name="close_document">Fermer le document</string>
|
||||||
|
<string name="current_document">Document en cours</string>
|
||||||
<string name="delete_page">Supprimer la page</string>
|
<string name="delete_page">Supprimer la page</string>
|
||||||
<string name="document">Document</string>
|
<string name="document">Document</string>
|
||||||
<string name="error">Erreur : %1$s</string>
|
<string name="error">Erreur : %1$s</string>
|
||||||
@@ -16,6 +18,7 @@
|
|||||||
<string name="error_save">Échec de l\'enregistrement du PDF</string>
|
<string name="error_save">Échec de l\'enregistrement du PDF</string>
|
||||||
<string name="export_pdf">Exporter en PDF</string>
|
<string name="export_pdf">Exporter en PDF</string>
|
||||||
<string name="filename">Nom de fichier</string>
|
<string name="filename">Nom de fichier</string>
|
||||||
|
<string name="grant_permission">Autoriser</string>
|
||||||
<string name="libraries">Bibliothèques</string>
|
<string name="libraries">Bibliothèques</string>
|
||||||
<string name="libraries_intro">Cette application utilise plusieurs bibliothèques open source, notamment :</string>
|
<string name="libraries_intro">Cette application utilise plusieurs bibliothèques open source, notamment :</string>
|
||||||
<string name="libraries_open_source">Bibliothèques open source</string>
|
<string name="libraries_open_source">Bibliothèques open source</string>
|
||||||
@@ -30,6 +33,7 @@
|
|||||||
<string name="save">Enregistrer</string>
|
<string name="save">Enregistrer</string>
|
||||||
<string name="share">Partager</string>
|
<string name="share">Partager</string>
|
||||||
<string name="share_pdf">Partager le PDF</string>
|
<string name="share_pdf">Partager le PDF</string>
|
||||||
|
<string name="start_a_new_scan">Nouveau scan</string>
|
||||||
<string name="unknown_size">Taille inconnue</string>
|
<string name="unknown_size">Taille inconnue</string>
|
||||||
<string name="version">Version</string>
|
<string name="version">Version</string>
|
||||||
<string name="view_the_full_license">Voir la licence complète</string>
|
<string name="view_the_full_license">Voir la licence complète</string>
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
<string name="app_tagline">A simple and respectful application to scan your documents.</string>
|
<string name="app_tagline">A simple and respectful application to scan your documents.</string>
|
||||||
<string name="back">Back</string>
|
<string name="back">Back</string>
|
||||||
<string name="camera_permission_denied">Camera permission was denied</string>
|
<string name="camera_permission_denied">Camera permission was denied</string>
|
||||||
|
<string name="camera_permission_rationale">The app requires camera access to scan documents. Captured images are stored only on this device and will be deleted when you close the current document.</string>
|
||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="close">Close</string>
|
<string name="close">Close</string>
|
||||||
<string name="close_document">Close document</string>
|
<string name="close_document">Close document</string>
|
||||||
|
<string name="current_document">Current document</string>
|
||||||
<string name="delete_page">Delete page</string>
|
<string name="delete_page">Delete page</string>
|
||||||
<string name="document">Document</string>
|
<string name="document">Document</string>
|
||||||
<string name="error">Error: %1$s</string>
|
<string name="error">Error: %1$s</string>
|
||||||
@@ -16,6 +18,7 @@
|
|||||||
<string name="error_save">Failed to save PDF</string>
|
<string name="error_save">Failed to save PDF</string>
|
||||||
<string name="export_pdf">Export PDF</string>
|
<string name="export_pdf">Export PDF</string>
|
||||||
<string name="filename">Filename</string>
|
<string name="filename">Filename</string>
|
||||||
|
<string name="grant_permission">Grant permission</string>
|
||||||
<string name="libraries">Libraries</string>
|
<string name="libraries">Libraries</string>
|
||||||
<string name="libraries_intro">This application uses several open-source libraries, including:</string>
|
<string name="libraries_intro">This application uses several open-source libraries, including:</string>
|
||||||
<string name="libraries_open_source">Open-source libraries</string>
|
<string name="libraries_open_source">Open-source libraries</string>
|
||||||
@@ -30,6 +33,7 @@
|
|||||||
<string name="save">Save</string>
|
<string name="save">Save</string>
|
||||||
<string name="share">Share</string>
|
<string name="share">Share</string>
|
||||||
<string name="share_pdf">Share PDF</string>
|
<string name="share_pdf">Share PDF</string>
|
||||||
|
<string name="start_a_new_scan">Start a new scan</string>
|
||||||
<string name="unknown_size">Unknown size</string>
|
<string name="unknown_size">Unknown size</string>
|
||||||
<string name="version">Version</string>
|
<string name="version">Version</string>
|
||||||
<string name="view_the_full_license">View the full license</string>
|
<string name="view_the_full_license">View the full license</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user