Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Android for Beginners : Spanish Localization Solution. This would be saved in the res/values-es/strings.xml file.
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Title for the application. [CHAR LIMIT=12] -->
<string name="app_name">Sólo Java</string>
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">Nombre</string>
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">Ingredientes</string>
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">Crema batida</string>
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">Chocolate</string>
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">Cantidad</string>
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">Ordenar</string>
<!--
Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">Nombre: <xliff:g id="name" example="Amy">%s</xliff:g></string>
<!--
Whipped cream topping for the order summary. It will be shown in the format of
"Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">Agregue la crema batida? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
<!--
Chocolate topping for the order summary. It will be shown in the format of
"Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">Agregue el chocolate? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>
<!--
Quantity of coffee cups for the order summary. It will be shown in the format of
"Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">Cantidad: <xliff:g id="quantity" example="2">%d</xliff:g></string>
<!--
Total price for the order summary. It will be shown in the format of
"Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">Total: <xliff:g id="price" example="$10">%s</xliff:g></string>
<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">¡Gracias!</string>
<!--
Subject line for the order summary email. It will be in the format of
"Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">Sólo java para <xliff:g id="name" example="Amy">%s</xliff:g></string>
</resources>
@jorlop89

This comment has been minimized.

Copy link

commented Aug 7, 2015

Great translation. Thank you very much from Spain :)

@DainialPadraig

This comment has been minimized.

Copy link

commented Jan 8, 2016

Thanks for the translation file. However, you copy and pasted too many times for the header strings. The comments are all for the name hint text.

@Cascascap

This comment has been minimized.

Copy link

commented Jan 10, 2016

A little advice, it's easier to export he strings by selecting it with the mouse and then pressing ALT+ENTER, then selecting Extract string resource, give it the variable and this will move the string to the strings.xml automatically and also complete the task number 2 for that string.

@peterzimt

This comment has been minimized.

Copy link

commented Jan 17, 2016

Here is the french version :)

This is so convenient :)

Java, juste Java
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">Ton petit nom</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">Les extras</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">Un nuage de lait</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">Chocolat</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">Quantité</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">Commander</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">Nom: <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">Avec un nuage de lait? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">Avec du chocolat ? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">Quantité: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">Total: <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">Mille merci!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">Java, Juste Java pour <xliff:g id="name" example="Amy">%s</xliff:g></string>
@Datazource

This comment has been minimized.

Copy link

commented Mar 15, 2016

Indonesian 😄

<resources xmlns:xliff="http://schemas.android.com/tools">
    <string name="app_name">Hanya Java</string>
    <string name="name">Nama</string>
    <string name="toppings">Rempah - Rempah</string>
    <string name="whipped_cream">Krim Susu</string>
    <string name="chocolate">Coklat</string>
    <string name="quantity">Jumlah</string>
    <string name="initial_quantity_value">2</string>
    <string name="order">Pesan</string> 
    <string name="order_summary_name">Nama :<xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary_whipped_cream">Tambah Krim Susu ?<xliff:g id="addWhippedCream" example="true">%s</xliff:g></string>
    <string name="order_summary_chocolate">Tambahkan Coklat ?<xliff:g id="addChocolate" example="ya">%s</xliff:g></string>
    <string name="order_summary_quantity">Jumlah : <xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_summary_price">Total:<xliff:g id="price" example="Rp.10">%s</xliff:g></string>
    <string name="thank_you">Terimakasih !</string>
    <string name="order_summary_email_subject">Pesanan Hanya Java Untuk<xliff:g id="name" example="Amy">%s</xliff:g></string>

</resources>
@edsonfast

This comment has been minimized.

Copy link

commented Mar 17, 2016

Português Brasil (pt-rBR)

`


Seu nome

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="toppings">Extras</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="whipped_cream">Um pouco de leite</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="chocolate">Chocolate</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="quantity">Quantidade</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
    <string name="initial_quantity_value">2</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="order">Pedido</string>

    <!--
      Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
      user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_name">Nom: <xliff:g id="name" example="Amy">%s</xliff:g></string>

    <!--
      Whipped cream topping for the order summary. It will be shown in the format of
      "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_whipped_cream">Com creme de chantilly? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

    <!--
      Chocolate topping for the order summary. It will be shown in the format of
      "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_chocolate">Com cobertura de chocolate? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

    <!--
      Quantity of coffee cups for the order summary. It will be shown in the format of
      "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_quantity">Quantidade: <xliff:g id="quantity" example="2">%d</xliff:g></string>

    <!--
      Total price for the order summary. It will be shown in the format of
      "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_price">Total: <xliff:g id="price" example="$10">%s</xliff:g></string>

    <!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
    <string name="thank_you">Muito obrigado!</string>

    <!--
      Subject line for the order summary email. It will be in the format of
      "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_email_subject">Java, Juste Java pour <xliff:g id="name" example="Amy">%s</xliff:g></string>
</resources>`
@Sarcares

This comment has been minimized.

Copy link

commented Apr 1, 2016

Italian resources (it)
I added more strings

<resources>
    <string name="app_name">Solo Java</string>
    <string name="chocolate">Cioccolato</string>
    <string name="lower_coffee_limit">Non puoi ordinare meno di 1 caffè!</string>
    <string name="name">Nome</string>
    <string name="order">Ordina</string>
    <string name="order_submitted">Ordine inviato</string>
    <string name="order_summary_chocolate">Aggiunta cioccolato?</string>
    <string name="order_summary_email_subject">Solo Java Ordinazione</string>
    <string name="order_summary_name">Nome:</string>
    <string name="order_summary_price">Prezzo totale: $</string>
    <string name="order_summary_quantity">Quantità</string>
    <string name="order_summary_whipped_cream">Aggiunta panna montata?</string>
    <string name="press_order_message">Premi ordina per confermare!</string>
    <string name="quantity">Quantità</string>
    <string name="show_maps">Trovaci su Maps!</string>
    <string name="thank_you">Grazie!</string>
    <string name="toppings">Guarnizioni</string>
    <string name="upper_coffee_limit">Hai raggiunto il limite di caffè!</string>
    <string name="whipped_cream">Panna Montata</string>
    <string name="zero_coffee">Non puoi ordinare 0 caffè!</string>
</resources>
@mostafa3ly

This comment has been minimized.

Copy link

commented Apr 2, 2016

Arabic Version
النسخة العربية


الجافا فقط
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">الأسم</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">إضافات</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">كريمه</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">شوكولاتة</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">الكميه</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">٢</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">أطلب</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">: الأسم<xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">إضافة كريمه ؟ <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">إضافة شوكولاتة؟<xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">: الكميه<xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">:الأجمالى <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">شكراَ</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject"> الجافا فقط إلى <xliff:g id="name" example="Amy">%s</xliff:g></string>
@Yunyopern

This comment has been minimized.

Copy link

commented Jun 12, 2016

I still get the % symbol in my order summary please help.

@miguelusque

This comment has been minimized.

Copy link

commented Jun 26, 2016

Hi!

I would say that it is missing the Toast messages translation. Please find below the English and the Spanish versions:

English:

<!-- Message displayed when the customer tries to request more than 100 coffees -->
<string name="too_many_coffees">You cannot have more than 100 coffees.</string>

<!-- Message displayed when the customer tries to request less than 1 coffee -->
<string name="too_few_coffees">You cannot have less than 1 coffee.</string>

Spanish:

<!-- Message displayed when the customer tries to request more than 100 coffees -->
<string name="too_many_coffees">No se pueden pedir más de 100 cafés.</string>

<!-- Message displayed when the customer tries to request less than 1 coffee -->
<string name="too_few_coffees">No se pueden pedir menos de 1 café.</string>

Hope it helps!

Miguel Ángel

@genie137

This comment has been minimized.

Copy link

commented Jul 11, 2016

And for Dutch, Be aware I have used different String names at some places.

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">Alleen Java</string>
    <string name="chocolate">Chocolade</string>
    <string name="name">Naam</string>
    <string name="order">Bestel</string>
    <string name="quantity">Aantal</string>
    <string name="toppings">Toevoegingen</string>
    <string name="whippedcream">Geklopte Melk</string>
    <string name="order_summary_quantity">Aantal: <xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_summary_chocolate">Chocolade Toevoegen? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>
    <string name="order_summary_whipped_cream">Geklopte Melk Toevoegen? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
    <string name="order_summary_price">Totaal:  <xliff:g id="price" example="$10">%s</xliff:g></string>
    <string name="thank_you">Bedankt!</string>
    <string name="order_summary_email_subject">Alleen Java bestelling voor <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="error_decrement">Je kan niet minder dan 1 kop koffie bestellen!</string>
    <string name="error_increment">Je kan niet meer dan 100 koppen koffie bestellen!</string>
    <string name="order_summary_name">Naam: <xliff:g id="name" example="Amy">%s</xliff:g></string>
</resources>
@hardvin

This comment has been minimized.

Copy link

commented Jul 13, 2016

Gracias :D

@yuvol

This comment has been minimized.

Copy link

commented Jul 18, 2016

And Russian:

<string name="app_name">Just Java</string>
<string name="TOPPINGS">добавки</string>
<string name="name">ФИО: <xliff:g id="name" example="Amy">%s</xliff:g></string>
<string name="quantity">Количество:  </string>
<string name="settings">Настройки</string>
<string name="Chocolate">Шоколад</string>
<string name="FAMILY_NAME">Фамилия</string>
<string name="FIRST_NAME">Имя</string>
<string name="Order">Заказать</string>
<string name="Thanks">Спасибо</string>
<string name="Total">Итого: <xliff:g id="total" example="$10">%s</xliff:g></string>
<string name="Whipped_cream">Сливки</string>
<string name="subject"><xliff:g id="subject" example="Amy">%s</xliff:g>: Just Java заказ</string>
<string name="toastDown">Количество должно быть больше нуля</string>
<string name="toastUp">Количество должно быть меньше 100</string>
<string name="no">нет</string>
<string name="yes">да</string>
@tallib

This comment has been minimized.

Copy link

commented Jul 20, 2016

Add Ukrainian:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">Тільки Java</string>
    <string name="chocolate">Шоколад</string>
    <string name="thank_you">Дякуємо</string>
    <string name="toppings">Добавки</string>
    <string name="quantity">Кількість</string>
    <string name="order">Замовити</string>
    <string name="name">Ім\'я</string>
    <string name="whipped_cream">Збиті вершки</string>
    <string name="initial_quantity_value">2</string>
    <string name="order_summary_price">Всього: <xliff:g id="price" example="$10">%s</xliff:g></string>
    <string name="order_summary_quantity">Кількість: <xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_summary_whipped_cream">Додані збиті вершки? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
    <string name="order_summary_chocolate">Доданий шоколад? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>
    <string name="order_summary_email_subject">Тільки Java замовлення для <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary_name">Ім\'я: <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary">Підсумок замовлення</string>
</resources>
@maruf00014

This comment has been minimized.

Copy link

commented Jul 30, 2016

Why not Bengali :

জাস্ট জাভা
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">নাম</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">টপিং</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">ফেটান ক্রিম</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">চকলেট</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">পরিমান</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">আদেশ</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">নাম : <xliff:g id="name" example="মফিজ">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">ফেটান ক্রিম যোগ? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">চকলেট যোগ? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">পরিমান: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">মোট : <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">ধন্যবাদ !</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">জাভা শুধুমাত্র <xliff:g id="name" example="Amy">%s</xliff:g></string>
@Sina-Amiri

This comment has been minimized.

Copy link

commented Jul 30, 2016

Persian (فارسی):

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xcliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">فقط جاوا</string>
    <string name="hint_name">نام</string>
    <string name="toppings">توپینگ ها</string>
    <string name="whipped_cream">خامه</string>
    <string name="chocolate">شکلات</string>
    <string name="quantity">تعداد</string>
    <string name="initial_quantity_value">1</string>
    <string name="order">سفارش</string>
    <string name="thank_you">با تشکر!</string>
    <string name="order_summary_name"> نام: <xcliff:g id="name" example="Sina" >%s</xcliff:g></string>
    <string name="order_summary_whipped_cream">خامه اضافه شود؟: <xcliff:g id="addWhippedCream">%b</xcliff:g></string>
    <string name="order_summary_chocolate">شکلات اضافه شود؟: <xcliff:g id="addChocolate">%b</xcliff:g></string>
    <string name="order_summary_quantity">تعداد: <xcliff:g id="quantity" example="2">%d</xcliff:g></string>
    <string name="order_summary_price">مبلغ: $ <xcliff:g id="price" example="$2">%d</xcliff:g></string>
    <string name="order_summary_email_subject">سفارش JustJava برای <xcliff:g id="name" example="Sina">%s</xcliff:g></string>


</resources>
@tahseenbokhari

This comment has been minimized.

Copy link

commented Jul 31, 2016

I am still getting %s and %b signs with the Add whipped cream, add chocolate and total. Can someone help me regarding this issue?

@ghost

This comment has been minimized.

Copy link

commented Aug 10, 2016

It is so well explained that I'm learning without knowing English, conosco only a few words, but how good is the course'm learning very well with subtitles translated youtube player.

@bxb100

This comment has been minimized.

Copy link

commented Aug 13, 2016

chinese 中文

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">Just Java</string>
    <string name="chocolate">巧克力</string>
    <string name="name">姓名</string>
    <string name="order">下订单</string>
    <string name="order_summary_chocolate">加巧克力?<xliff:g id="addChocolate" example="true">%b</xliff:g></string>
    <string name="order_summary_email_subject"><xliff:g id="name" example="Amy">%s</xliff:g> 的Just Java订单</string>
    <string name="order_summary_name">姓名:<xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary_price">总价:<xliff:g id="price" example="$10">%s</xliff:g></string>
    <string name="order_summary_quantity">数量:<xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_summary_whipped_cream">加生奶油?<xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
    <string name="quantity">数量</string>
    <string name="thank_you">谢谢!</string>
    <string name="toppings">配料</string>
    <string name="whipped_cream">生奶油</string>
</resources>
@AhsanRafiqHussain

This comment has been minimized.

Copy link

commented Aug 16, 2016

And Urdu اردو

National language of PAKISTAN not End!@


<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">Java صرف</string>
    <string name="Toast_Max">آپ ایک وقت میں سو کافی مطالبہ نہیں کر سکتے ہیں</string>
    <string name="Toast_Min">کم از کم ایک کافی مطالبہ کر سکتے ہیں</string>
    <string name="action_settings">ترتیبات</string>
    <string name="chocolate">چاکلیٹ</string>
    <string name="emailSubject"><xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="name">نام</string>
    <string name="order">آرڈر</string>
    <string name="orderSummary">حکم کا خلاصہ</string>
    <string name="order_summary_chocolate"><xliff:g id="addChocolate" example="true">%b</xliff:g> چاکلیٹ شامل ؟ </string>
    <string name="order_summary_name"><xliff:g id="name" example="Amy">%s</xliff:g> :نام</string>
    <string name="order_summary_price"><xliff:g id="price" example="10">%s</xliff:g> :کل </string>
    <string name="order_summary_quantity"><xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="initial_quantity_value">2</string>
    <string name="order_summary_whipped_cream"><xliff:g id="addWhippedCream" example="true">%b</xliff:g> گاڑھا دودھ کریم شامل ؟</string>
    <string name="quantity">مقدار </string>
    <string name="thank_you">آپ کا شکریہ!</string>
    <string name="toppings">ٹاپنگ</string>
    <string name="whippedCream">گاڑھا دودھ کریم</string>
</resources>
@Autodidact7

This comment has been minimized.

Copy link

commented Aug 30, 2016

Kannada ಕನ್ನಡ
State language of Karnataka, India.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Just Java</string>
    <string name="thank_you">ಧನ್ಯವಾದಗಳು! </string>
    <string name="toppings">ಮೇಲೋಗರಗಳಿಗೆ </string>
    <string name="whipped_cream">ಹಾಲಿನ ಕೆನೆ </string>
    <string name="quantity">ಪ್ರಮಾಣ</string>
    <string name="name">ಹೆಸರು</string>
    <string name="initial_quantity_value">0</string>
    <string name="chocolate">ಚಾಕೊಲೇಟ್ </string>
    <string name="order">ಆರ್ಡರ್ </string>
    <string name="order_summary_chocolate">ಚಾಕೊಲೇಟ್ ಸೇರಿಸಿ ? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>
    <string name="order_summary_email_subject">ಕೇವಲ ಜಾವಾ ಸಲುವಾಗಿ  <xliff:g id="ಹೆಸರು" example="ಆಮಿ">%s</xliff:g></string>
    <string name="order_summary_name">ಹೆಸರು: <xliff:g id="ಹೆಸರು" example="ಆಮಿ">%s</xliff:g></string>
    <string name="order_summary_price">ಒಟ್ಟು: <xliff:g id="ಬೆಲೆ" example="$10">%s</xliff:g></string>
    <string name="order_summary_quantity">ಪ್ರಮಾಣ: <xliff:g id="ಪ್ರಮಾಣ" example="2">%d</xliff:g></string>
    <string name="order_summary_whipped_cream">ಹಾಲಿನ ಕೆನೆ ಸೇರಿಸಿ ?  <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
</resources>
@RohitParihar

This comment has been minimized.

Copy link

commented Sep 2, 2016

JustJava App in INDIAN VERSION............

`


सिर्फ जावा

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">नाम</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">उपरी परत</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">फेटी हुई मलाई</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">चॉकलेट</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">मात्रा</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">आदेश करे</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">नाम: <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">क्रीम जोड़ें? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">चॉकलेट जोड़ें ? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">मात्रा: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">कुल: <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">धन्यवाद!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">केवल जावा <xliff:g id="name" example="Amy">%s</xliff:g></string>

`

@AndreiKuzmin

This comment has been minimized.

Copy link

commented Sep 17, 2016

- RUSSIAN
- 
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
-     <string name="app_name">Просто Java</string>
-     <string name="chocolate">Шоколад</string>
-     <string name="initial_quantity_value">2</string>
-     <string name="name">Имя</string>
-     <string name="order">Заказ</string>
-     <string name="order_summary_chocolate">Добавить шоколад? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>
-     <string name="order_summary_email_subject">Просто Java заказ для <xliff:g id="name" example="Amy">%s</xliff:g></string>
-     <string name="order_summary_name">Имя: <xliff:g id="name" example="Amy">%s</xliff:g></string>
-     <string name="order_summary_price">Итого: <xliff:g id="price" example="$10">%s</xliff:g></string>
-     <string name="order_summary_quantity">Количество: <xliff:g id="quantity" example="2">%d</xliff:g></string>
-     <string name="order_summary_whipped_cream">Добавить взбитые сливки? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
-     <string name="quantity">Количество</string>
-     <string name="thank_you">Спасибо!</string>
-     <string name="toppings">Добавки</string>
-     <string name="whipped_cream">Взбитые сливки</string>
- </resources>
- 
- - 
- 
- - 
@ItIsAnismit

This comment has been minimized.

Copy link

commented Oct 9, 2016

Nepali (नेपाली)Language (National Language of Nepal)

<!-- Title for the application. [CHAR LIMIT=12] -->
<string name="app_name">मात्र जाभा</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">नाम</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">सामाग्री</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">विप्ड्ड क्रिम</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">चकलेट</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">मात्रा</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">२</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">माग</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">नाम: <xliff:g id="name" example="अमी">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "विप्ड्ड क्रिम थप्ने हाे? हाे" or "विप्ड्ड क्रिम थप्ने हाे? हाेइन". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">विप्ड्ड क्रिम थप्ने हाे?<xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "चकलेट थप्ने हाे? हाे" or "विप्ड्ड क्रिम थप्ने हाे? हाेइन". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">चकलेट थप्ने हाे? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">मात्रा: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "जम्मा: रू. १०" where रू. १० is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">जम्मा: <xliff:g id="price" example="रू. १०">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">¡धन्यवाद!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">अमिकाे लागी मात्र जाभा <xliff:g id="name" example="Amy">%s</xliff:g></string>
@d2idan

This comment has been minimized.

Copy link

commented Oct 15, 2016

Hello. I need help please.

I see at the final layout , at the hint, this : "Name: %s"
Why I see the "%s" ? I did everything as needed.

Thanks.

@rain-forest-river

This comment has been minimized.

Copy link

commented Oct 21, 2016

getString(R.string.order_summary_name, name);
guess maybe the ", name" is missing ?

@lytwaytLaz

This comment has been minimized.

Copy link

commented Nov 23, 2016

Swedish

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="http://schemas.android.com/tools">
    <string name="app_name">Bara Java</string>
    <string name="chocolate">Choklad</string>
    <string name="quantity_string">Antal</string>
    <string name="hint_for_name">Ange namn</string>
    <string name="order">Beställ</string>
    <string name="toppings">Garnering</string>
    <string name="thank_you">Tack så mycket!</string>
    <string name="cream">Vispgrädde</string>
    <string name="order_summary">Namn: <xliff:g id="name" example="Johan">%s</xliff:g></string>
    <string name="has_chocolate">Med choklad? <xliff:g id="hasChocolate" example="true">%b</xliff:g></string>
    <string name="has_cream">Med vispgrädde? <xliff:g id="hasWhippedCream" example="true">%b</xliff:g></string>
    <string name="quantity_value">Antal: <xliff:g id="quantity" example="true">%d</xliff:g></string>
    <string name="total_price">Totalt: <xliff:g id="priceOfOrder" example="18">%d</xliff:g> SEK</string>
    <string name="max_order">Högst 100 koppar</string>
    <string name="min_order">Minst 1 kopp</string>
    <string name="initial_quantity_value">1</string>
    <string name="order_mail_subject">BaraJava beställning till <xliff:g id="name" example="Johan">%s</xliff:g></string>
</resources>

Beware differences in names.

@OsmanAppDeveloper

This comment has been minimized.

Copy link

commented Dec 29, 2016

Thank you very much for posting this gist. How can we Translate Java Code ? Any Idea or is it Impossible to Translate?

I know in this video it says we can only translate the strings variables present in Strings.xml file only . But I have a question, like if you check out the below picture everything is in Spanish accept the Boolean and dynamic values we are passing . I am just curious because In spanish True means "Cierto" and here below its Showing as "true" which does n't add 100 % value to our Translation functionality. translated the Just Java App verbiage in my local langauge everything else got transalated except the arguments(Dynamic Values).

image

@a-djebali

This comment has been minimized.

Copy link

commented Jan 7, 2017

Hey there, here is a quick hack but you might find better out there. I'm using French language as an example ;)
True --> Oui
False --> Non

private String createOrderSummary(String name, int price, boolean addWhippedCream, boolean addChocolate){

        StringBuffer message = new StringBuffer();
        message.append(getString(R.string.name));
       
        // Locale.getDefault().getDisplayLanguage() values depend on the device current language : English, français (French) ...ect
        
        // for the first condition, if addWhippedCream == true and Locale.getDefault().getDisplayLanguage() contains fr
        // (first two letters of french language) then display Oui instead of True 

        if(addWhippedCream && Locale.getDefault().getDisplayLanguage().contains("fr")){
            message.append("\n"+whippedCreamLabel+"? ").append("Oui");
        }else{
            if(!addWhippedCream && Locale.getDefault().getDisplayLanguage().contains("fr")){
                message.append("\n"+whippedCreamLabel+"? ").append("Non");
            }else{ 
                message.append("\n"+whippedCreamLabel+"? ").append(addChocolate);
            }
        }


        if(addChocolate && Locale.getDefault().getDisplayLanguage().contains("fr")){
            message.append("\n"+choclateLabel+"? ").append("Oui");
        }else{
            if(!addChocolate && Locale.getDefault().getDisplayLanguage().contains("fr")){
                message.append("\n"+choclateLabel+"? ").append("Non");
            }
            else{
                message.append("\n"+choclateLabel+"? ").append(addChocolate);
            }
        }

        message.append("\n"+getString(R.string.quantity)+" ").append(numberOfCoffees);
        message.append("\n"+getString(R.string.total)+": ").append(NumberFormat.getCurrencyInstance().format(price));
        message.append("\n"+getString(R.string.thank_you)+"!");
        return message.toString();
    }

Best of luck

@raminghaderi

This comment has been minimized.

Copy link

commented Jan 11, 2017

<string name="app_name">فقط جاوا</string>
<string name="name">اسم</string>
<string name="topping">چاشنی روی غذا</string>
<string name="whippedCream">خامه</string>
<string name="choclate">شکلات</string>
<string name="order">سفارش</string>
<string name="quantity">تعداد</string>
<string name="thank_you">متشکرم</string>

<string name="maximum_limit">نمی توانید بیشتر از ۱۰۰ کافه سفارش دهید</string>
<string name="minimum_limit">نمی توانید کمتر از ۱ کافه سفارش دهید</string>

<string name="just_java_order_for">سفارش فقط جاوا برای <xliff:g id="name" example="amy">%s</xliff:g></string>
<string name="order_summary_name">اسم:<xliff:g id="name" example="Amy">%s</xliff:g></string>
<string name="order_summary_addWhippedCream">خامه اضافه شود؟ <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
<string name="order_summary_addChoclate">شکلات اضافه شود؟ <xliff:g id="addChoclate" example="true">%b</xliff:g></string>
<string name="order_summary_quantity">تعداد <xliff:g id="quantity" example="2">%d</xliff:g></string>
<string name="order_summary_total">جمع کل <xliff:g id="total" example="2$">%s</xliff:g></string>
@jgiza

This comment has been minimized.

Copy link

commented Jan 20, 2017

Hi guys,
below polish translation. I added a code dedicated to the Toast messages. Enjoy

<!--activity_mail.xml file-->
    <string name="app_name">Czas na Java</string>
    <string name="fill_your_name_here">Wpisz swoje imię</string>
    <string name="toppings">Dodatki</string>
    <string name="whipped_cream">Bita śmietana (+1 za sztukę)</string>
    <string name="chocolate">Czekolada (+2 za sztukę)</string>
    <string name="initial_quantity_value">2</string>
    <string name="order">Zamów</string>
    <string name="thank_you">Dziękujemy za zamówienie.</string>
    <string name="quantity">Ilość (5 za sztukę)</string>

<!--MainActivity.java file-->
    <string name="order_summary_name">Imię: <xliff:g id="name" example="Jakub"></xliff:g></string>
    <string name="order_summary_whipped_cream">Bita śmietana?<xliff:g id="addWhippedCream" example="true"></xliff:g></string>
    <string name="order_summary_chocolate">Czekolada?<xliff:g id="addChocolate" example="true"></xliff:g></string>
    <string name="order_summary_quantity">Sztuk:<xliff:g id="quantity" example="2"></xliff:g></string>
    <string name="order_summary_price">Razem: <xliff:g id="price" example="10Euro">%s</xliff:g></string>
    <string name="order_summary_email_subject">Czas na Java dla:<xliff:g id="name" example="Jakub"></xliff:g></string>

<!--Toast messages-->

    <string name="too_many_coffees">Nie można zamówić więcej niż 100 filiżanek kawy.</string>
    <string name="too_few_coffees">Nie można zamówić mniej niż 1 filiżankę kawy.</string>
@jellyblood

This comment has been minimized.

Copy link

commented Jan 26, 2017

Hi, I am having the issue where its not auto translating. When I go to Translate Editor the spanish/french lines are blank. it says next to Translate Editor to "Order a translation" do I have to pay to have code translated and added to app? or Rewrite code with translations myself?

@anshulkej001

This comment has been minimized.

Copy link

commented Jan 27, 2017


cats

Hi, guys I am having trouble in my main activity. Can someone please guide me how to solve this error.

@DimosKyth

This comment has been minimized.

Copy link

commented Jan 28, 2017

Here is the Greek xml

Μόνο Τζάβα
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="Name">Όνομα</string>

<!-- Extras Header [CHAR LIMIT=20] -->
<string name="toppings">Πρόσθετα</string>

<!-- Whipped Cream Topping [CHAR LIMIT=20] -->
<string name="Whipped_Cream">Σαντιγύ</string>

<!-- Chocolate Topping [CHAR LIMIT=20] -->
<string name="Chocolate">Σοκολάτα</string>

<!-- Quantity Header [CHAR LIMIT=20] -->
<string name="Quantity">Ποσότητα</string>

<!-- Order Button [CHAR LIMIT=20] -->
<string name="ORDER">ΠΑΡΑΓΓΕΛΙΑ</string>

<!-- Message displayed when the customer tries to request more than 100 coffees -->
<string name="too_many_coffees">Δεν μπορείτε να έχετε πάνω από 100 καφέδες.</string>

<!-- Message displayed when the customer tries to request less than 1 coffee -->
<string name="too_few_coffees">Δεν μπορείτε να έχετε λιγότερο από 1 καφέ.</string>

<!--
   Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
   user's name. [CHAR LIMIT=NONE]
 -->
<string name="order_summary_name">Όνομα <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">Προσθήκη Σαντυγής; <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">Προσθήκη Σοκολάτας; <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">Ποσότητα <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">Σύνολο <xliff:g id="price" example="10Euro">%d</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">Ευχαριστούμε!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">Παραγγελία για <xliff:g id="name" example="Amy">%s</xliff:g></string>
</resources>
@Ksorn

This comment has been minimized.

Copy link

commented Jan 30, 2017

Croatian translation, also there are added Strings for two Toast messages:

<resources xmlns:xliff="http://schemas.android.com/tools">
    <!-- Title for the application. [CHAR LIMIT=12] -->
    <string name="app_name">Samo Java</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="hint_name">Ime</string>

    <!--
      Chocolate topping for the order summary. It will be shown in the format of
      "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_chocolate">Dodaj čokoladu? <xliff:g example="true" id="stateTwo">%b</xliff:g></string>

    <!--
      Subject line for the order summary email. It will be in the format of
      "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_email_subject">Samo Java narudžba za: <xliff:g example="Amy" id="name">%s</xliff:g></string>

    <!--
      Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
      user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_name">Ime: <xliff:g example="Amy" id="name">%s</xliff:g></string>

    <!--
      Total price for the order summary. It will be shown in the format of
      "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_price">Ukupno: $<xliff:g example="10" id="price">%d</xliff:g></string>

    <!--
      Quantity of coffee cups for the order summary. It will be shown in the format of
      "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_quantity">Količina: <xliff:g example="2" id="quantity">%d</xliff:g></string>

    <!--
      Whipped cream topping for the order summary. It will be shown in the format of
      "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_whipped_cream">Dodaj šlag? <xliff:g example="true" id="stateOne">%b</xliff:g></string>

    <!--Toast effect-->
    <string name="string_100_coffes">Ne možete imati više od 100 kava.</string>

    <!--Toast effect-->
    <string name="string_1_coffee">Ne možete imati manje od 1 kave.</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="string_chocolate">Čokolada</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
    <string name="string_numbers_coffees">2</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="string_quantity">Količina</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="string_toppings">Preljevi</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="string_whipped_cream">Šlag</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="text_order">Narudžba</string>

    <!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
    <string name="thank_you">Hvala!</string>
</resources>
@IevaI

This comment has been minimized.

Copy link

commented Feb 4, 2017

Lithuanian XML

<string name="app_name">Tik Java</string>
<string name="name">Jūsų vardas</string>
<string name="toppings">Priedai</string>
<string name="whipped_cream">Plakta grietinėlė</string>
<string name="chocolate">Šokoladas</string>
<string name="quantity">Kiekis</string>
<string name="initial_quantity_value">2</string>
<string name="order">užsakyti</string>
<string name="order_summary_name">Vardas : <xliff:g id="name" example="Amy">%s</xliff:g></string>
<string name="order_summary_whipped_cream">Plakta grietinėlė ? <xliff:g id="addWhippedCream" example="taip">%b</xliff:g></string>
<string name="order_summary_chocolate">Šokoladas ? <xliff:g id="addChocolate" example="taip">%b</xliff:g></string>
<string name="order_summary_quantity">Kiekis : <xliff:g id="quantity" example="2">%d</xliff:g></string>
<string name="order_summary_price">Suma : <xliff:g id="price" example="10Eur">%d</xliff:g></string>
<string name="order_summary_email_subject">Tik Java užsakymas <xliff:g id="name" example="Amy">%s</xliff:g></string>
<string name="thank_you">Ačiū !</string>
<string name="max_order">Daugiausia galite užsakyti 100 puodelių kavos.</string>
<string name="min_order">Mažiausias užsakymas 1 puodelis kavos.</string>
@roger712

This comment has been minimized.

Copy link

commented Feb 5, 2017

We still have the toast messages and the boolean values to be translated.

@Liza-S

This comment has been minimized.

Copy link

commented Feb 11, 2017

My translation of the application into Russian.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Просто Java</string>
    <string name="addChocolate">Добавлен шоколад?</string>
    <string name="addWhippedCream">Добавлены взбитые сливки?</string>
    <string name="chocolate">Шоколад</string>
    <string name="order">Заказать!</string>
    <string name="quantity">Кол-во</string>
    <string name="thank_you">Спасибо за заказ! :)</string>
    <string name="toppings">Начинка</string>
    <string name="total">Стоимость: $</string>
    <string name="whipped_cream">Взбитые сливки</string>
    <string name="email">"Просто Java для "</string>
    <string name="minus_one">Вы не можете заказать меньше одной чашки кофе!</string>
    <string name="one_hundred">Вы не можете заказать больше ста чашек кофе!</string>
    <string name="name">Имя</string>
    <string name="order_summary_name">"Имя: "</string>
</resources>
@pommereh

This comment has been minimized.

Copy link

commented Feb 12, 2017

German with toast messages and boolean true/false replaced by strings
Deutsch

`

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Title for the application. [CHAR LIMIT=12] -->
<string name="app_name">Nur Kaffee</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">Name</string>

<!-- Header text for the list of toppings. [CHAR LIMIT=20] -->
<string name="toppings">Garnituren</string>

<!-- Text to display for whipped cream in the list of toppings [CHAR LIMIT=20] -->
<string name="whipped_cream">Sahnehaube</string>

<!-- Text to display for chocolate in the list of toppings [CHAR LIMIT=20] -->
<string name="chocolate">Schokostreusel</string>

<!-- Header text to display above the quantity pickers [CHAR LIMIT=20] -->
<string name="quantity">Anzahl</string>

<!-- Number to display in side the quantity picker [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>

<!-- Text to display in the order Button [CHAR LIMIT=20] -->
<string name="order">Bestellen</string>

<!-- Header text for the order summary. [CHAR LIMIT=20] -->
<string name="order_summary">Zusammenfassung</string>

<!-- Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
user's name. [CHAR LIMIT=NONE] -->
<string name="order_summary_name">Name: <xliff:g example="Amy" id="name">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? yes" or "Add whipped cream? no". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">Sahnehaube hinzufügen? <xliff:g id="addWhippedCream" example="no">%s</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? yes" or "Add chocolate? no". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">Schokostreusel hinzufügen? <xliff:g id="addChocolate" example="no">%s</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">Anzahl: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">Gesamtpreis: $<xliff:g id="price" example="10">%s</xliff:g></string>

<!-- Initial value for Total price for the order summary. [CHAR LIMIT=NONE] -->
<string name="order_summary_price_initial">Gesamtpreis: $10</string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">Danke!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">Nur Kaffee Bestellung für <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!-- String to use instead of the boolean value true. [CHAR LIMIT=10] -->
<string name="strtrue">ja</string>

<!-- String to use instead of the boolean value false. [CHAR LIMIT=10] -->
<string name="strfalse">nein</string>

<!-- String to use in a toast message if the maximum allowed amount is exceeded. [CHAR LIMIT=45] -->
<string name="toast_msg_max_quantity_exceeded">Maximum sind 100 Kaffee pro Bestellung</string>

<!-- String to use in a toast message if the miniimum allowed amount is exceeded. [CHAR LIMIT=45] -->
<string name="toast_msg_min_quantity_exceeded">Minimum ist ein Kaffee pro Bestellung</string>

`

@asj7mig

This comment has been minimized.

Copy link

commented Feb 16, 2017

im still getting the %s with the name and also with all the other values such as Ass Whipped cream? %btrue etc. can anyone please point me in what am i doing wrong

@UrbanLegend1

This comment has been minimized.

Copy link

commented Feb 21, 2017

hi their @asj7mig , add the haswhippedCream parameter inside the method like this --> getString(R.string.order_summary_whipped_cream, hasWhippedCream) , another example priceDetails += "\n" + getString(R.string.order_summary_chocolate, hasChocolate) ;
since in strings file you gave %s so it's expecting some information their ,so you need it to put it inside the bracket . Took me quite a while too to solve this :) Hope this helps.

@asj7mig

This comment has been minimized.

Copy link

commented Feb 22, 2017

thy very much for your response UrbanLegend1 i did as you said but when i do this i get an error when i include the addWhipedCream for example or the name in the parenthesis that is why i had it outside the parenthesis and added it with the plus sine .
capture
that's a problem i keep having and i m a bit lost if you could help i would really appreciate it

@anujajfox

This comment has been minimized.

Copy link

commented Feb 24, 2017

/** XML FILE - Hindi ( India ) **/


नाम
उपरी परत
फेटी हुई मलाई
चॉकलेट
मात्रा
1
आदेश करे
नाम: <xliff:g id="name" example="Amy">%s</xliff:g>
क्रीम जोड़ें? <xliff:g id="addWhippedCream" example="true">%b</xliff:g>
चॉकलेट जोड़ें ? <xliff:g id="addChocolate" example="true">%b</xliff:g>
मात्रा: <xliff:g id="quantity" example="2">%d</xliff:g>
कुल: <xliff:g id="price" example="$10">%s</xliff:g>
धन्यवाद!
केवल जावा आदेश करे <xliff:g id="name" example="Amy">%s</xliff:g>

/** XML FILE -English **/


Just Java
Topping
1
Thank You
Name
Whipped Cream
Chocolate
Quantityा
Order
Name <xliff:g id="name" example="Amy">%s</xliff:g>
Quantity <xliff:g id="addWhippedCream" example="true">%b</xliff:g>
Quantity <xliff:g id="addChocolate" example="true">%b</xliff:g>
Quantity: <xliff:g id="quantity" example="2">%d</xliff:g>
Total: <xliff:g id="price" example="$10">%s</xliff:g>
Just Java Order <xliff:g id="name" example="Amy">%s</xliff:g>

/** JAVA FILE - Only One ( Common for all language) **/

/**

  • Add your package below. Package name can be found in the project's AndroidManifest.xml file.
  • This is the package name our example uses:
  • package com.example.android.justjava;
    */
    package com.example.android.justjava;
    import android.content.Intent;
    import android.net.Uri;
    import android.os.Bundle;
    import android.preference.CheckBoxPreference;
    import android.support.v7.app.AppCompatActivity;
    import android.util.Log;
    import android.view.View;
    import android.widget.CheckBox;
    import android.widget.EditText;
    import android.widget.TextView;
    import android.widget.Toast;

import java.text.NumberFormat;

/**

  • This app displays an order form to order coffee.
    */
    public class MainActivity extends AppCompatActivity {

    int quantity=1;

    @override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    }

    /**

    • This method is called when the plus button is clicked.
      */
      public void increment(View view) {
      if(quantity==100){
      Toast.makeText(this, "You Can't Order More Than 100 Coffees", Toast.LENGTH_SHORT).show();
      return;
      }

      quantity=quantity+1;
      displayQuantity(quantity);
      }

    /**

    • This method is called when the plus button is clicked.
      */
      public void decrement(View view) {
      if (quantity==1){
      Toast.makeText(this, "You Can't Order Less Than 1 Coffees", Toast.LENGTH_SHORT).show();
      return;
      }

      quantity=quantity-1;
      displayQuantity(quantity);
      }

    /**

    • This method is called when the order button is clicked.
      */
      public void submitOrder(View view) {
      CheckBox WhippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream_checkbox);
      boolean hasWhippedCream = WhippedCreamCheckBox.isChecked();

      CheckBox ChocolateCheckBox = (CheckBox) findViewById(R.id.chocolate_checkbox);
      boolean hasChocolate = ChocolateCheckBox.isChecked();

      EditText eText = (EditText) findViewById(R.id.edit_text);
      String str = eText.getText().toString();

      int price=calculatePrice(hasWhippedCream,hasChocolate);
      String pricemsg= createOrderSummary(str,price,hasWhippedCream,hasChocolate,str);
      Intent intent = new Intent(Intent.ACTION_SENDTO);
      intent.setData(Uri.parse("mailto:")); // only email apps should handle this
      intent.putExtra(Intent.EXTRA_SUBJECT,getString(R.string.order_summary_email_subject, str));
      intent.putExtra(Intent.EXTRA_TEXT, pricemsg) ;
      if (intent.resolveActivity(getPackageManager()) != null) {
      startActivity(intent);
      }

    }

    private int calculatePrice(boolean addCream, boolean addChocolate){
    int baseprice=5;
    if (addCream)
    {
    baseprice=baseprice+1;
    }
    if (addChocolate)
    {
    baseprice=baseprice+2;
    }
    return quantity*baseprice;

    }

    private String createOrderSummary(String name, int price, boolean addwhippedcream, boolean addchocolate, String addtext){
    String priceMessage= getString(R.string.order_summary_name, name);
    priceMessage += "\n" +getString(R.string.order_summary_whipped_cream, addwhippedcream);
    priceMessage += "\n" +getString(R.string.order_summary_chocolate, addchocolate);
    priceMessage += "\n" +getString(R.string.order_summary_quantity, quantity);
    priceMessage += "\n" +getString(R.string.order_summary_price, NumberFormat.getCurrencyInstance().format(price));
    priceMessage += "\n" +getString(R.string.thank_you);
    return priceMessage;
    }
    /**

    • This method displays the given quantity value on the screen.
      */
      private void displayQuantity(int number) {
      TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);
      quantityTextView.setText("" + number);
      }

}

/** Activity FILE - Common for all language **/

<LinearLayout

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.android.justjava.MainActivity">

    <EditText
        android:id="@+id/edit_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:hint="Name"
        android:inputType="textCapWords" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:text="@string/toppings"
        android:textAllCaps="true" />

    <CheckBox
        android:id="@+id/whipped_cream_checkbox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/whipped_cream"
        android:paddingLeft="16dp"
        android:layout_marginBottom="16dp"
        android:textAppearance="?android:textAppearanceMedium" />

    <CheckBox
        android:id="@+id/chocolate_checkbox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/chocolate"
        android:paddingLeft="16dp"
        android:layout_marginBottom="16dp"
        android:textAppearance="?android:textAppearanceMedium" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:text="@string/quantity"
        android:textAllCaps="true" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="10sp">

        <Button
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_toLeftOf="@+id/quantity_text_view"
            android:onClick="decrement"
            android:text="-" />

        <TextView
            android:id="@+id/quantity_text_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="8dp"
            android:paddingRight="8dp"
            android:text="@string/initial_quantity_value"
            android:textColor="@android:color/black"
            android:textSize="16sp" />

        <Button
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_toRightOf="@+id/quantity_text_view"
            android:onClick="increment"
            android:text="+" />

    </LinearLayout>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:onClick="submitOrder"
        android:text="@string/order" />



</LinearLayout>
@EgonSaks

This comment has been minimized.

Copy link

commented Feb 25, 2017

@asj7mig

"im still getting the %s with the name and also with all the other values such as Ass Whipped cream? %btrue etc. can anyone please point me in what am i doing wrong"

Even though you asked 9 days ago then I had the same problem and was looking a solution from here, and tried to do all what was recommended here. Still, it didn't help till I suddenly fond my typo and was able to fix it. So I put my journey about finding the typo here just for the future for someone who could save a time while maybe facing the same problem like many of us here.

check that you write on the top of the strings.xml

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

         .... some strings and code here...

</resources>

without spelling mistakes. I had document written documnet at the end of the line. To find and notice it that took me like 2h rereading and testing till discovered it.

@alla97

This comment has been minimized.

Copy link

commented Feb 27, 2017

In order to translate the boolean variables I've created a new strings that gets its value from a conditional loop with the booleans .So I've added in the submitOrder, after the booleans get value from the isChecked() method and in the values\strings.xml:

String chocolate;
String whippedCream;
if(hasChocolate) chocolate = getString(R.string.boolean_true);
else chocolate = getString(R.string.boolean_false);
if(hasWhippedCream) whippedCream = getString(R.string.boolean_true);
else whippedCream = getString(R.string.boolean_false);
<string name="boolean_true">Yes</string>
<string name="boolean_false">No</string>

-----Bulgarian translation-----

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="http://schemas.android.com/tools">
    <string name="app_name">Просто Java</string>
    <string name="add_chocolate">Добави шоколад? <xliff:g id="chocolate" example="yes">%s</xliff:g></string>
    <string name="add_whipped_cream">Добави бита сметана? <xliff:g id="whipped_cream" example="yes">%s</xliff:g></string>
    <string name="boolean_false">Не</string>
    <string name="boolean_true">Да</string>
    <string name="chocolate">Шоколад</string>
    <string name="name">Име</string>
    <string name="name_summary">Име: <xliff:g id="nameOrder" example="Amy">%s</xliff:g></string>
    <string name="order">Поръчка</string>
    <string name="price">Общо: <xliff:g id="price" example="5">%s</xliff:g></string>
    <string name="quantity">Количество</string>
    <string name="quantity_summary">Количество: <xliff:g id="quantity" example="5">%s</xliff:g></string>
    <string name="thank">Благодаря!</string>
    <string name="toppings">Добавки</string>
    <string name="whipped_cream">Бита сметана</string>
    <string name="toastDecrease">Не можете да поръчате по-малко от 1 кафе</string>
    <string name="toastIncrease">Не можете да поръчате повече от 100 кафета</string>
</resources>
/**
     * Create a summary of the order.
     *
     * @param name is the name of the customer
     * @param orderPrice is the price of the order
     * @param whippedCream stores if the user wants whipped cream topping
     * @param chocolate stores if the user wants chocolate topping
     * @return text summary
     */
    private String createOrderSummary(String name, int orderPrice, String whippedCream, String chocolate){
        String price = NumberFormat.getCurrencyInstance().format(orderPrice);
        String priceMessage = getString(R.string.name_summary, name);
        priceMessage += "\n" + getString(R.string.add_whipped_cream, whippedCream);
        priceMessage += "\n" + getString(R.string.add_chocolate, chocolate);
        priceMessage += "\n" + getString(R.string.quantity_summary, valueOf(quantity));
        priceMessage += "\n" + getString(R.string.price, price);
        priceMessage += "\n" + getString(R.string.thank);
        return priceMessage;
    }
/**
     * This method is called when the order button is clicked.
     */
    public void submitOrder(View view) {
        EditText editText = (EditText) findViewById(R.id.name);
        String name = editText.getText().toString();
        //Figure out if the user wants whipped cream topping
        CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.checkbox1);
        boolean hasWhippedCream = whippedCreamCheckBox.isChecked();
        //Figure out if the user wants chocolate topping
        CheckBox chocolateCheckBox = (CheckBox) findViewById(R.id.checkbox2);
        boolean hasChocolate = chocolateCheckBox.isChecked();

        String chocolate;
        String whippedCream;
        if(hasChocolate) chocolate = getString(R.string.boolean_true);
        else chocolate = getString(R.string.boolean_false);
        if(hasWhippedCream) whippedCream = getString(R.string.boolean_true);
        else whippedCream = getString(R.string.boolean_false);
        int price = calculatePrice(hasWhippedCream, hasChocolate);
        String priceMessage = createOrderSummary(name,price,whippedCream,chocolate);

        Intent intent = new Intent(Intent.ACTION_SENDTO);
        intent.setType("*/*");
        intent.setData(Uri.parse("mailto:"));
        intent.putExtra(Intent.EXTRA_SUBJECT, "JustJava ordered for " + name);
        intent.putExtra(Intent.EXTRA_TEXT,priceMessage);
        if(intent.resolveActivity(getPackageManager()) != null){
            startActivity(intent);
        }
    }
/**
     * This method is called when the plus button is clicked.
     */
    public void increment(View view){
        if(quantity == 100) {
            Toast.makeText(this, getString(R.string.toastIncrease), Toast.LENGTH_SHORT).show();
            return;
        }
        quantity = quantity + 1;
        displayQuantity(quantity);

    }

    /**
     * This method is called when the minus button is clicked.
     */
    public void decrement(View view){
        if(quantity == 1) {
            Toast.makeText(this, getString(R.string.toastDecrease), Toast.LENGTH_SHORT).show();
            return;
        }
        quantity = quantity - 1;
        displayQuantity(quantity);
    }
@monikootza

This comment has been minimized.

Copy link

commented Feb 28, 2017

My createOrderSummary includes some if conditions that show the Yes/No instead of true or false:

 public String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate, String userName) {
        String priceMessage = getString(R.string.name) + ": " + userName;
        priceMessage += "\n" + getString(R.string.quantity) + ": " + quantity;
        priceMessage += "\n" + getString(R.string.add_topping) + getString(R.string.whipped_cream); /*+ addWhippedCream;*/
        if (addWhippedCream) {
            priceMessage += getString(R.string.yes);
            } else priceMessage += getString(R.string.no);
        priceMessage += "\n" + getString(R.string.add_topping) + getString(R.string.chocolate); /*+ addChocolate;*/
        if (addChocolate) {
            priceMessage += getString(R.string.yes);
            } else priceMessage += getString(R.string.no);
        priceMessage += "\n" + getString(R.string.total) + price;
        priceMessage += "\n" + getString(R.string.thank_you);
        return priceMessage;
    }

----Romanian version of the strings.xml-----

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">Doar Java</string>
    <string name="action_settings">Setări</string>
    <string name="add_topping">"Adaugă "</string>
    <string name="chocolate">"Ciocolată "</string>
    <string name="hello_world">Bună lume!</string>
    <string name="name">Nume</string>
    <string name="no">Nu</string>
    <string name="yes">Da</string>
    <string name="order">Comandă</string>
    <string name="order_sbj">Comanda Doar Java pentru:</string>
    <string name="quantity">Cantitate</string>
    <string name="thank_you">Mulţumesc</string>
    <string name="toppings">Topinguri</string>
    <string name="total">"Total $: "</string>
    <string name="whipped_cream">"Frişcă "</string>
    <string name="initial_quantity_value">2</string>
    <string name="order_summary_toppings">\"Adaugă <xliff:g id="toppings" example="Frişcă">%s</xliff:g> \"</string>
    <string name="order_summary_name">Nume: <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="too_many">Aţi selectat prea multe cafele!</string>
    <string name="below_one">Nu puteţi comanda 0 cafele!</string>
</resources>
@solitarian

This comment has been minimized.

Copy link

commented Mar 3, 2017

I would suggest a more generic solution that displays the strings Yes or No for the english version and the corresponding tanslation for all languages you want to support through the use of the ternary operator.
To implement this do the following:

1. In string.xml file go and change the formatted string order_summary_whipped_cream to accept a String value instead of boolean value. That is: <xliff:g id=etc...>%b</xliff:g> becomes <xliff:g id=etc...>%s</xliff:g>. Repeat the same for order_summary_chocolate string. So final code is:

<string name="order_summary_whipped_cream">Add whipped cream? <xliff:g id="addWhippedCream" example="true">%s</xliff:g></string>

<string name="order_summary_chocolate">Add chocolate? <xliff:g id="addChocolate" example="true">%s</xliff:g></string>

2. In string.xml file add 2 more strings for Yes and No like this:

<string name="yes">Yes</string>
<string name="no">No</string>

3. Open Translation Editor and first make sure that the <xliff:g id=etc...>%s</xliff:g> part of the order_summary_whipped_cream and order_summary_chocolate are identical for all languages you decide to support like this:
English:
Add whipped cream? <xliff:g id="addWhippedCream" example="true">%s</xliff:g>
Italian (or your language(s) of choice):
Aggiunta panna montata: <xliff:g id="addWhippedCream" example="true">%s</xliff:g>

then provide the tranlations for the yes and no strings for all languages (for example Italian and/or French, and/or Spanish etc.):
<string name="yes">Si</string>
<string name="no">No</string>

4. In MainActivity.java file change the createOrderSummary function like this:

private String createOrderSummary(int price, boolean addWhippedCream,
boolean addChocolate, String customerName) {
String priceMessage = getString(R.string.order_summary_name, customerName);
priceMessage += "\n" + getString(R.string.order_summary_whipped_cream, (addWhippedCream? getString(R.string.yes) : getString(R.string.no)));
priceMessage += "\n" + getString(R.string.order_summary_chocolate, (addChocolate? getString(R.string.yes) : getString(R.string.no)));
priceMessage += "\n" + getString(R.string.order_summary_quantity, quantity);
priceMessage += "\n" + getString(R.string.order_summary_price,
NumberFormat.getCurrencyInstance().format(price));
priceMessage += "\n" + getString(R.string.thank_you);
return priceMessage;
}

In the code snippet above in fourth and fifth lines I've used the ternary operator also called the conditional operator as follows:

(addWhippedCream? getString(R.string.yes) : getString(R.string.no))
(addChocolate? getString(R.string.yes) : getString(R.string.no))

If the first operand (the condition) i.e. addWhippedCream is true the second operand i.e getString(R.string.yes) will be returned, otherwise, if the condition addWhippedCream is false, the third operand: getString(R.string.no) will be returned and the system will pick the right translation for any language that is set as default on the device.

@missus

This comment has been minimized.

Copy link

commented Mar 12, 2017

To translate true and false I add two new strings to my xaml, modify the strings for the whipped cream and for the chocolate , add a new method to the MainActivity to translate the boolean values to strings, and modify the createOrderSummary method:

  <string name="add_whipped_cream">Tejszínhabbal? <xliff:g id="addWhipped" example="Yes.">%s</xliff:g>  </string>
  <string name="add_chocolate">Csokoládéval? <xliff:g id="addChocolate" example="No.">%s</xliff:g>  </string>    
  <string name="yes">Igen.</string>
  <string name="no">Nem.</string>
 public String boolToString(boolean bool) {
        return bool ? getString(R.string.yes) : getString(R.string.no);
 }
   summary += "\n" + getString(R.string.add_whipped_cream, boolToString(addWhipped));
   summary += "\n" + getString(R.string.add_chocolate, boolToString(addChocolate));
@missus

This comment has been minimized.

Copy link

commented Mar 12, 2017

The hungarian version:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Title for the application. [CHAR LIMIT=12] -->
    <string name="app_name">Csak Java</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="name">Név</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="toppings">Feltétek</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="whipped_cream">Tejszínhab</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="chocolate">Csokoládé</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="quantity">Mennyiség</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
    <string name="initial_quantity_value">2</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="order">Rendelés</string>

    <!--
      Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
      user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_name">Név: <xliff:g id="name" example="Amy">%s</xliff:g></string>

    <!--
      Whipped cream topping for the order summary. It will be shown in the format of
      "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_whipped_cream">Tejszínhabbal? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

    <!--
      Chocolate topping for the order summary. It will be shown in the format of
      "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_chocolate">Csokoládéval? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

    <!--
      Quantity of coffee cups for the order summary. It will be shown in the format of
      "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_quantity">Mennyiség: <xliff:g id="quantity" example="2">%d</xliff:g></string>

    <!--
      Total price for the order summary. It will be shown in the format of
      "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_price">Összesen: <xliff:g id="price" example="$10">%s</xliff:g></string>

    <!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
    <string name="thank_you">Köszönöm.</string>

    <!--
      Subject line for the order summary email. It will be in the format of
      "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_email_subject">Csak Java rendelés - <xliff:g id="name" example="Amy">%s</xliff:g></string>
</resources>
@furtadorebeca

This comment has been minimized.

Copy link

commented Mar 22, 2017

@Yunyopern @tahseenbokhari
You had this question a long time ago, hope you already found out how to resolve it. If not, this is what was causing the % to show in your app. You probably had something like this:
String message =
getString(R.string.order_summary_name) + customerName +
"\n" + getString(R.string.order_summary_whipped_cream) + hasWhippedCream
if you insert the variable names inside the getString method as a second parameter, it will resolve the issue. Here's how it should look like:
String message =
getString(R.string.order_summary_name, customerName) +
"\n" + getString(R.string.order_summary_whipped_cream, hasWhippedCream) +

@dleto

This comment has been minimized.

Copy link

commented Apr 1, 2017

Hello Friends! All your contributions are really exciting, so many languages, one app!
Here is my contribution to Albanian translation with some extras such as the true / false translation and the text of the toasts on increment or decrement warning!

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Title for the application. [CHAR LIMIT=12] -->
<string name="app_name">Vetëm Java</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">Emrin</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">Përbërësit</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">Krem të rrahur</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">Çokollatë</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">Sasi</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">Porosi</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">Emrin: <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">Shto krem të rrahur? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">Shto çokollatë? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">Sasi: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">Shumë: <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">Faleminderit!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">Vetëm Java për <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!-- String to use instead of the boolean value true. [CHAR LIMIT=10] -->
<string name="strtrue">Po</string>

<!-- String to use instead of the boolean value false. [CHAR LIMIT=10] -->
<string name="strfalse">Jo</string>

<!-- String to use in a toast message if the maximum allowed amount is exceeded. [CHAR LIMIT=60] -->
<string name="increment_error">Ju nuk mund të keni më shumë se 100 kafe!</string>

<!-- String to use in a toast message if the miniimum allowed amount is exceeded. [CHAR LIMIT=60] -->
<string name="decrement_error">Unë mund të shoh që ju keni nevojë për një kafe, të paktën!</string>
</resources>
@Rodons

This comment has been minimized.

Copy link

commented Apr 2, 2017

Hi everyone!
Here is my translation in Catalan! Hope you enjoy it!

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Application layout [CHAR LIMIT=12] -->
    <string name="app_name">Només Java</string>
    <string name="quantity">Quantitat</string>
    <string name="order">Demanar</string>
    <string name="name">Nom</string>
    <string name="initial_quantity_value">2</string>
    
    
    <!-- Toppings' translation [CHAR LIMIT=20] -->
    <string name="toppings">Ingredients</string>
    <string name="chocolate">Chocolata</string>
    <string name="whipped_cream">Nata Montada</string>
    
    <!-- Order Summary] -->
    <string name="thank_you">Gràcies!</string>
    <string name="order_summary_whipped_cream">Afegir nata montada?</string>
        <string name="order_summary_quantity">Quantitat: <xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_summary_price">Total: <xliff:g id="price" example="$10">%s</xliff:g></string>
    <string name="order_summary_name">Nom: <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary_email_subject">App només java per <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary_chocolate">Afegir chocolata? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

    <!-- Message displayed when the customer tries to request more than 100 coffees -->
    <string name="too_many_coffees">No pots demanar més de 100 cafés.</string>

    <!-- Message displayed when the customer tries to request less than 1 coffee -->
    <string name="too_few_coffees">No es pot demanar menys de 1 café.</string>
    
</resources>
@mmo2612

This comment has been minimized.

Copy link

commented Apr 6, 2017

Hi
Below my polish translation

<string name="app_name">Just Java</string>
<string name="name">Imię</string>
<string name="quantity_field">Ilość</string>
<string name="thank_you">Dziękujemy za zamówienie.</string>
<string name="order">Zamów</string>
<string name="toppings">Dodatki</string>
<string name="whipped_cream">Bita śmietana</string>
<string name="chocolate">Czekolada</string>
<string name="order_summary">Podsumowanie</string>

<string name="order_summary_name">Imię: <xliff:g id="name" example="Ania">%s</xliff:g></string>
<string name="order_summary_chocolate">Z czekoladą? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
<string name="order_summary_total">Razem: <xliff:g id="totalPrice" example="$10">%d</xliff:g></string>
<string name="order_summary_quantity">Ilość: <xliff:g id="quantity" example="2">%d</xliff:g></string>
<string name="order_summary_whipped_cream">Z bitą śmietaną? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
@davidpinto1979

This comment has been minimized.

Copy link

commented Apr 6, 2017

Great! Gonna do that for Portuguese of Portugal! :D

@EspenBrun

This comment has been minimized.

Copy link

commented Apr 12, 2017

@Cascascap that's an awesome shortcut!

@menelaoszetas1990

This comment has been minimized.

Copy link

commented Apr 12, 2017

The Greek version guys:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">Παραγγελία καφέ</string>
<string name="name">Όνομα</string>
<string name="toppings">Πρόσθετα</string>
<string name="whipped_cream">Αφρόγαλο</string>
<string name="chocolate">Σοκολάτα</string>
<string name="quantity">Ποσότητα</string>
<string name="order">Παραγγείλτε</string>
<string name="order_summary_name">Όνομα: <xliff:g id="name" example="Amy">%s</xliff:g></string>
<string name="order_summary_whipped_cream">Προσθήκη αφρόγαλου: <xliff:g id="addWhippedCream" example="true">%b</xliff:g>
    </string>
<string name="order_summary_chocolate">Προσθήκη σοκολάτας: <xliff:g id="addChocolate" example="true">%b</xliff:g></string>
<string name="order_summary_quantity">Ποσότητα: <xliff:g id="quantity" example="2">%d</xliff:g></string>
<string name="order_summary_price">Τελική τιμή: <xliff:g id="price" example="$10">%s</xliff:g></string>
<string name="thank_you">Ευχαριστούμε</string>
<string name="order_summary_email_subject">Παραγγελία καφέ <xliff:g id="name" example="Amy">%s</xliff:g></string>
</resources>
@serdox

This comment has been minimized.

Copy link

commented May 21, 2017

i have issues understanding the %s, %d %1$s placeholders in the xliff tags. why exactly is there an s or d for example? did i miss something or is that arbitrarily, meaning chosen as we like?

@geekbae

This comment has been minimized.

Copy link

commented Jun 20, 2017

Turkish

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Title for the application. [CHAR LIMIT=12] -->
    <string name="app_name">Sadece JAVA</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="name">İsim</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="toppings">Süslemeler</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="whipped_cream">Kremşanti</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="chocolate">Çikolata</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="quantity">Adet</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
    <string name="initial_quantity_value">2</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="order">Sipariş</string>

    <!--
      Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
      user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_name">İsim: <xliff:g id="name" example="Amy">%s</xliff:g></string>

    <!--
      Whipped cream topping for the order summary. It will be shown in the format of
      "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_whipped_cream">Sipariş özeti Kremsanti  <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

    <!--
      Chocolate topping for the order summary. It will be shown in the format of
      "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_chocolate">Sipariş özeti Cikolata <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

    <!--
      Quantity of coffee cups for the order summary. It will be shown in the format of
      "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_quantity">Adet: <xliff:g id="quantity" example="2">%d</xliff:g></string>

    <!--
      Total price for the order summary. It will be shown in the format of
      "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_price">Toplam: <xliff:g id="price" example="$10">%s</xliff:g></string>

    <!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
    <string name="thank_you">Tesekkurler</string>

    <!--
      Subject line for the order summary email. It will be in the format of
      "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_email_subject">Sipariş özetiniz<xliff:g id="name" example="Amy">%s</xliff:g></string>
</resources>
@arumaibright

This comment has been minimized.

Copy link

commented Jun 21, 2017

Guys I just coded the strings to the strings.xml file and now when I run the app, I can't see the order summary in the email body... so sad... can someone help?

@nocturnoAkaMylo

This comment has been minimized.

Copy link

commented Jul 18, 2017

@arumaibright ... can I see your code?

@AchillesFirstStand

This comment has been minimized.

Copy link

commented Sep 15, 2017

@furtadorebeca . Thank you, that solved my issue with %'s showing.

@nijoj

This comment has been minimized.

Copy link

commented Oct 1, 2017

മലയാളം(Malayalam) :-P, മലയാളം ഇല്ലാതെ എവിടെ പോകാൻ......

<string name="app_name">ചായ മാത്റം</string>
<string name="name">പേര്</string>
<string name="chocolate">ചോക്കളെറ്റ്</string>
<string name="initial_quantity_value">2</string>
<string name="order">വാങ്ങുക</string>
<string name="whipped_cream">ക്റീം</string>
<string name="toppings">കൂടെ</string>
<string name="thank_you">നന്നി</string>
<string name="quantity">എണ്ണം</string>
<string name="order_summary_chocolate">ചോക്കളെറ്റ് വേണോ?,<xliff:g id="addChocolate" example="true">%b</xliff:g></string>
<string name="order_summary_email_subject"><xliff:g id="name" example="Amy">%s</xliff:g>ക്ക് ചായ</string>
<string name="order_summary_name">പേര്: <xliff:g id="name" example="Amy">%s</xliff:g></string>
<string name="order_summary_price">വില <xliff:g id="price" example="$10">%s</xliff:g></string>
<string name="order_summary_quantity">എണ്ണം <xliff:g id="quantity" example="2">%d</xliff:g></string>
<string name="order_summary_whipped_cream">ക്റീം ?,<xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
@laysz

This comment has been minimized.

Copy link

commented Oct 4, 2017

Japanese :)

Just Java 2 チョコレート 名前 注文 数 ありがとう 具 ホイップクリーム
<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">ホイップクリーム? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">チョコレート? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">数: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">合計: <xliff:g id="price" example="$10">%s</xliff:g></string>


<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">コーヒー <xliff:g id="name" example="Amy">%s</xliff:g></string>
@SuyashD95

This comment has been minimized.

Copy link

commented Oct 8, 2017

This is my version of the Spanish strings.xml file with proper comments.... I have made certain modifications in my JustJava app and hence, the difference between my version and the one posted in this gist.
`

<!-- Strings for AndroidManifest.xml -->

<!-- Title of the app [CHAR LIMIT=12] -->
<string name="app_name">Sólo Java</string>

<!-- Strings for activity_main.xml -->

<!-- Header text for Quantity [CHAR LIMIT=20] -->
<string name="quantity">Cantidad</string>

<!-- Initial value of the Quantity field [NON TRANSLATABLE] -->
<string name="initial_quantity_number" translatable="false">2</string>

<!-- Text inside the 'Order' button [CHAR LIMIT=20] -->
<string name="order">Ordenar</string>

<!-- The 'plus' symbol shown inside the 'Increment' button [NON TRANSLATABLE] -->
<string name="increment" translatable="false">+</string>

<!-- The 'minus' symbol shown inside the 'Decrement' button [NON TRANSLATABLE] -->
<string name="decrement" translatable="false">-</string>

<!-- Text associated with the checkbox for 'Whipped Cream' topping [CHAR LIMIT=20] -->
<string name="topping_whipped_cream">Crema Batida</string>

<!-- Header text for Toppings [CHAR LIMIT=20] -->
<string name="toppings">Ingredientes</string>

<!-- Text associated with the checkbox for 'Chocolate' topping [CHAR LIMIT=20] -->
<string name="topping_chocolate">Chocolate</string>

<!-- Hint text displayed in the empty text field for the user's name [CHAR LIMIT=20] -->
<string name="hint_name">Nombre</string>

<!-- Strings for MainActivity.java -->

<!--
    Toast message when the user reaches the maximum limit of number of coffees that
    can be ordered (100) and clicks the 'Increment' button. [CHAR LIMIT=NONE]
 -->
<string name="toast_increment">No puedes tener más de 100 cafés</string>

<!--
    Toast message when the user reaches the minimum limit of number of coffees that
    can be ordered (1) and clicks the 'Decrement' button. [CHAR LIMIT=NONE]
 -->
<string name="toast_decrement">No puedes tener menos de 1 café</string>

<!--
    Subject line for the order summary email. It will be shown in the format of
    "Just Java for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
 -->
<string name="order_summary_email_subject">Sólo Java para <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">Nombre: <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!-- Displays 'True' in case a user has checked a particular topping checkbox [CHAR LIMIT=NONE] -->
<string name="text_true">Cierto</string>

<!-- Displays 'False' in case a user has not checked a particular topping checkbox [CHAR LIMIT=NONE] -->
<string name="text_false">Falso</string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add  Whipped Cream? " [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">\nAgregue La Crema Batida? %s</string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add Chocolate? " [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">\nAgregue El Chocolate? %s</string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">\nCantidad: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">\nTotal: $<xliff:g id="price" example="$10">%d</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="text_thank_you">\n¡Gracias!</string>

`

@PhoenixA

This comment has been minimized.

Copy link

commented Nov 21, 2017

I can't understand what the problem is when I use this code:
in strings. xml
Total: <xliff:g id="price" example="$10">%s</xliff:g>

and in MainActivity.java
priceMessage += "\n" + getString(R.string.total, price);

It shows me an error: Format string "total" is not valid format string so it should not be passed to String.format

What did I do wrong?

@MartinSima

This comment has been minimized.

Copy link

commented Nov 24, 2017

There you have a Czech version, enjoy.
I migh have a different names sometimes

`

<string name="app_name">CofeeOrder</string>
<string name="name">Jméno</string>
<string name="Topping">poleva</string>
<string name="Whipped_Cream">šlehačka</string>
<string name="Chocolate">čokoláda</string>
<string name="Quantity">množství</string>
<string name="Order_Summary">Souhrn objednávky</string>
<string name="Order">objednat</string>
<string name="cofee_order">Objednávka kávy</string>
<string name="min_coffee_toast">Minimální objednávka je jedna káva</string>
<string name="max_coffee_toast">Maximální objednávka kávy je 100</string>


<!--Order Summary text-->
<string name="order_summary_name">Jméno: <xliff:g id="name" example="Amy">%s</xliff:g></string>

<string name="order_whipped_cream">Šlehačka: <xliff:g id="hasWhippedCream" example="true">%b</xliff:g></string>

<string name="order_chocolate">Čokoláda: <xliff:g id="hasChocolate" example="true">%b</xliff:g></string>

<string name="order_quantity">"Množství: "<xliff:g id="quantity" example="2">%d</xliff:g></string>

<string name="order_total_price">Celková cena: <xliff:g id="price" example="$15">%s</xliff:g></string>

<string name="thank_you">Děkujeme Vám!</string>

<string name="order_email_subject">Objednávka kávy <xliff:g id="name" example="Amy">%s</xliff:g></string>

`

@nilymar

This comment has been minimized.

Copy link

commented Nov 24, 2017

Here is the Hebrew version (change the name of the app the just coffee in Hebrew because it sounds better:

<string name="app_name">רק-קפה</string>
<string name="name_field">שם</string>
<string name="toppings">תוספות</string>
<string name="whipped_cream">קצפת</string>
<string name="chocolate">שוקולד</string>
<string name="quantity">כמות</string>
<string name="order">הזמנה</string>
<string name="order_summary_name">שם: <xliff:g id="שם" example="דוד">%s</xliff:g></string>
<string name="order_summary_whipped_cream">"להוסיף קצפת? "</string>
<string name="order_summary_chocolate">"להוסיף שוקולד? "</string>
<string name="order_summary_quantity">"כמות: "</string>
<string name="order_summary_total">"סה"כ: "</string>
<string name="thank_you">תודה רבה!</string>
<string name="order_summary_email_subject">הזמנה של רק-קפה בשביל </string>
<string name="order_bottom_limit">אי אפשר להזמין פחות מכוס אחת !!!</string>
<string name="order_top_limit">אי אפשר להזמין יותר מ-100 כוסות !!!</string>
@Tashachan

This comment has been minimized.

Copy link

commented Nov 29, 2017

Hello! I'm having some issues with the >%s<.
I understand that if its a string you can use %s
for booleans %b
but what should I use for numbers?

Edit: ok for exemple:
This xml,

<!--
      Total price for the order summary. It will be shown in the format of
      "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_price">Total: <xliff:g id="price" example="$10">%s</xliff:g></string>

This one was matching this java,
priceMessage += "\n" + getString(R.string.order_summary_price, price);
and this last price); was showing an error.

After reading it a bit on detail it said that because price is int I should use %d %o or %x.
As %d it didn't work but as %o yes.

I hope this is helpful for someone.

@CodeRistka

This comment has been minimized.

Copy link

commented Dec 1, 2017

I had that problem with %b, %s too.
I just remove tag <xliff:g id="price" example="$10">%s</xliff:g> from strings.xml, because "Total" should be translated.
We use <xliff:g >%s</xliff:g> only for item which should NOT be translated, in our case it is only "Name" (and may be "App name" too)

