Add Strings for secondary graph title for translation

This commit is contained in:
Philoul 2020-05-28 16:26:57 +02:00
parent bfc241f0b2
commit 1a94d3d55e
2 changed files with 17 additions and 11 deletions

View file

@ -61,16 +61,16 @@ class OverviewMenus @Inject constructor(
private val config: Config
) {
enum class CharType(@StringRes val nameId: Int, @ColorRes val colorId: Int, val primary: Boolean, val secondary: Boolean) {
PRE(R.string.overview_show_predictions, R.color.prediction, primary = true, secondary = false),
BAS(R.string.overview_show_basals, R.color.basal, primary = true, secondary = false),
IOB(R.string.overview_show_iob, R.color.iob, primary = false, secondary = true),
COB(R.string.overview_show_cob, R.color.cob, primary = false, secondary = true),
DEV(R.string.overview_show_deviations, R.color.deviations, primary = false, secondary = true),
SEN(R.string.overview_show_sensitivity, R.color.ratio, primary = false, secondary = true),
ACT(R.string.overview_show_activity, R.color.activity, primary = true, secondary = true),
ABS(R.string.overview_show_absinsulin, R.color.iob, primary = false, secondary = true),
DEVSLOPE(R.string.overview_show_deviationslope, R.color.devslopepos, primary = false, secondary = true)
enum class CharType(@StringRes val nameId: Int, @ColorRes val colorId: Int, val primary: Boolean, val secondary: Boolean, @StringRes val shortnameId: Int) {
PRE(R.string.overview_show_predictions, R.color.prediction, primary = true, secondary = false, shortnameId = R.string.prediction_shortname),
BAS(R.string.overview_show_basals, R.color.basal, primary = true, secondary = false,shortnameId = R.string.basal_shortname),
IOB(R.string.overview_show_iob, R.color.iob, primary = false, secondary = true,shortnameId = R.string.iob),
COB(R.string.overview_show_cob, R.color.cob, primary = false, secondary = true,shortnameId = R.string.cob),
DEV(R.string.overview_show_deviations, R.color.deviations, primary = false, secondary = true,shortnameId = R.string.deviation_shortname),
SEN(R.string.overview_show_sensitivity, R.color.ratio, primary = false, secondary = true,shortnameId = R.string.sensitivity_shortname),
ACT(R.string.overview_show_activity, R.color.activity, primary = true, secondary = true,shortnameId = R.string.activity_shortname),
ABS(R.string.overview_show_absinsulin, R.color.iob, primary = false, secondary = true,shortnameId = R.string.abs_insulin_shortname),
DEVSLOPE(R.string.overview_show_deviationslope, R.color.devslopepos, primary = false, secondary = true,shortnameId = R.string.devslope_shortname)
}
companion object {
@ -80,7 +80,7 @@ class OverviewMenus @Inject constructor(
fun enabledTypes(graph: Int): String {
val r = StringBuilder()
for (type in CharType.values()) if (setting[graph][type.ordinal]) {
r.append(type.name)
r.append(resourceHelper.gs(type.shortnameId))
r.append(" ")
}
return r.toString()

View file

@ -527,8 +527,14 @@
<string name="statuslights_bat_warning">Threshold warning battery level [%]</string>
<string name="key_statuslights_bat_critical" translatable="false">statuslights_bat_critical</string>
<string name="statuslights_bat_critical">Threshold critical battery level [%]</string>
<string name="prediction_shortname">PRED</string>
<string name="iob">IOB</string>
<string name="cob">COB</string>
<string name="basal_shortname">BAS</string>
<string name="deviation_shortname">DEV</string>
<string name="activity_shortname">ACT</string>
<string name="abs_insulin_shortname">ABS</string>
<string name="devslope_shortname">DEVSLOPE</string>
<string name="nav_about">About</string>
<string name="smscommunicator_missingsmspermission">Missing SMS permission</string>
<string name="smscommunicator_missingphonestatepermission">Missing phone state permission</string>