Localized strings for indicated number of quest items

This commit is contained in:
Wojciech Matusiak 2020-08-04 21:48:27 +02:00
parent da9e44231a
commit 6e18bfe0ad
6 changed files with 10 additions and 3 deletions

View file

@ -220,6 +220,7 @@
<string name="quests">Quêtes</string>
<string name="pets">Familiers</string>
<string name="mounts">Montures</string>
<string name="quest_items_found">Vous avez trouvé %d objets pour la quête</string>
<string name="armoireEquipment">Vous avez trouvé une pièce d\'équipement rare dans l\'Armoire : %s! Génial !</string>
<string name="armoireFood">Vous farfouillez dans l\'Armoire et trouvez une %1$s %2$s. Qu\'est-ce que ça fait là ?</string>
<string name="armoireExp">Vous luttez contre l\'Armoire et gagnez de l\'expérience. Prends ça !</string>

View file

@ -213,6 +213,7 @@
<string name="quests">Misje</string>
<string name="pets">Zwierzaki</string>
<string name="mounts">Wierzchowce</string>
<string name="quest_items_found">Znalazłeś %d przedmiot(y/ów) z zadania</string>
<string name="armoireEquipment">Znalazłeś element rzadkiego Ekwipunku w Skrzyni: %s! Super!</string>
<string name="armoireFood">Przeszukujesz Skrzynię i znajdujesz %1$s %2$s. Co to tam robi?</string>
<string name="armoireExp">Mocujesz się ze Skrzynią i zyskujesz Doświadczenie. A masz!</string>

View file

@ -271,6 +271,7 @@
<string name="pets">Pets</string>
<string name="mounts">Mounts</string>
<string name="quest_items_found">You\'ve found %d quest items</string>
<string name="armoireEquipment">You found %s in the Armoire</string>
<string name="armoireFood">You rummage in the Armoire and find %1$s %2$s. What\'s that doing in here?</string>
<string name="armoireExp">You wrestle with the Armoire and gain Experience. Take that!</string>

View file

@ -1,8 +1,11 @@
package com.habitrpg.android.habitica.interactors
import android.content.Context
import android.os.Handler
import android.provider.Settings.Global.getString
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import com.habitrpg.android.habitica.R
import com.habitrpg.android.habitica.executors.PostExecutionThread
import com.habitrpg.android.habitica.executors.ThreadExecutor
import com.habitrpg.android.habitica.helpers.SoundManager
@ -23,7 +26,7 @@ constructor(private val soundManager: SoundManager, threadExecutor: ThreadExecut
if (data?.questItemsFound ?: 0 > 0 && requestValues.showQuestItems) {
if (snackbarText.isNotEmpty())
snackbarText.append('\n')
snackbarText.append("+${data!!.questItemsFound} quest items")
snackbarText.append(requestValues.context.getString(R.string.quest_items_found, data!!.questItemsFound))
}
if (snackbarText.isNotEmpty()) {

View file

@ -117,7 +117,7 @@ class OldQuestProgressView : LinearLayout {
bossHealthView.pendingValue = value
bossHealthView.description = String.format("%.01f dmg pending", value)
bossHealthView.descriptionIconView.visibility = View.VISIBLE
collectedItemsNumberView.text = "+$collectedItems items found"
collectedItemsNumberView.text = context.getString(R.string.quest_items_found, collectedItems)
} else {
bossHealthView.pendingValue = 0.0
bossHealthView.description = ""

View file

@ -189,7 +189,8 @@ class QuestProgressView : LinearLayout {
fun configure(user: User) {
pendingDamageTextView.text = String.format("%.01f dmg pending", (user.party?.quest?.progress?.up ?: 0F) )
collectedItemsNumber.text = "+${user.party?.quest?.progress?.collectedItems ?: 0} items found"
val collectedItems = user.party?.quest?.progress?.collectedItems ?: 0
collectedItemsNumber.text = context.getString(R.string.quest_items_found, collectedItems)
}
private fun setupRageStrikeViews() {