`

<string name="order_summary_whipped_cream">Add whipped cream?  </string>


<string name="order_summary_chocolate">Add chocolate? </string>


<string name="order_summary_quantity">Quantity: </string>


<string name="order_summary_price">Total: </string>


<string name="thank_you">Thank you! </string>


<string name="order_summary_email_subject">Just Java order for <xliff:g id="name" example="Amy">%s</xliff:g></string>`

I hope this will help.

@laurentiufotache

This comment has been minimized.

Copy link

commented Dec 4, 2017

My Romanian version, could not be missed :)

<!--activity_mail.xml file-->
<string name="app_name">Doar Java</string>
<string name="name">Introduceti numele aici</string>
<string name="toppings">Ingrediente extra</string>
<string name="whipped_cream">Crema frisca</string>
<string name="chocolate">Ciocolata</string>
<string name="order">Comanda</string>
<string name="thank_you">Multumesc!</string>
<string name="quantity">Cantitate</string>

<!--MainActivity.java file-->
<string name="order_summary_name">Nume: <xliff:g example="Laurentiu" id="name"></xliff:g></string>
<string name="order_summary_whipped_cream">Crema frisca?<xliff:g example="true" id="addWhippedCream"></xliff:g></string>
<string name="order_summary_chocolate">Ciocolata?<xliff:g example="true" id="addChocolate"></xliff:g></string>
<string name="order_summary_quantity">Cantitate:<xliff:g example="2" id="quantity"></xliff:g></string>
<string name="order_summary_price">Pret: <xliff:g example="10 RON" id="price">%s</xliff:g></string>
<string name="order_summary_email_subject">DoarJava: Comanda cafea pentru <xliff:g example="Laurentiu" id="name"></xliff:g></string>

<!--Toast messages-->

<string name="too_many_coffees">Comanda maxima este de 100 de cafele!</string>
<string name="too_few_coffees">Comanda minima este de o cafea!</string>
<string name="initial_quantity_value">2</string>
@nineOneOnePawel

This comment has been minimized.

Copy link

commented Dec 15, 2017

Polish version
[CODE]

         Tylko Java
    <!-- Podpowiedź wyświetla tekst w pustym polu dla nazwy użytkownika [CHAR LIMIT = 20] -->
    <string name="name">Imię</string>

    <!-- Podpowiedź wyświetla tekst w pustym polu dla nazwy użytkownika [CHAR LIMIT = 20] -->
    <string name="toppings">Składniki</string>

    <!-- Podpowiedź wyświetla tekst w pustym polu dla nazwy użytkownika [CHAR LIMIT = 20] -->
        <string name="whipped_cream">Bita śmietana</string>

    <!-- Podpowiedź wyświetla tekst w pustym polu dla nazwy użytkownika [CHAR LIMIT = 20] -->
    <string name="chocolate">Czekolada</string>

    <!-- Podpowiedź wyświetla tekst w pustym polu dla nazwy użytkownika [CHAR LIMIT = 20] -->
    <string name="quantity">Ilość</string>

    <!-- Podpowiedź wyświetla tekst w pustym polu dla nazwy użytkownika [CHAR LIMIT = 5] -->
    <string name="initial_quantity_value">2</string>

    <!-- Podpowiedź wyświetla tekst w pustym polu dla nazwy użytkownika [CHAR LIMIT = 20] -->
    <string name="order">Zamów</string>

    <!--
      Nazwa podsumowania zamówienia. Zostanie pokazany w formacie "Name: Amy", gdzie znajduje się Amy
      nazwa użytkownika. [CHAR LIMIT = NONE]
    -->
    <string name="order_summary_name">Imię: <xliff:g id="name" example="Amy">%s</xliff:g></string>

    <!--
      Bita śmietana do podsumowania zamówienia. Zostanie pokazany w formacie
      "Dodaj bitą śmietanę? True" lub "Add whipped cream? False". [CHAR LIMIT = NONE]
    -->
    <string name="order_summary_whipped_cream">Dodaj bitą śmietanę? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

    <!--
      Polewa czekoladowa do podsumowania zamówienia. Zostanie pokazany w formacie
      "Dodaj czekoladę? Prawda" lub "Dodaj czekoladę? Fałszywy". [CHAR LIMIT = NONE]
    -->
    <string name="order_summary_chocolate">Dodaj czekoladę? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

    <!--
      Ilość filiżanek do zsumowania zamówienia. Zostanie pokazany w formacie
      "Ilość: 2", gdzie 2 to liczba zamówionych kubków. [CHAR LIMIT = NONE]
    -->
    <string name="order_summary_quantity">Ilość: <xliff:g id="quantity" example="2">%d</xliff:g></string>

    <!--
      Całkowita cena za podsumowanie zamówienia. Zostanie pokazany w formacie
      "Razem: 10 USD", gdzie 10 USD to cena. [CHAR LIMIT = NONE]
    -->
    <string name="order_summary_price">Suma: <xliff:g id="price" example="$10">%s</xliff:g></string>

    <!-- Dziękujemy za wiadomość z podsumowaniem zamówienia. [CHAR LIMIT = NONE] -->
    <string name="thank_you">Dzięki!</string>

    <!--
      Wiersz tematu e-maila z podsumowaniem zamówienia. Będzie w formacie
      "Tylko zamówienie Java dla Amy", gdzie Amy to nazwa użytkownika. [CHAR LIMIT = NONE]
    -->
    <string name="order_summary_email_subject">Tylko zamówienie Java dla <xliff:g id="name" example="Amy">%s</xliff:g></string>
[/CODE]

Hello from rainy Ireland. Pawel.

@germanfrelo

This comment has been minimized.

Copy link

commented Dec 31, 2017

Spanish

Hi! Here is my Spanish version with some improvements IMO. All the lines have their proper comments.

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- APPLICATION LAYOUT -->

    <!-- Title for the application. [CHAR LIMIT=12] -->
    <string name="app_name">Sólo Java</string>

    <!-- Hint text displayed in the empty text field for the user's name. [CHAR LIMIT=20] -->
    <string name="name">Nombre</string>

    <!-- Header text for Toppings. [CHAR LIMIT=20] -->
    <string name="toppings">Toppings</string>

    <!-- Text associated with the checkbox for 'Whipped cream' topping. [CHAR LIMIT=20] -->
    <string name="whipped_cream">Nata montada</string>

    <!-- Text associated with the checkbox for 'Chocolate' topping. [CHAR LIMIT=20] -->
    <string name="chocolate">Chocolate</string>

    <!-- Header text for Quantity. [CHAR LIMIT=20] -->
    <string name="quantity">Cantidad</string>

    <!-- Initial value of the Quantity field. [NON TRANSLATABLE] -->

    <!-- The minus symbol shown inside the decrement button. [NON TRANSLATABLE] -->

    <!-- The minus symbol shown inside the increment button. [NON TRANSLATABLE] -->

    <!-- Toast message displayed when the user reaches the maximum limit of number of coffees
    that can be ordered (100) and clicks the increment button. [CHAR LIMIT=NONE] -->
    <string name="toast_increment">No puedes pedir más de 100 cafés</string>

    <!-- Toast message displayed when the user reaches the minimum limit of number of coffees
    that can be ordered (1) and clicks the decrement button. [CHAR LIMIT=NONE] -->
    <string name="toast_decrement">No puedes pedir menos de 1 café</string>

    <!-- Text inside the Order button. [CHAR LIMIT=20] -->
    <string name="order">Ordenar</string>


    <!-- ORDER SUMMARY -->

    <!-- Subject line for the order summary email. It will be in the format of
    "Just Java order for Amy", where Amy is the user's name. [CHAR LIMIT=20] -->
    <string name="order_summary_email_subject">Sólo Java para <xliff:g id="emailSubject" example="Amy">%s</xliff:g></string>

    <!-- Name for the order summary. It will be shown in the format of
    "Name: Amy", where Amy is the user's name. [CHAR LIMIT=NONE] -->
    <string name="order_summary_name">Nombre: <xliff:g id="name" example="Amy">%s</xliff:g></string>

    <!-- Whipped cream topping for the order summary. It will be shown in the format of
    "Add whipped cream? Yes" or "Add whipped cream? No". [CHAR LIMIT=NONE] -->
    <string name="order_summary_whipped_cream">¿Añadir nata montada? <xliff:g id="addWhippedCream" example="true">%s</xliff:g></string>

    <!-- Chocolate topping for the order summary. It will be shown in the format of
    "Add chocolate? Yes" or "Add chocolate? No". [CHAR LIMIT=NONE] -->
    <string name="order_summary_chocolate">¿Añadir chocolate? <xliff:g id="addChocolate" example="true">%s</xliff:g></string>

    <!-- Quantity of coffee cups for the order summary. It will be shown in the format of
    "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE] -->
    <string name="order_summary_quantity">Cantidad: <xliff:g id="quantity" example="2">%d</xliff:g></string>

    <!-- Total price for the order summary. It will be shown in the format of
    "Total: $10", where $10 is the price. [CHAR LIMIT=NONE] -->
    <string name="order_summary_price">Total: <xliff:g id="price" example="$10">%s</xliff:g></string>

    <!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
    <string name="order_summary_thank_you">¡Gracias!</string>

    <!-- True response if the user has checked a particular topping. [CHAR LIMIT=NONE] -->
    <string name="yes">Sí</string>

    <!-- False response if the user has checked a particular topping. [CHAR LIMIT=NONE] -->
    <string name="no">No</string>
</resources>
@albehery

This comment has been minimized.

Copy link

commented Jan 6, 2018

forgot toast error messages

@elisavetTriant

This comment has been minimized.

Copy link

commented Jan 13, 2018

Greek version: https://gist.github.com/elisavetTriant/a3ef3a58b85407ed83f6491d79e38d56

Preview:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Title for the application. [CHAR LIMIT=12] -->
    <string name="app_name">Μόνο Java</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="name">Όνομα</string>

    <!-- Button for deducting quantity. [CHAR LIMIT=1] -->
    <string name="minus">-</string>

    <!-- Button for adding quantity. [CHAR LIMIT=1] -->
    <string name="plus">+</string>

    <!-- Button for sending order. [CHAR LIMIT=20] -->
    <string name="order">Παραγγελία</string>

    <!-- Quantity title. [CHAR LIMIT=20] -->
    <string name="quantity">Ποσότητα</string>

    <!-- Chocolate checkbox. [CHAR LIMIT=20] -->
    <string name="chocolate">Σοκολάτα</string>

    <!-- Whipped cream checkbox. [CHAR LIMIT=20] -->
    <string name="whipped_cream">Αφρόγαλα</string>

    <!-- Toppings title. [CHAR LIMIT=20] -->
    <string name="toppings">Έξτρα</string>

    <!-- Thank you. [CHAR LIMIT=20] -->
    <string name="thank_you">Ευχαριστούμε!</string>

    <!-- Min order toast message. [CHAR LIMIT=80] -->
    <string name="min_order">Δεν μπορείτε να παραγγείλετε λιγότερο από ένα καφέ!</string>

    <!-- Max order toast message. [CHAR LIMIT=80] -->
    <string name="max_order">Δεν μπορείτε να παραγγείλετε περισσότερους από 100 καφέδες!</string>

    <!--
       Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
       user's name. [CHAR LIMIT=NONE]
     -->
    <string name="order_summary_name">Όνομα: <xliff:g id="name" example="Amy">%s</xliff:g></string>

    <!--
      Whipped cream topping for the order summary. It will be shown in the format of
      "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_whipped_cream">Προσθήκη αφρόγαλα; <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

    <!--
      Chocolate topping for the order summary. It will be shown in the format of
      "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_chocolate">Προσθήκη σοκολάτας; <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

    <!--
      Quantity of coffee cups for the order summary. It will be shown in the format of
      "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_quantity">Ποσότητα: <xliff:g id="quantity" example="2">%d</xliff:g></string>

    <!--
      Total price for the order summary. It will be shown in the format of
      "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_price">Σύνολο: <xliff:g id="price" example="$10">%s</xliff:g></string>
    <!--
      Subject line for the order summary email. It will be in the format of
      "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_email_subject">Παραγγελία για τον/την <xliff:g id="name" example="Amy">%s</xliff:g> από το Μόνο Java</string>
</resources>
@PereViki

This comment has been minimized.

Copy link

commented Jan 18, 2018

This is also Hungarian (as above), but I also included the toast message. In addition, since Hungarian grammar is different I changed the e-mail subject in a way that is correct in Hungarian (first the name, then the 'Just Java order for' section).

<?xml version="1.0" encoding="utf-8"?>
<resources
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">Csak Java</string>
    <string name="user_name">Név</string>
    <string name="toppings_header">Feltétek</string>
    <string name="whipped_cream">Tejszínhab</string>
    <string name="chocolate">Csokoládé</string>
    <string name="quantity_header">Mennyiség</string>
    <string name="quantity">2</string>
    <string name="order_button">Rendelés</string>
    <string name="order_name">"Név: <xliff:g id="name" example="Amy">%s</xliff:g> "</string>
    <string name="order_whipped_cream">Tejszínhabbal? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
    <string name="order_chocolate">Csokoládéval? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>
    <string name="order_quantity">Mennyiség: <xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_total">Összesen: $<xliff:g id="price" example="$10">%s</xliff:g></string>
    <string name="thank_you">Köszönöm!</string>
    <string name="order_subject"><xliff:g id="userName" example="Amy">%s</xliff:g> Csak Java rendelése</string>
    <string name="decrement_warning">Legalább 1 kávét kell rendelnie!</string>
    <string name="increment_warning">Nem rendelhet 100-nál több kávét!</string>
</resources>

@khash021

This comment has been minimized.

Copy link

commented Jan 19, 2018

Loved Cascascap comment. The Alt + Enter and then extract method is amazing.

I have also changed the Toast messages since it was not mentioned in the original post.

Here are the toast messages for Spanish (sorry for poor translation) and Farsi (Persian فارسی )

Spanish
<!-- toast text to be be shown when trying to order less than 1 coffee -->
<string name="toast_decrement">¡La orden mínima es 1 café!</string>

<!-- toast text to be be shown when trying to order more than 100 coffee -->
<string name="toast_increment">¡No puedes pedir más de 100 cafés!</string>

Farsi (فارسی )
<string name="toast_decrement">خجالت بکش ... مگه قهوه منفی هم میشه</string>
<string name="toast_increment">این همه قهوه بخوری که دیگه باید تو دستشویی بخوابی</string>

@Patrikrizek

This comment has been minimized.

Copy link

commented Jan 21, 2018

Please find the Czech version below:

