From c50d98c2a4d685be4a627dc661378d3615c1d6df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Miras=20Vidal?= Date: Fri, 18 Aug 2023 12:05:32 +0200 Subject: [PATCH] Added translations --- .../ui/gallery/GalleryFragment.java | 1 - .../ui/importFile/ImportFragment.java | 21 +++++++++---------- app/src/main/res/layout/fragment_import.xml | 2 +- app/src/main/res/layout/fragment_settings.xml | 2 +- app/src/main/res/layout/frame_name_dialog.xml | 5 +++-- app/src/main/res/values-de/strings.xml | 11 ++++++++++ app/src/main/res/values-es/strings.xml | 10 ++++++++- app/src/main/res/values-fr/strings.xml | 11 ++++++++++ app/src/main/res/values-pt-rBR/strings.xml | 11 ++++++++++ app/src/main/res/values/strings.xml | 10 +++++++-- 10 files changed, 65 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/com/mraulio/gbcameramanager/ui/gallery/GalleryFragment.java b/app/src/main/java/com/mraulio/gbcameramanager/ui/gallery/GalleryFragment.java index edb5743..fce5f9e 100644 --- a/app/src/main/java/com/mraulio/gbcameramanager/ui/gallery/GalleryFragment.java +++ b/app/src/main/java/com/mraulio/gbcameramanager/ui/gallery/GalleryFragment.java @@ -1266,7 +1266,6 @@ public void onClick(DialogInterface dialog, int which) { LocalDateTime now = LocalDateTime.now(); File gifFile = new File(Utils.IMAGES_FOLDER, "GIF_" + dtf.format(now) + ".gif"); - File mp4File = new File(Utils.IMAGES_FOLDER, "GIF_" + dtf.format(now) + ".mp4"); try (FileOutputStream out = new FileOutputStream(gifFile)) { diff --git a/app/src/main/java/com/mraulio/gbcameramanager/ui/importFile/ImportFragment.java b/app/src/main/java/com/mraulio/gbcameramanager/ui/importFile/ImportFragment.java index caf16dc..66269c8 100644 --- a/app/src/main/java/com/mraulio/gbcameramanager/ui/importFile/ImportFragment.java +++ b/app/src/main/java/com/mraulio/gbcameramanager/ui/importFile/ImportFragment.java @@ -313,7 +313,7 @@ public void onClick(View v) { } } else if (cbAddFrame.isChecked()) { if (finalListBitmaps.get(0).getHeight() != 144 && finalListBitmaps.get(0).getHeight() != 224) { - Utils.toast(getContext(), "Can't add this image as a frame");//Add string + Utils.toast(getContext(), getString(R.string.cant_add_frame));//Add string btnAddImages.setEnabled(true); } else frameNameDialog(); } @@ -337,27 +337,27 @@ private void frameNameDialog() { EditText etFrameName = view.findViewById(R.id.etFrameName); AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setView(view); - AlertDialog alertdialog = builder.create(); + AlertDialog alertdialog = builder.create(); etFrameName.setImeOptions(EditorInfo.IME_ACTION_DONE);//When pressing enter - builder.setTitle("Set new Frame name");//Add string +// builder.setTitle("Set new Frame name");//Add string Button btnSaveFrame = view.findViewById(R.id.btnSaveFrame); btnSaveFrame.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { GbcFrame gbcFrame = new GbcFrame(); gbcFrame.setFrameBitmap(filledFrame); - if (filledFrame.getHeight()==224){ + if (filledFrame.getHeight() == 224) { gbcFrame.setWildFrame(true); } List newFrameImages = new ArrayList<>(); //Add here the dialog for the frame name String frameName = etFrameName.getText().toString(); if (frameName.equals("")) { - Utils.toast(getContext(), "Name must not be empty");//Add string + Utils.toast(getContext(), getString(R.string.no_empty_frame_name)); etFrameName.setBackgroundColor(Color.parseColor("#FF0000")); } else if (frameName.contains(" ")) { - Utils.toast(getContext(), "Text must no contain empty spaces.");//Add string + Utils.toast(getContext(), getString(R.string.no_spaces_frame_name));//Add string etFrameName.setBackgroundColor(Color.parseColor("#FF0000")); } else { gbcFrame.setFrameName(frameName); @@ -367,7 +367,7 @@ public void onClick(View v) { if (frame.getFrameName().toLowerCase(Locale.ROOT).equals(gbcFrame.getFrameName())) { alreadyAdded = true; etFrameName.setBackgroundColor(Color.parseColor("#FF0000")); - Utils.toast(getContext(), "This frame name already exists.");//Add string + Utils.toast(getContext(), getString(R.string.frame_name_exists));//Add string break; } } @@ -857,7 +857,7 @@ public void onActivityResult(ActivityResult result) { } else { tvFileName.setText(getString(R.string.file_name) + fileName); - tvFileName.setText("Not a valid image file"); + tvFileName.setText(getString(R.string.no_valid_image_file)); btnExtractFile.setVisibility(View.GONE); btnAddImages.setVisibility(View.GONE); layoutCb.setVisibility(View.GONE); @@ -898,7 +898,6 @@ public boolean extractSavImages() { listImportedImageBytes = extractor.extractBytes(fileBytes); //Check for Magic or FF bytes if (!magicIsReal(fileBytes)) { - System.out.println("NO VALID FILE///////////////////////"); return false; } int nameIndex = 1; @@ -917,7 +916,7 @@ public boolean extractSavImages() { String hashHex = Utils.bytesToHex(hash); gbcImage.setHashCode(hashHex); ImageCodec imageCodec = new ImageCodec(128, 112, gbcImage.isLockFrame()); - Bitmap image = imageCodec.decodeWithPalette(Utils.hashPalettes.get(gbcImage.getPaletteId()).getPaletteColorsInt(), imageBytes, false,false); + Bitmap image = imageCodec.decodeWithPalette(Utils.hashPalettes.get(gbcImage.getPaletteId()).getPaletteColorsInt(), imageBytes, false, false); if (image.getHeight() == 112 && image.getWidth() == 128) { //I need to use copy because if not it's inmutable bitmap Bitmap framed = Utils.framesList.get(3).getFrameBitmap().copy(Bitmap.Config.ARGB_8888, true); @@ -961,7 +960,7 @@ public static void extractHexImages(String fileContent) throws NoSuchAlgorithmEx gbcImage.setName(fileName + " " + formattedIndex); int height = (data.length() + 1) / 120;//To get the real height of the image ImageCodec imageCodec = new ImageCodec(160, height, false); - Bitmap image = imageCodec.decodeWithPalette(Utils.hashPalettes.get(gbcImage.getPaletteId()).getPaletteColorsInt(), gbcImage.getImageBytes(), false,false); + Bitmap image = imageCodec.decodeWithPalette(Utils.hashPalettes.get(gbcImage.getPaletteId()).getPaletteColorsInt(), gbcImage.getImageBytes(), false, false); importedImagesBitmaps.add(image); importedImagesList.add(gbcImage); } diff --git a/app/src/main/res/layout/fragment_import.xml b/app/src/main/res/layout/fragment_import.xml index 146261b..bafae76 100644 --- a/app/src/main/res/layout/fragment_import.xml +++ b/app/src/main/res/layout/fragment_import.xml @@ -55,7 +55,7 @@ android:layout_height="wrap_content" android:id="@+id/cbAddFrame" android:visibility="gone" - android:text="Add as frame" + android:text="@string/add_as_frame" /> + android:text="@string/rotation_button" /> + android:text="@string/btn_add_frames" + /> \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 996bad7..0f81b97 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -150,4 +150,15 @@ Analyse läuft, bitte warten... Fertig mit der Analyse! + + Überprüfen Sie beim Import/Extrahieren, ob eine gültige .sav-Datei vorhanden ist + Photo-ROM-Ordner löschen? + Als Frame hinzufügen + Schaltfläche Rotation anzeigen. + Legen Sie den Frame-Namen fest + Dieses Bild kann nicht als Frame hinzugefügt werden + Der Name darf nicht leer sein + Der Name darf keine Leerzeichen enthalten + Dieser Framename existiert bereits + Keine gültige Bilddatei diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index e8ab381..1100442 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -150,5 +150,13 @@ ¡Análisis terminado! Comprobar .sav válido al importar/extraer - + ¿Borrar directorio de rom Photo? + Añadir como marco + Mostrar botón Rotar + Establecer nombre del marco + No se puede añadir esta imagen como marco + El nombre no debe estar vacío + El nombre no debe contener espacios + Este nombre de marco ya existe + No es un archivo de imagen válido \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 1a0cb3a..8da3c09 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -132,4 +132,15 @@ Analyse en cours, veuillez patienter... Analyse terminée! + + Vérifier la validité du fichier .sav lors de l\'importation/extraction + Supprimer le dossier rom Photo? + Ajouter comme bordure + Bouton Afficher la rotation + Définir le nom du bordure + Impossible d\'ajouter cette image en tant que bordure + Le nom ne doit pas être vide + Le nom ne doit pas contenir d\'espaces vides + Ce nom de bordure existe déjà + Pas un fichier image valide \ No newline at end of file diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 8073e54..c360977 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -150,4 +150,15 @@ Analisando, aguarde... Análise concluída! + + Verifique se há .sav válido ao importar/extrair + Deletar a pasta Photo rom? + Adicionar como moldura + Mostrar botão de rotação + Definir nome do moldura + Não é possível adicionar esta imagem como moldura + O nome não deve estar vazio + O nome não deve conter espaços vazios + Este nome de moldura já existe + Não é um arquivo de imagem válido \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4a9bc4c..a2b43bb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -152,7 +152,13 @@ Check for valid .sav when importing/extracting Delete Photo rom folder? - - + Add as frame + Show Rotation button + Set frame name + Can\'t add this image as a frame + Name must not be empty + Name must not contain empty spaces + This frame name already exists + Not a valid image file \ No newline at end of file