Made almost all the strings SY uses translatable! If people would like to help translate, feel free to join the Tachiyomi discord server (https://discord.gg/tachiyomi), and jump in the tachiyomi-az-sy channel and I can give you a rundown on how to do it
This commit is contained in:
@@ -5,6 +5,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.EhFragmentBatchAddBinding
|
||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||
import eu.kanade.tachiyomi.util.lang.combineLatest
|
||||
@@ -26,7 +27,7 @@ class BatchAddController : NucleusController<EhFragmentBatchAddBinding, BatchAdd
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun getTitle() = "Batch add"
|
||||
override fun getTitle() = activity!!.getString(R.string.batch_add)
|
||||
|
||||
override fun createPresenter() = BatchAddPresenter()
|
||||
|
||||
@@ -145,14 +146,14 @@ class BatchAddController : NucleusController<EhFragmentBatchAddBinding, BatchAdd
|
||||
return
|
||||
}
|
||||
|
||||
presenter.addGalleries(galleries)
|
||||
presenter.addGalleries(activity!!, galleries)
|
||||
}
|
||||
|
||||
private fun noGalleriesSpecified() {
|
||||
activity?.let {
|
||||
MaterialDialog(it)
|
||||
.title(text = "No galleries to add!")
|
||||
.message(text = "You must specify at least one gallery to add!")
|
||||
.title(R.string.batch_add_no_valid_galleries)
|
||||
.message(R.string.batch_add_no_valid_galleries_message)
|
||||
.positiveButton(android.R.string.ok) { materialDialog -> materialDialog.dismiss() }
|
||||
.cancelable(true)
|
||||
.cancelOnTouchOutside(true)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package exh.ui.batchadd
|
||||
|
||||
import android.content.Context
|
||||
import com.jakewharton.rxrelay.BehaviorRelay
|
||||
import com.jakewharton.rxrelay.ReplayRelay
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
|
||||
import exh.GalleryAddEvent
|
||||
@@ -20,7 +22,7 @@ class BatchAddPresenter : BasePresenter<BatchAddController>() {
|
||||
var eventRelay: ReplayRelay<String>? = null
|
||||
val currentlyAddingRelay = BehaviorRelay.create(STATE_IDLE)!!
|
||||
|
||||
fun addGalleries(galleries: String) {
|
||||
fun addGalleries(context: Context, galleries: String) {
|
||||
eventRelay = ReplayRelay.create()
|
||||
val regex =
|
||||
"""[0-9]*?\.[a-z0-9]*?:""".toRegex()
|
||||
@@ -53,7 +55,7 @@ class BatchAddPresenter : BasePresenter<BatchAddController>() {
|
||||
val failed = mutableListOf<String>()
|
||||
|
||||
splitGalleries.forEachIndexed { i, s ->
|
||||
val result = galleryAdder.addGallery(s, true)
|
||||
val result = galleryAdder.addGallery(context, s, true)
|
||||
if (result is GalleryAddEvent.Success) {
|
||||
succeeded.add(s)
|
||||
} else {
|
||||
@@ -63,15 +65,15 @@ class BatchAddPresenter : BasePresenter<BatchAddController>() {
|
||||
eventRelay?.call(
|
||||
(
|
||||
when (result) {
|
||||
is GalleryAddEvent.Success -> "[OK]"
|
||||
is GalleryAddEvent.Fail -> "[ERROR]"
|
||||
is GalleryAddEvent.Success -> context.getString(R.string.batch_add_ok)
|
||||
is GalleryAddEvent.Fail -> context.getString(R.string.batch_add_error)
|
||||
}
|
||||
) + " " + result.logMessage
|
||||
)
|
||||
}
|
||||
|
||||
// Show report
|
||||
val summary = "\nSummary:\nAdded: ${succeeded.size} gallerie(s)\nFailed: ${failed.size} gallerie(s)"
|
||||
val summary = context.getString(R.string.batch_add_summary, succeeded.size, failed.size)
|
||||
eventRelay?.call(summary)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user