`


Prostě Java

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">Jméno</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">Polevy</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">Šlehačka</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">Čokoláda</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">Množství</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="initial_quantity_value">2</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">Objednat</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order_summary">Shrnutí objednávky</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">Jméno<xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">Požadována šlehačka?<xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">Požadována čokoláda?<xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">Množství<xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">Celkem<xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">Děkuje Vám!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">Prostě Java<xliff:g id="name" example="Amy">%s</xliff:g></string>

`

@bifucar

This comment has been minimized.

Copy link

commented Jan 24, 2018

ITALIAN#

Just Java Ciao mondo! Impostazioni
<!-- Name of the user [CHAR LIMIT=20] -->
<string name="name">Nome</string>

<!-- Header text for the list of toppings [CHAR LIMIT=20] -->
<string name="toppings">Ingredienti</string>

<!-- Whipped cream topping for the order summary. [CHAR LIMIT=20] -->
<string name="whipped_cream">Panna montata</string>

<!-- Chocolate topping for the order summary. [CHAR LIMIT=20] -->
<string name="chocolate">Cioccolata</string>

<!-- Quantity for the order summary. [CHAR LIMIT=20] -->
<string name="quantity">Quantità</string>

<!-- Order button. [CHAR LIMIT =20] -->
<string name="order">Ordina</string>

<!-- Thank you message for the order summary [CHAR LIMIT=20] -->

Grazie!

<!-- Name for the order summary. It will be shown  in the format of "Name: Amy" where Amy is the user's name. [CHAR LIMIT=20] -->

Nome: <xliff:g id="name" example="Amy">%s</xliff:g>

@mixspark

This comment has been minimized.

Copy link

commented Jan 26, 2018

Ελληνικα / some Greek

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">ΜόνοΙάβα</string>
    <string name="toppings">Πρoσθετα</string>
    <string name="addChocolate">Προσθήκη Σοκολάτας</string>
    <string name="addWhippedCream">Προσθήκη Κρέμας</string>
    <string name="chocolate">Σοκολάτα</string>
    <string name="order">Παραγγελία</string>
    <string name="quantity">Ποσοτητα</string>
    <string name="thank_you">Ευχαριστούμε Πολύ :)</string>
    <string name="total">Σύνολο $</string>
    <string name="whipped_cream">Κρέμα</string>
    <string name="email">"Ηλεκτρονικό Ταχυδρομείο"</string>
    <string name="minus_one">Δεν μπορείτε να έχετε λιγότερο από ένα καφέ!</string>
    <string name="one_hundred">Δεν μπορείτε να έχετε περισσότερους απο 100 καφέδες!</string>
    <string name="name">Όνομα</string>
    <string name="order_summary_name">"Όνομα Παραγγελίας: "</string>
    <string name="order_quantity">Ποσοτητα: <xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_total">Συνολο: $<xliff:g id="price" example="$10">%s</xliff:g></string>
</resources>
@rengineker

This comment has been minimized.

Copy link

commented Feb 3, 2018

here is the Turkish version.

Sadece Java

Isim

Ingredientes

Krema

çikolata

Adet

2

Sipariş

Isim: <xliff:g id="isim" example="Amy">%s</xliff:g>

Ekstra krema eklensin mi? <xliff:g id="addWhippedCream" example="true">%b</xliff:g>

Ekstra çikolata eklensin mi? <xliff:g id="addChocolate" example="true">%b</xliff:g>

Adet: <xliff:g id="quantity" example="2">%d</xliff:g>

Toplam: <xliff:g id="price" example="$10">%s</xliff:g>

Teşekkürler!

Sadece Java <xliff:g id="name" example="Amy">%s</xliff:g>

@AlexRuPa

This comment has been minimized.

Copy link

commented Feb 6, 2018

Thank you very much for posting this gist. How can we Translate Java Code ? Any Idea or is it Impossible to Translate?

I know in this video it says we can only translate the strings variables present in Strings.xml file only . But I have a question, like if you check out the below picture everything is in Spanish accept the Boolean and dynamic values we are passing . I am just curious because In spanish True means "Cierto" and here below its Showing as "true" which does n't add 100 % value to our Translation functionality. translated the Just Java App verbiage in my local langauge everything else got transalated except the arguments(Dynamic Values).

@OsmanAppDeveloper

I'm new in this so maybe someone knows a better way.

You can use an If statement of the boolean value and setting a String from resources as return

@MaziluLavinia

This comment has been minimized.

Copy link

commented Feb 6, 2018

My Romanian translation:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">Doar Java</string>
    <string name="name" translatable="false">Nume</string>
    <string name="toppings" translatable="false">Ingrediente</string>
    <string name="whipped_cream" translatable="false">Frisca</string>
    <string name="chocolate" translatable="false">Ciocolata</string>
    <string name="quantity" translatable="false">Cantitate</string>
    <string name="order" translatable="false">Comanda</string>
    <string name="order_summary_name" translatable="false">Nume: <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary_whipped_cream" translatable="false">Adauga si frisca? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>
    <string name="order_summary_chocolate" translatable="false">Adauga si ciocolata? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>
    <string name="order_summary_quantity" translatable="false">Cantitate:  <xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_summary_price" translatable="false">Total:  <xliff:g id="price" example="$10">%s</xliff:g></string>
    <string name="thank_you" translatable="false">Multumim!</string>
    <string name="order_summary_email_subject" translatable="false">Comanda Doar Java pentru <xliff:g id="name" example="Amy">%s</xliff:g></string>
</resources>
@maiossaid

This comment has been minimized.

Copy link

commented Feb 8, 2018

why keys are not appear in key Column?

@jungho1109

This comment has been minimized.

Copy link

commented Feb 8, 2018

그냥 자바 토핑 휘핑크림 초콜릿 수량 주문 이름 : %s 휘핑크림 추가? %b 초콜릿 추가? %b 전체 수량 : %d 커피 가격 : $%d 감사합니다 !
@Maxwe1

This comment has been minimized.

Copy link

commented Feb 9, 2018

Thanks

@emanitou

This comment has been minimized.

Copy link

commented Feb 12, 2018

Also, in Romanian, like Lavinia.
Little obs:

  1. in method createOrderSummary I used
    orderMessage += "\n" + getString(R.string.order_summary_price,"$" + price);
    because price is integer and I need to add "$"
  2. In the beginning I add manually the translation, after that with Translation editor, so the file looks little messy.

Thank you!

2018-02-12 13_08_52-justjava - c__users_vezen_androidstudioprojects_justjava - app - _app_src

@sarahHannaKim

This comment has been minimized.

Copy link

commented Feb 25, 2018

@jungho1109
I want the Korean translation, please

@abdullahelsheikh

This comment has been minimized.

Copy link

commented Feb 28, 2018

Thank you

@aminabenabdallah

This comment has been minimized.

Copy link

commented Feb 28, 2018

Thank you so much thats so interesting !

@dennymarcels

This comment has been minimized.

Copy link

commented Mar 2, 2018

Hints from lines 6:24 are repeated.

@abdahma01

This comment has been minimized.

Copy link

commented Mar 4, 2018

English
en

Arabic
arabic

strings.xml
image

strings.xml(ar)
image

Java
package com.example.android.coffeeupdated;

import android.content.Intent;
import android.icu.text.NumberFormat;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}
public void submitOrder(View view) {
    CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream_checkbox);
    boolean hasWhippedCream = whippedCreamCheckBox.isChecked();
    CheckBox chocolateCheckBox = (CheckBox)findViewById(R.id.chocolate_checkbox);
    boolean hasChocolate = chocolateCheckBox.isChecked();
    EditText text = (EditText)findViewById(R.id.name_field);
    String name = text.getText().toString();
    int price = calculatePrice(hasWhippedCream, hasChocolate);
    String priceMessage = createOrderSummary(name, price, hasWhippedCream, hasChocolate);
    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.setData(Uri.parse("mailto:")); // only email apps should handle this
    intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.Coffee_Updated_order_for, name));
    intent.putExtra((Intent.EXTRA_TEXT), priceMessage);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}
public void increment(View view) {
    if (quantity == 10){
        Toast.makeText(this, getString(R.string.toastIncrease), Toast.LENGTH_SHORT).show();
        return;
    }
    quantity = quantity + 1;
    displayQuantity(quantity);
}
public void decrement(View view) {
    if (quantity == 1){
        Toast.makeText(this, getString(R.string.toastDecrease), Toast.LENGTH_SHORT).show();
        return;
    }
    quantity = quantity - 1;
    displayQuantity(quantity);
}
private int calculatePrice(boolean addWhippedCream, boolean addChocolate) {
    int coffeeCupPrice = 5;

    if (addWhippedCream){
        coffeeCupPrice += 1;
    }
    if(addChocolate){
        coffeeCupPrice += 2;
    }
    return coffeeCupPrice * quantity;
}
private String createOrderSummary(String name, int price, boolean addWhippedCream, boolean addChocolate) {
    String orderSummary = getString(R.string.order_summary_name , name);
    orderSummary += "\n" + getString(R.string.order_whipped_cream ,(addWhippedCream? getString(R.string.boolean_true) : getString(R.string.boolean_false)));;
    orderSummary += "\n" +  getString(R.string.order_chocolate , (addChocolate? getString(R.string.boolean_true) : getString(R.string.boolean_false)));;
    orderSummary += "\n" +  getString(R.string.order_summary_quantity , quantity);
    orderSummary += "\n" + getString( R.string.order_price , NumberFormat.getCurrencyInstance().format(price));
    orderSummary += "\n" + getString(R.string.thank_you);
    return orderSummary;
}
private void displayQuantity(int numbersOfCoffee) {
    TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);
    quantityTextView.setText("" + numbersOfCoffee);
}

}

@badrddinb

This comment has been minimized.

Copy link

commented Mar 7, 2018

thanks

@CaseButtitta

This comment has been minimized.

Copy link

commented Mar 21, 2018

Nur Kaffee

Name

Garnituren

Sahnehaube

Schokostreusel

Anzahl

2

Bestellen

Zusammenfassung

Name: <xliff:g example="Amy" id="name">%s</xliff:g>

Sahnehaube hinzufügen? <xliff:g id="addWhippedCream" example="no">%s</xliff:g>

Schokostreusel hinzufügen? <xliff:g id="addChocolate" example="no">%s</xliff:g>

Anzahl: <xliff:g id="quantity" example="2">%d</xliff:g>

Gesamtpreis: $<xliff:g id="price" example="10">%s</xliff:g>

Gesamtpreis: $10

Danke!

Nur Kaffee Bestellung für <xliff:g id="name" example="Amy">%s</xliff:g>

ja

nein

Maximum sind 100 Kaffee pro Bestellung

Minimum ist ein Kaffee pro Bestellung

Sie haben ein kleines Problem in Ihrem Code,
Sie müssen am Ende ein "resources" Tag hinzufügen

@acideater

This comment has been minimized.

Copy link

commented Mar 26, 2018

Brazilian Portuguese Localization file for Android App Just Java
path: res/values-pt-rBR/strings.xml

Added a few more translations, like the Toast ones, and amended some others:

<!-- Title for the application. [CHAR LIMIT=12] -->
<string name="app_name">Só Java</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">Nome</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">Adicionais</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">Chantilli</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">Chocolate</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">Quantidade</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">Pedir</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">Nome: <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">Acrescentar chantilli? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">Acrescentar chocolate? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">Quantidade: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">Total: <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">Obrigado!</string>

<!-- Toast message for many coffees. [CHAR LIMIT=NONE] -->
<string name="toast_max_coffee">Você não pode pedir mais de cem (100) cafés.</string>

<!-- Toast message for few coffees. [CHAR LIMIT=NONE] -->
<string name="toast_min_coffee">Você não pode pedir menos de um (1) café.</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">Pedido Só Java para <xliff:g id="name" example="Amy">%s</xliff:g></string>

Source: https://gist.github.com/acideater/c028d406136278bf180474f812370edb

@Bong79

This comment has been minimized.

Copy link

commented Mar 27, 2018

Nigerian Pidgin English...(a little buggy, sorry)

<!-- Hint text display in the empty field for the app's name [CHAR LIMIT=20] -->
<string name="app_name">Na Java</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">Who be dis?</string>

<!-- Hint text display in the empty field for the toppings [CHAR LIMIT=20] -->
<string name="toppings">Orishirishi</string>

<!-- Hint text display in the empty field for whipped cream [CHAR LIMIT=20] -->
<string name="whipped_cream">Small small whipped cream</string>

<!-- Hint text display in the empty field for chocolate [CHAR LIMIT=20] -->
<string name="chocolate">Small small chocolate</string>

<!-- Hint text display in the empty field for quantity [CHAR LIMIT=20] -->
<string name="quantity">How many you dey want?</string>

