- Forum posts: 4
Jan 21, 2018, 2:22:25 PM via Website
Jan 21, 2018 2:22:25 PM via Website
Hi There,
I want to translate my android app in differennt languages, so I need to translate the words Shipping Date:, Time:, and others into different languages.
I have these Strings on display_load java class file:
String s = "<b>Shipping Date:</b>" + shipping_date.toString();
loaddate.setText(Html.fromHtml(s));
String t = "<b>Time:</b>" + shipping_time.toString();
loadtime.setText(Html.fromHtml(t));
String u = "<b>shipping_address</b>" + shipping_address_address.toString();
loadplace.setText(Html.fromHtml(u));
String v = "<b>Description:</b>" + description.toString();
txtdesc.setText(Html.fromHtml(v));
String w = "<b>Weight:</b>" + weight.toString() + " KG";
txtweight.setText(Html.fromHtml(w));
String x = "<b>Destination Date:</b>" + destination_date.toString();
txtdestdate.setText(Html.fromHtml(x));
String y = "<b>Time:</b>" + destination_time.toString();
txtdesttime.setText(Html.fromHtml(y));
String z = "<b>Destination Address:</b>" + destination_address_address.toString();
txtdestplace.setText(Html.fromHtml(z));
And these on string.xml file:
String s = getResources().getString(R.string.shipping_date, shipping_date.toString());
String t = getResources().getString(R.string.shipping_time, shipping_time.toString());
String u = getResources().getString(R.string.shipping_address_c, shipping_address_address.toString());
String v = getResources().getString(R.string.transport_description_c, description.toString());
String w = getResources().getString(R.string.weight, weight.toString());
String x = getResources().getString(R.string.destination_date, shipping_date.toString());
String z = getResources().getString(R.string.destination_address, shipping_date.toString());
loaddate.setText(Html.fromHtml(s + t + u + v + w + x + z));
But I got only one row displayed on my android screen:
7it:21/01/2018
Could someone please tell me where I am doing wrong?
Thanks,
Nico