Skip to content

Commit c50d98c

Browse files
committed
Added translations
1 parent 31befde commit c50d98c

File tree

10 files changed

+65
-19
lines changed

10 files changed

+65
-19
lines changed

app/src/main/java/com/mraulio/gbcameramanager/ui/gallery/GalleryFragment.java

-1
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,6 @@ public void onClick(DialogInterface dialog, int which) {
12661266
LocalDateTime now = LocalDateTime.now();
12671267

12681268
File gifFile = new File(Utils.IMAGES_FOLDER, "GIF_" + dtf.format(now) + ".gif");
1269-
File mp4File = new File(Utils.IMAGES_FOLDER, "GIF_" + dtf.format(now) + ".mp4");
12701269

12711270
try (FileOutputStream out = new FileOutputStream(gifFile)) {
12721271

app/src/main/java/com/mraulio/gbcameramanager/ui/importFile/ImportFragment.java

+10-11
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public void onClick(View v) {
313313
}
314314
} else if (cbAddFrame.isChecked()) {
315315
if (finalListBitmaps.get(0).getHeight() != 144 && finalListBitmaps.get(0).getHeight() != 224) {
316-
Utils.toast(getContext(), "Can't add this image as a frame");//Add string
316+
Utils.toast(getContext(), getString(R.string.cant_add_frame));//Add string
317317
btnAddImages.setEnabled(true);
318318
} else frameNameDialog();
319319
}
@@ -337,27 +337,27 @@ private void frameNameDialog() {
337337
EditText etFrameName = view.findViewById(R.id.etFrameName);
338338
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
339339
builder.setView(view);
340-
AlertDialog alertdialog = builder.create();
340+
AlertDialog alertdialog = builder.create();
341341

342342
etFrameName.setImeOptions(EditorInfo.IME_ACTION_DONE);//When pressing enter
343-
builder.setTitle("Set new Frame name");//Add string
343+
// builder.setTitle("Set new Frame name");//Add string
344344
Button btnSaveFrame = view.findViewById(R.id.btnSaveFrame);
345345
btnSaveFrame.setOnClickListener(new View.OnClickListener() {
346346
@Override
347347
public void onClick(View v) {
348348
GbcFrame gbcFrame = new GbcFrame();
349349
gbcFrame.setFrameBitmap(filledFrame);
350-
if (filledFrame.getHeight()==224){
350+
if (filledFrame.getHeight() == 224) {
351351
gbcFrame.setWildFrame(true);
352352
}
353353
List<GbcFrame> newFrameImages = new ArrayList<>();
354354
//Add here the dialog for the frame name
355355
String frameName = etFrameName.getText().toString();
356356
if (frameName.equals("")) {
357-
Utils.toast(getContext(), "Name must not be empty");//Add string
357+
Utils.toast(getContext(), getString(R.string.no_empty_frame_name));
358358
etFrameName.setBackgroundColor(Color.parseColor("#FF0000"));
359359
} else if (frameName.contains(" ")) {
360-
Utils.toast(getContext(), "Text must no contain empty spaces.");//Add string
360+
Utils.toast(getContext(), getString(R.string.no_spaces_frame_name));//Add string
361361
etFrameName.setBackgroundColor(Color.parseColor("#FF0000"));
362362
} else {
363363
gbcFrame.setFrameName(frameName);
@@ -367,7 +367,7 @@ public void onClick(View v) {
367367
if (frame.getFrameName().toLowerCase(Locale.ROOT).equals(gbcFrame.getFrameName())) {
368368
alreadyAdded = true;
369369
etFrameName.setBackgroundColor(Color.parseColor("#FF0000"));
370-
Utils.toast(getContext(), "This frame name already exists.");//Add string
370+
Utils.toast(getContext(), getString(R.string.frame_name_exists));//Add string
371371
break;
372372
}
373373
}
@@ -857,7 +857,7 @@ public void onActivityResult(ActivityResult result) {
857857

858858
} else {
859859
tvFileName.setText(getString(R.string.file_name) + fileName);
860-
tvFileName.setText("Not a valid image file");
860+
tvFileName.setText(getString(R.string.no_valid_image_file));
861861
btnExtractFile.setVisibility(View.GONE);
862862
btnAddImages.setVisibility(View.GONE);
863863
layoutCb.setVisibility(View.GONE);
@@ -898,7 +898,6 @@ public boolean extractSavImages() {
898898
listImportedImageBytes = extractor.extractBytes(fileBytes);
899899
//Check for Magic or FF bytes
900900
if (!magicIsReal(fileBytes)) {
901-
System.out.println("NO VALID FILE///////////////////////");
902901
return false;
903902
}
904903
int nameIndex = 1;
@@ -917,7 +916,7 @@ public boolean extractSavImages() {
917916
String hashHex = Utils.bytesToHex(hash);
918917
gbcImage.setHashCode(hashHex);
919918
ImageCodec imageCodec = new ImageCodec(128, 112, gbcImage.isLockFrame());
920-
Bitmap image = imageCodec.decodeWithPalette(Utils.hashPalettes.get(gbcImage.getPaletteId()).getPaletteColorsInt(), imageBytes, false,false);
919+
Bitmap image = imageCodec.decodeWithPalette(Utils.hashPalettes.get(gbcImage.getPaletteId()).getPaletteColorsInt(), imageBytes, false, false);
921920
if (image.getHeight() == 112 && image.getWidth() == 128) {
922921
//I need to use copy because if not it's inmutable bitmap
923922
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
961960
gbcImage.setName(fileName + " " + formattedIndex);
962961
int height = (data.length() + 1) / 120;//To get the real height of the image
963962
ImageCodec imageCodec = new ImageCodec(160, height, false);
964-
Bitmap image = imageCodec.decodeWithPalette(Utils.hashPalettes.get(gbcImage.getPaletteId()).getPaletteColorsInt(), gbcImage.getImageBytes(), false,false);
963+
Bitmap image = imageCodec.decodeWithPalette(Utils.hashPalettes.get(gbcImage.getPaletteId()).getPaletteColorsInt(), gbcImage.getImageBytes(), false, false);
965964
importedImagesBitmaps.add(image);
966965
importedImagesList.add(gbcImage);
967966
}

app/src/main/res/layout/fragment_import.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
android:layout_height="wrap_content"
5656
android:id="@+id/cbAddFrame"
5757
android:visibility="gone"
58-
android:text="Add as frame"
58+
android:text="@string/add_as_frame"
5959
/>
6060
<GridView
6161
android:id="@+id/gridViewImport"

app/src/main/res/layout/fragment_settings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
android:autoSizeMinTextSize="10sp"
128128
android:autoSizeTextType="uniform"
129129
android:maxLines="1"
130-
android:text="Show Rotation button" />
130+
android:text="@string/rotation_button" />
131131

132132
<TextView
133133
android:layout_width="match_parent"

app/src/main/res/layout/frame_name_dialog.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
android:id="@+id/etFrameName"
1515
android:layout_width="match_parent"
1616
android:layout_height="wrap_content"
17-
android:hint="Set frame name"
17+
android:hint="@string/frame_name"
1818
android:singleLine="true" />
1919

2020
<ImageView
@@ -31,6 +31,7 @@
3131
android:layout_width="wrap_content"
3232
android:layout_height="wrap_content"
3333
android:layout_marginTop="20dp"
34-
android:text="Save frame" />
34+
android:text="@string/btn_add_frames"
35+
/>
3536
</LinearLayout>
3637
</ScrollView>

app/src/main/res/values-de/strings.xml

+11
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,15 @@
150150

151151
<string name="analyzing">Analyse läuft, bitte warten...</string>
152152
<string name="done_analyzing">Fertig mit der Analyse!</string>
153+
154+
<string name="check_magic">Überprüfen Sie beim Import/Extrahieren, ob eine gültige .sav-Datei vorhanden ist</string>
155+
<string name="delete_photo_folder_dialog">Photo-ROM-Ordner löschen?</string>
156+
<string name="add_as_frame">Als Frame hinzufügen</string>
157+
<string name="rotation_button">Schaltfläche Rotation anzeigen.</string>
158+
<string name="frame_name">Legen Sie den Frame-Namen fest</string>
159+
<string name="cant_add_frame">Dieses Bild kann nicht als Frame hinzugefügt werden</string>
160+
<string name="no_empty_frame_name">Der Name darf nicht leer sein</string>
161+
<string name="no_spaces_frame_name">Der Name darf keine Leerzeichen enthalten</string>
162+
<string name="frame_name_exists">Dieser Framename existiert bereits</string>
163+
<string name="no_valid_image_file">Keine gültige Bilddatei</string>
153164
</resources>

app/src/main/res/values-es/strings.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,13 @@
150150
<string name="done_analyzing">¡Análisis terminado!</string>
151151

152152
<string name="check_magic">Comprobar .sav válido al importar/extraer</string>
153-
153+
<string name="delete_photo_folder_dialog">¿Borrar directorio de rom Photo?</string>
154+
<string name="add_as_frame">Añadir como marco</string>
155+
<string name="rotation_button">Mostrar botón Rotar</string>
156+
<string name="frame_name">Establecer nombre del marco</string>
157+
<string name="cant_add_frame">No se puede añadir esta imagen como marco</string>
158+
<string name="no_empty_frame_name">El nombre no debe estar vacío</string>
159+
<string name="no_spaces_frame_name">El nombre no debe contener espacios</string>
160+
<string name="frame_name_exists">Este nombre de marco ya existe</string>
161+
<string name="no_valid_image_file">No es un archivo de imagen válido</string>
154162
</resources>

app/src/main/res/values-fr/strings.xml

+11
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,15 @@
132132

133133
<string name="analyzing">Analyse en cours, veuillez patienter...</string>
134134
<string name="done_analyzing">Analyse terminée!</string>
135+
136+
<string name="check_magic">Vérifier la validité du fichier .sav lors de l\'importation/extraction</string>
137+
<string name="delete_photo_folder_dialog">Supprimer le dossier rom Photo?</string>
138+
<string name="add_as_frame">Ajouter comme bordure</string>
139+
<string name="rotation_button">Bouton Afficher la rotation</string>
140+
<string name="frame_name">Définir le nom du bordure</string>
141+
<string name="cant_add_frame">Impossible d\'ajouter cette image en tant que bordure</string>
142+
<string name="no_empty_frame_name">Le nom ne doit pas être vide</string>
143+
<string name="no_spaces_frame_name">Le nom ne doit pas contenir d\'espaces vides</string>
144+
<string name="frame_name_exists">Ce nom de bordure existe déjà</string>
145+
<string name="no_valid_image_file">Pas un fichier image valide</string>
135146
</resources>

app/src/main/res/values-pt-rBR/strings.xml

+11
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,15 @@
150150

151151
<string name="analyzing">Analisando, aguarde...</string>
152152
<string name="done_analyzing">Análise concluída!</string>
153+
154+
<string name="check_magic">Verifique se há .sav válido ao importar/extrair</string>
155+
<string name="delete_photo_folder_dialog">Deletar a pasta Photo rom?</string>
156+
<string name="add_as_frame">Adicionar como moldura</string>
157+
<string name="rotation_button">Mostrar botão de rotação</string>
158+
<string name="frame_name">Definir nome do moldura</string>
159+
<string name="cant_add_frame">Não é possível adicionar esta imagem como moldura</string>
160+
<string name="no_empty_frame_name">O nome não deve estar vazio</string>
161+
<string name="no_spaces_frame_name">O nome não deve conter espaços vazios</string>
162+
<string name="frame_name_exists">Este nome de moldura já existe</string>
163+
<string name="no_valid_image_file">Não é um arquivo de imagem válido</string>
153164
</resources>

app/src/main/res/values/strings.xml

+8-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@
152152

153153
<string name="check_magic">Check for valid .sav when importing/extracting</string>
154154
<string name="delete_photo_folder_dialog">Delete Photo rom folder?</string>
155-
156-
155+
<string name="add_as_frame">Add as frame</string>
156+
<string name="rotation_button">Show Rotation button</string>
157+
<string name="frame_name">Set frame name</string>
158+
<string name="cant_add_frame">Can\'t add this image as a frame</string>
159+
<string name="no_empty_frame_name">Name must not be empty</string>
160+
<string name="no_spaces_frame_name">Name must not contain empty spaces</string>
161+
<string name="frame_name_exists">This frame name already exists</string>
162+
<string name="no_valid_image_file">Not a valid image file</string>
157163

158164
</resources>

0 commit comments

Comments
 (0)