<!-- Hint text display in the empty field for initial quantity [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>

<!-- Hint text display in the empty field for the order [CHAR LIMIT=20] -->
<string name="order">Order am!</string>

<!-- Hint text display in the empty field for toast2 [CHAR LIMIT=20] -->
<string name="toast2">You no go get less than 1 cup</string>

<!-- Hint text display in the empty field for toast1 [CHAR LIMIT=20] -->
<string name="toast1">You no go get more than 100 cups</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Iniobong" where Ini is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">Who be dis: <xliff:g id="name" example="Iniobong">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">Na whipped cream? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">Na chocolate? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">How many you dey want: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">Na total: <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">I hail you!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">Java, Na Java for <xliff:g id="name" example="Iniobong">%s</xliff:g></string>
@Hoab

This comment has been minimized.

Copy link

commented Apr 18, 2018

In case anyone have the error "Format string "XXXXX" is not valid format string so it should not be passed to String.format"

You need to check the string.xml file of the second languaje. You must add the same line than the one in English
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"

and, the string in the second languaje also need to have the whole line
"whatever_you_are_translating " <xliff:g id="xxx" example="xxxxxx">%s</xliff:g>

You may need to Rebuild the project after

@pokumars

This comment has been minimized.

Copy link

commented May 10, 2018

Finnish

<string name="app_name">Just Java</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">Täytteet</string>

<!--
 Whipped cream topping for the order summary. It will be shown in the format of
 "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]

-->
Kermavaahto

<!--
 Chocolate topping for the order summary. It will be shown in the format of
 "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]

-->
Suklaa

<!--
      Quantity of coffee cups for the order summary. It will be shown in the format of
      "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
    -->
<string name="quantity">määrä</string>


<string name="order">Tilaa</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
   <string name="type_name_here">kirjoita nimi tähän</string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
   <string name="thank_you">Kiitos</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
   <string name="name">
       Nimi :<xliff:g id= "name of customer" example = "John"> %S</xliff:g>
<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
   <string name="Total">Yhteensä</string>

<!--Toast message when the order is less than 1. It will be shown in the format of
"You cannot have less than 1 coffee" . [CHAR LIMIT=NONE]
-->
<string name="less_than_1">Ei pysyty tilaaman alle 1 kahvia</string>

<!--Toast message when the order is more than 100. It will be shown in the format of
    "You cannot have more than 100 coffees" . [CHAR LIMIT=NONE]
    -->
<string name="more_than_100">Et saa yli 100 kahvia</string>

<!--

Email subject text for order summary.
It will be shown in the format Just Java order for John
-->

Just Java Order tilaus asiakkaalle :<xliff:g id= "name of customer" example = "John"> </xliff:g>

@Eduese

This comment has been minimized.

Copy link

commented May 31, 2018

Things became easier when I found this code for the Spanish language. I want to commend others who's helped in other languages.

@sahillearner

This comment has been minimized.

Copy link

commented Jun 13, 2018

sserror
hi guys , if anyone can help with this error please.

@ierosvin

This comment has been minimized.

Copy link

commented Jun 20, 2018

Bicol Region, Philippines

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Ining Java</string>
    <string name="name">Ngaran</string>
    <string name="toppings">Pampasiram</string>
    <string name="whipped_cream">Pampadakula</string>
    <string name="chocolate">Tsokolate</string>
    <string name="quantity">Pira</string>
    <string name="initial_quantity_value">2</string>
    <string name="order">Pagibo</string>
    <string name="order_summary_name">Ngaran: <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary_whipped_cream">Gusto mo magdakula? <xliff:g example="true" id="addWhippedCream">%b</xliff:g></string>
    <string name="order_summary_chocolate">Gusto mo tsokolate? <xliff:g example="true" id="addChocolate">%b</xliff:g></string>
    <string name="order_summary_quantity">Kantidad: <xliff:g example="2" id="quantity">%d</xliff:g></string>
    <string name="order_summary_price">Sumatotal: <xliff:g id="price" example="$10">%s</xliff:g></string>
    <string name="thank_you">Mabalos!</string>
    <string name="order_summary_email_subject">Ining Java para kan <xliff:g example="Amy" id="name">%s</xliff:g></string>
</resources>
@Fury4hwxc

This comment has been minimized.

Copy link

commented Jun 29, 2018

thanks 👍

@lycansre

This comment has been minimized.

Copy link

commented Jul 4, 2018

Translation in arabic
الترجمة للعربية

فقط Java
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">الاسم</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">الاضافات</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">كريمة</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">الشوكولاتا</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">الكمية</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">2</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">اطلب</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">الاسم: <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream">اضف الكريمة? <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">اضف الشوكولاتا? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">الكمية: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">الحساب: <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">شكراً!</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">فقط java <xliff:g id="name" example="Amy">%s</xliff:g></string>
@Alizoo

This comment has been minimized.

Copy link

commented Jul 17, 2018

Having initial_quantity_value in every translation of the strings.xml file would cause a massive headache if the developer ever needed to change that value. I would suggest having the initial_quantity_value in the original strings.xml file with 'translatable = "false"' in the string tag. Then omit it from all other translations of the strings.xml file.

@teonkajkafon

This comment has been minimized.

Copy link

commented Jul 20, 2018

Right to left languages: This is Arabic mostly from google translate, but I was trying to format it correctly rather than get a correct translation. I don't actually understand why this would work correctly on my phone (after setting phone to Arabic language) since I would have expect the tags to be set before the colons in order for it to display correctly. Maybe it's because I didn't type in the Arabic directly, but copied and pasted it (so I had to copy the right to left colon etc)?

image

@ghost

This comment has been minimized.

Copy link

commented Aug 10, 2018

~ KOREAN~

대한민국
한국어가 제일 느낌있네

저스트 자바
<!--Header text for the list of toppings [CHAR LIMIT=20]-->
<string name="toppings">토핑</string>

<!-- HINT text display in the empty field for the user's name [CHAR LIMIT=NONE]-->
<string name="enter_name">이름</string>

<!-- HINT Whipped Cream check box [CHAR LIMIT=20]-->
<string name="whipped_cream">휘핑크림</string>

<!-- HINT chocolate check box [CHAR LIMIT=NONE]-->
<string name="chocolate">초콜릿</string>

<!-- HINT Text showing QUANTITY [CHAR LIMIT=20]-->
<string name="quantity">갯수</string>

<!-- HINT Text showing ORDER SUMMARY [CHAR LIMIT=20]-->
<string name="order_summary">주문내역</string>

<!-- HINT ORDER button [CHAR LIMIT=20]-->
<string name="order">주문</string>

<!--Name of the order summary. It will be shown in the format of "Name: David"
where David is the user's name. [CHAR LIMIT=NONE]-->
<string name="order_summary_name">이름 <xliff:g id="이름 " example="David">%s</xliff:g></string>

<!--In the order summary, will be shown in the format of
"Add Whipped Cream? true" or "Add Whipped Cream? false" [CHAR LIMIT=NONE]-->
<string name="add_whipped_cream">휘핑크림 추가? <xliff:g id="휘핑크림 추가? " example="true">%b</xliff:g></string>

<!--In the order summary, will be shown in the format of
"Add Chocolate? true" or "Add Chocolate false" [CHAR LIMIT=NONE]-->
<string name="add_chocolate">초콜릿 추가? <xliff:g id="초콜릿 추가? " example="true">%b</xliff:g></string>

<!--In the order summary, will be shown in the format of
"Quantity: 2" where 2 is the number of coffees ordered [CHAR LIMIT=NONE]-->
<string name="order_summary_quantity">갯수 <xliff:g id="갯수 " example="2">%d</xliff:g></string>

<!--In the order summary, will be shown in the format of
"Total: $12" where 12 is the total price of the coffees order [CHAR LIMIT=NONE]-->
<string name="order_summary_price">가격 <xliff:g id="가격 " example="12">%d</xliff:g></string>

<!--In the order summary, will be shown in the format of "Thank you!" [CHAR LIMIT=NONE]-->
<string name="thank_you">감사합니당!</string>

<!--When the user decrements order below 0, toasts a message saying
"Cannot order below 0" [CHAR LIMIT=NONE]-->
<string name="decrement_order">0개 미만 주문하실 수 없어용</string>

<!--When the user increments order above 100, toasts a message saying
"Cannot order above 100" [CHAR LIMIT=NONE]-->
<string name="increment_order">100개 이상 주문하실 수 없어용</string>
@Abdallah-alnajjar

This comment has been minimized.

Copy link

commented Sep 8, 2018

strings.xml

Just Java Hello world! Settings
<!--Header text for the list of toppings [CHAR LIMIT=20] -->
<string name="toppings">Toppings</string>

<!-- Thank you message for the order summary .[CHAR LIMIT=NONE] -->
<string name="thank_you">Thank you!</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">Whipped cream</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">Chocolate</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">Quantity</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">Order</string>

Whipped cream topping for the order summary. It will be shown in the format of
"Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
<string name="addWhippedCream">Add Whipped Cream?  <xliff:g id="addWhippedCream" example="true"></xliff:g></string>

<!--

Chocolate topping for the order summary. It will be shown in the format of
"Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
Add Chocolate? <xliff:g id="addChocolate" example="true"></xliff:g>

<!--
 Total price for the order summary. It will be shown in the format of
 "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]

-->
Total:

<!--
 Subject line for the order summary email. It will be in the format of
 "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]

-->
just java order for

<!-- Name for the order summary . It will be shown in the format
of "Name: Amy" where Amy is the user's name [CHAR LIMIT=NONE] -->
<string name="order_summary_name" translatable="false">Name: <xliff:g id="name" example="Amy"></xliff:g></string>
</resources>

(arabic)

الأسم

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->

إضافات

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->

كريمه

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->

شوكولاتة

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->

الكميه

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->

أطلب

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]  -->

الأسم: <xliff:g id="name" example="Amy"></xliff:g>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->

إضافة كريمه? <xliff:g id="addWhippedCream" example="true"></xliff:g>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->

إضافة شوكولاتة؟ <xliff:g id="addChocolate" example="true"></xliff:g>

الأجمالى:

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->

شكراَ

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->

طلب جافا فقط الى

_____________________________________________________________________________________________________________________________________________-

(spain)

Sólo Java
    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="name">Nombre: </string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="toppings">Ingredientes</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="whipped_cream">Crema batida</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="chocolate">Chocolate</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="quantity">Cantidad</string>

    <!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
    <string name="order">Ordenar</string>

    <!--
      Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
      user's name. [CHAR LIMIT=NONE]
    -->
    <string name="order_summary_name">Nombre: <xliff:g id="name" example="Amy"></xliff:g></string>

    <!--
      Whipped cream topping for the order summary. It will be shown in the format of
      "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
    -->
    <string name="addWhippedCream">Agregue la crema batida? <xliff:g id="addWhippedCream" example="true"></xliff:g></string>

    <!--
      Chocolate topping for the order summary. It will be shown in the format of
      "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
    -->
    <string name="addChocolate">Agregue el chocolate? <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

    <!--
      Total price for the order summary. It will be shown in the format of
      "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
    -->
    <string name="Total">Total: </string>

    <!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
    <string name="thank_you">Gracias!</string>

    <!--
      Subject line for the order summary email. It will be in the format of
      "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
    -->
    <string name="just_java_order_for">Sólo java para </string>
</resources>
@Venky-8

This comment has been minimized.

Copy link

commented Nov 26, 2018

Marathi Translations:
path: res/values-mr-rIN/strings.xml
screenshot 18

@Dharmesh40

This comment has been minimized.

Copy link

commented Dec 24, 2018

Gujarati Translations

Gujarati strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name">માત્ર જાવા</string>
    <string name="name">નામ</string>
    <string name="toppings">ટોપિંગ્સ</string>
    <string name="whipped_cream">ફીણેલી મલાઈ</string>
    <string name="chocolate">ચોકલેટ</string>
    <string name="quantity">જથ્થો</string>
    <string name="initial_quantity_value">2</string>
    <string name="order">ઓર્ડર</string>
    <string name="order_summary_whipped_cream">ફીણેલી મલાઈ ઉમેરો છો? <xliff:g id="addWhippedCream" example="yes"> </xliff:g></string>
    <string name="order_summary_chocolate">ચોકલેટ ઉમેરો છો? <xliff:g id="addChocolate" example="yes"> </xliff:g></string>
    <string name="order_summary_quantity">જથ્થો: <xliff:g id="quantity" example="2">%d</xliff:g></string>
    <string name="order_summary_price">કુલ: <xliff:g id="price" example="$10">%s</xliff:g></string>
    <string name="thank_you">આભાર!</string>
    <string name="order_summary_email_subject">માત્ર જાવા ઓર્ડર <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="order_summary_name">નામ <xliff:g id="name" example="Amy">%s</xliff:g></string>
    <string name="less_then_1_coffee">તમને 1 થી ઓછી કૉફી ન મળી શકે</string>
    <string name="more_then_100_coffee">તમને 100 થી વધુ કૉફી ન મળી શકે</string>
    <string name="toppings_yes">હા</string>
    <string name="toppings_no">ના</string>
</resources>

Screenshot
gu strings xml

MainActivity.java to get yes/no instead of true/false

    private String createOrderSummary(String name, int price, boolean addWhippedCream, boolean addChocolate) {
        String priceMessage = getString(R.string.order_summary_name, name);
        priceMessage += "\n" + getString(R.string.order_summary_whipped_cream);
        if (addWhippedCream) {
            priceMessage += getString(R.string.toppings_yes);
        } else priceMessage += getString(R.string.toppings_no);
        priceMessage += "\n" + getString(R.string.order_summary_chocolate);
        if (addChocolate) {
            priceMessage += getString(R.string.toppings_yes);
        } else priceMessage += getString(R.string.toppings_no);
        priceMessage += "\n" + getString(R.string.order_summary_quantity, quantity);
        priceMessage += "\n" + getString(R.string.order_summary_price, NumberFormat.getCurrencyInstance().format(price));
        priceMessage += "\n" + getString(R.string.thank_you);
        return priceMessage;
    }

Screenshot
mod in main activity java

if you are getting %b before yes or no like %bYes or %b remove that %b from (look at the arrows in screenshot)
solution

just java app screenshot gujarati
just java gujarati

just java app screenshot english
just java english

Best of Luck Everybody!

@jhmluna

This comment has been minimized.

Copy link

commented May 5, 2019

@Hoab

Thanks for your message.
Solved my problem.

@NarFooZ

This comment has been minimized.

Copy link

commented Jun 5, 2019

العربية Arabic

جافا فقط
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="name">اسم</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="toppings">اضافات</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="whipped_cream">كريمة مخفوقة</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="chocolate">شوكولاتة</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="quantity">الكمية</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=5] -->
<string name="initial_quantity_value">۲</string>

<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] -->
<string name="order">اطلب</string>

<!--
  Name for the order summary. It will be shown in the format of "Name: Amy" where Amy is the
  user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_name">اسم: <xliff:g id="name" example="Amy">%s</xliff:g></string>

<!--
  Whipped cream topping for the order summary. It will be shown in the format of
  "Add whipped cream? true" or "Add whipped cream? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_whipped_cream"> اضافة كريمة مخفوقة ؟ <xliff:g id="addWhippedCream" example="true">%b</xliff:g></string>

<!--
  Chocolate topping for the order summary. It will be shown in the format of
  "Add chocolate? true" or "Add chocolate? false". [CHAR LIMIT=NONE]
-->
<string name="order_summary_chocolate">اضافة شوكولاتة ؟ <xliff:g id="addChocolate" example="true">%b</xliff:g></string>

<!--
  Quantity of coffee cups for the order summary. It will be shown in the format of
  "Quantity: 2", where 2 is the number of cups ordered. [CHAR LIMIT=NONE]
-->
<string name="order_summary_quantity">الكمية: <xliff:g id="quantity" example="2">%d</xliff:g></string>

<!--
  Total price for the order summary. It will be shown in the format of
  "Total: $10" where $10 is the price. [CHAR LIMIT=NONE]
-->
<string name="order_summary_price">المجموع: <xliff:g id="price" example="$10">%s</xliff:g></string>

<!-- Thank you message for the order summary. [CHAR LIMIT=NONE] -->
<string name="thank_you">شكرا لك</string>

<!--
  Subject line for the order summary email. It will be in the format of
  "Just Java order for Amy" where Amy is the user's name. [CHAR LIMIT=NONE]
-->
<string name="order_summary_email_subject">فقط جافا ل <xliff:g id="name" example="Amy">%s</xliff:g></string>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.