mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Migrate to multiplatform string resources (#10147)
* Migrate to multiplatform string resources * Move plurals translations into separate files * Fix lint check on generated files
This commit is contained in:
parent
c39ae21f4a
commit
46e734fc8e
340 changed files with 5741 additions and 6292 deletions
|
@ -24,6 +24,7 @@ dependencies {
|
|||
implementation(project(":core"))
|
||||
implementation(project(":domain"))
|
||||
implementation(project(":presentation-core"))
|
||||
api(project(":i18n"))
|
||||
|
||||
implementation(compose.glance)
|
||||
lintChecks(compose.lintchecks)
|
||||
|
|
|
@ -16,8 +16,8 @@ import androidx.glance.text.TextAlign
|
|||
import androidx.glance.text.TextStyle
|
||||
import androidx.glance.unit.ColorProvider
|
||||
import tachiyomi.core.Constants
|
||||
import tachiyomi.presentation.widget.R
|
||||
import tachiyomi.presentation.widget.util.stringResource
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
|
||||
@Composable
|
||||
fun LockedWidget(
|
||||
|
@ -34,7 +34,7 @@ fun LockedWidget(
|
|||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.appwidget_unavailable_locked),
|
||||
text = localize(MR.strings.appwidget_unavailable_locked),
|
||||
style = TextStyle(
|
||||
color = foreground,
|
||||
fontSize = 12.sp,
|
||||
|
|
|
@ -23,9 +23,9 @@ import androidx.glance.text.TextStyle
|
|||
import androidx.glance.unit.ColorProvider
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import tachiyomi.core.Constants
|
||||
import tachiyomi.presentation.widget.R
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.localize
|
||||
import tachiyomi.presentation.widget.util.calculateRowAndColumnCount
|
||||
import tachiyomi.presentation.widget.util.stringResource
|
||||
|
||||
@Composable
|
||||
fun UpdatesWidget(
|
||||
|
@ -43,7 +43,7 @@ fun UpdatesWidget(
|
|||
CircularProgressIndicator(color = contentColor)
|
||||
} else if (data.isEmpty()) {
|
||||
Text(
|
||||
text = stringResource(R.string.information_no_recent),
|
||||
text = localize(MR.strings.information_no_recent),
|
||||
style = TextStyle(color = contentColor),
|
||||
)
|
||||
} else {
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package tachiyomi.presentation.widget.util
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.DpSize
|
||||
import androidx.glance.GlanceModifier
|
||||
import androidx.glance.LocalContext
|
||||
import androidx.glance.appwidget.cornerRadius
|
||||
import tachiyomi.presentation.widget.R
|
||||
|
||||
|
@ -17,11 +14,6 @@ fun GlanceModifier.appWidgetInnerRadius(): GlanceModifier {
|
|||
return this.cornerRadius(R.dimen.appwidget_inner_radius)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun stringResource(@StringRes id: Int): String {
|
||||
return LocalContext.current.getString(id)
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates row-column count.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue