Skip to content

Commit

Permalink
Rename string resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Domi04151309 committed Jan 30, 2024
1 parent 58da885 commit 206349d
Show file tree
Hide file tree
Showing 17 changed files with 136 additions and 109 deletions.
24 changes: 12 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
android:parentActivityName=".activities.MainActivity" />
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.ShutdownActivity"
android:label="@string/Shutdown"
android:label="@string/shutdown"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -59,7 +59,7 @@
</activity>
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.RebootActivity"
android:label="@string/Reboot"
android:label="@string/reboot"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -69,7 +69,7 @@
</activity>
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.SafeModeActivity"
android:label="@string/SafeMode"
android:label="@string/reboot_into_safe_mode"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -79,7 +79,7 @@
</activity>
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.BootloaderActivity"
android:label="@string/Bootloader"
android:label="@string/reboot_into_bootloader"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -89,7 +89,7 @@
</activity>
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.EDLActivity"
android:label="@string/EDL"
android:label="@string/reboot_into_edl"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -99,7 +99,7 @@
</activity>
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.SoftRebootActivity"
android:label="@string/SoftReboot"
android:label="@string/soft_reboot"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -109,7 +109,7 @@
</activity>
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.RecoveryActivity"
android:label="@string/Recovery"
android:label="@string/reboot_into_recovery"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -119,7 +119,7 @@
</activity>
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.RestartUIActivity"
android:label="@string/SystemUI"
android:label="@string/restart_system_ui"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -129,7 +129,7 @@
</activity>
<activity
android:name="io.github.domi04151309.powerapp.activities.shortcuts.ScreenOffActivity"
android:label="@string/ScreenOff"
android:label="@string/turn_off_screen"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>
Expand All @@ -150,7 +150,7 @@
<service
android:name=".services.ShutdownTileService"
android:icon="@drawable/ic_shutdown"
android:label="@string/Shutdown"
android:label="@string/shutdown"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="true">
<intent-filter>
Expand All @@ -164,7 +164,7 @@
<service
android:name=".services.RebootTileService"
android:icon="@drawable/ic_reboot"
android:label="@string/Reboot"
android:label="@string/reboot"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="true">
<intent-filter>
Expand All @@ -178,7 +178,7 @@
<service
android:name=".services.RestartSystemUITileService"
android:icon="@drawable/ic_restart"
android:label="@string/SystemUI"
android:label="@string/restart_system_ui"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="true">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,39 @@ class MainActivity : BaseActivity(), RecyclerViewHelperInterface {
private fun getListItems() =
listOf(
SimpleListItem(
title = resources.getString(R.string.Shutdown),
title = resources.getString(R.string.shutdown),
icon = R.drawable.ic_round_shutdown,
),
SimpleListItem(
title = resources.getString(R.string.Reboot),
title = resources.getString(R.string.reboot),
icon = R.drawable.ic_round_reboot,
),
SimpleListItem(
title = resources.getString(R.string.SafeMode),
title = resources.getString(R.string.reboot_into_safe_mode),
icon = R.drawable.ic_round_safe_mode,
),
SimpleListItem(
title = resources.getString(R.string.Recovery),
title = resources.getString(R.string.reboot_into_recovery),
icon = R.drawable.ic_round_recovery,
),
SimpleListItem(
title = resources.getString(R.string.Bootloader),
title = resources.getString(R.string.reboot_into_bootloader),
icon = R.drawable.ic_round_bootloader,
),
SimpleListItem(
title = resources.getString(R.string.EDL),
title = resources.getString(R.string.reboot_into_edl),
icon = R.drawable.ic_round_edl,
),
SimpleListItem(
title = resources.getString(R.string.SoftReboot),
title = resources.getString(R.string.soft_reboot),
icon = R.drawable.ic_round_soft_reboot,
),
SimpleListItem(
title = resources.getString(R.string.SystemUI),
title = resources.getString(R.string.restart_system_ui),
icon = R.drawable.ic_round_restart_system_ui,
),
SimpleListItem(
title = resources.getString(R.string.ScreenOff),
title = resources.getString(R.string.turn_off_screen),
icon = R.drawable.ic_round_screen_off,
),
)
Expand Down Expand Up @@ -94,15 +94,42 @@ class MainActivity : BaseActivity(), RecyclerViewHelperInterface {
override fun onItemClicked(position: Int) {
val powerOptions = PowerOptions(this, true)
when (position) {
LIST_ITEM_SHUTDOWN -> askBefore(R.string.Shutdown) { powerOptions.shutdown() }
LIST_ITEM_REBOOT -> askBefore(R.string.Reboot) { powerOptions.reboot() }
LIST_ITEM_REBOOT_INTO_SAFE_MODE -> askBefore(R.string.SafeMode) { powerOptions.rebootIntoSafeMode() }
LIST_ITEM_REBOOT_INTO_RECOVERY -> askBefore(R.string.Recovery) { powerOptions.rebootIntoRecovery() }
LIST_ITEM_REBOOT_INTO_BOOTLOADER -> askBefore(R.string.Bootloader) { powerOptions.rebootIntoBootloader() }
LIST_ITEM_REBOOT_INTO_EDL -> askBefore(R.string.EDL) { powerOptions.rebootIntoEDL() }
LIST_ITEM_SOFT_REBOOT -> askBefore(R.string.SoftReboot) { powerOptions.softReboot() }
LIST_ITEM_RESTART_SYSTEM_UI -> askBefore(R.string.SystemUI) { powerOptions.restartSystemUI() }
LIST_ITEM_TURN_OFF_SCREEN -> askBefore(R.string.ScreenOff) { powerOptions.turnOffScreen() }
LIST_ITEM_SHUTDOWN ->
askBefore(R.string.shutdown) {
powerOptions.shutdown()
}
LIST_ITEM_REBOOT ->
askBefore(R.string.reboot) {
powerOptions.reboot()
}
LIST_ITEM_REBOOT_INTO_SAFE_MODE ->
askBefore(R.string.reboot_into_safe_mode) {
powerOptions.rebootIntoSafeMode()
}
LIST_ITEM_REBOOT_INTO_RECOVERY ->
askBefore(R.string.reboot_into_recovery) {
powerOptions.rebootIntoRecovery()
}
LIST_ITEM_REBOOT_INTO_BOOTLOADER ->
askBefore(R.string.reboot_into_bootloader) {
powerOptions.rebootIntoBootloader()
}
LIST_ITEM_REBOOT_INTO_EDL ->
askBefore(R.string.reboot_into_edl) {
powerOptions.rebootIntoEDL()
}
LIST_ITEM_SOFT_REBOOT ->
askBefore(R.string.soft_reboot) {
powerOptions.softReboot()
}
LIST_ITEM_RESTART_SYSTEM_UI ->
askBefore(R.string.restart_system_ui) {
powerOptions.restartSystemUI()
}
LIST_ITEM_TURN_OFF_SCREEN ->
askBefore(R.string.turn_off_screen) {
powerOptions.turnOffScreen()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class BootloaderActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.Bootloader)
override fun getShortcutName(): String = resources.getString(R.string.reboot_into_bootloader)

override fun onOpened() {
PowerOptions(this).rebootIntoBootloader()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class EDLActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.EDL)
override fun getShortcutName(): String = resources.getString(R.string.reboot_into_edl)

override fun onOpened() {
PowerOptions(this).rebootIntoEDL()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class RebootActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.Reboot)
override fun getShortcutName(): String = resources.getString(R.string.reboot)

override fun onOpened() {
PowerOptions(this).reboot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class RecoveryActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.Recovery)
override fun getShortcutName(): String = resources.getString(R.string.reboot_into_recovery)

override fun onOpened() {
PowerOptions(this).rebootIntoRecovery()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class RestartUIActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.SystemUI)
override fun getShortcutName(): String = resources.getString(R.string.restart_system_ui)

override fun onOpened() {
PowerOptions(this).restartSystemUI()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class SafeModeActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.SafeMode)
override fun getShortcutName(): String = resources.getString(R.string.reboot_into_safe_mode)

override fun onOpened() {
PowerOptions(this).rebootIntoSafeMode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class ScreenOffActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.ScreenOff)
override fun getShortcutName(): String = resources.getString(R.string.turn_off_screen)

override fun onOpened() {
PowerOptions(this).turnOffScreen()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class ShutdownActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.Shutdown)
override fun getShortcutName(): String = resources.getString(R.string.shutdown)

override fun onOpened() {
PowerOptions(this).shutdown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.github.domi04151309.powerapp.R
import io.github.domi04151309.powerapp.helpers.PowerOptions

class SoftRebootActivity : ShortcutActivity() {
override fun getShortcutName(): String = resources.getString(R.string.SoftReboot)
override fun getShortcutName(): String = resources.getString(R.string.soft_reboot)

override fun onOpened() {
PowerOptions(this).softReboot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class ControlService : ControlsProviderService() {
private var updateSubscriber: Flow.Subscriber<in Control>? = null
private val items: Map<String, Int> =
mapOf(
Pair("shutdown", R.string.Shutdown),
Pair("reboot", R.string.Reboot),
Pair("safe_mode", R.string.SafeMode),
Pair("recovery", R.string.Recovery),
Pair("bootloader", R.string.Bootloader),
Pair("edl", R.string.EDL),
Pair("soft_reboot", R.string.SoftReboot),
Pair("restart_system_ui", R.string.SystemUI),
Pair("screen_off", R.string.ScreenOff),
Pair("shutdown", R.string.shutdown),
Pair("reboot", R.string.reboot),
Pair("safe_mode", R.string.reboot_into_safe_mode),
Pair("recovery", R.string.reboot_into_recovery),
Pair("bootloader", R.string.reboot_into_bootloader),
Pair("edl", R.string.reboot_into_edl),
Pair("soft_reboot", R.string.soft_reboot),
Pair("restart_system_ui", R.string.restart_system_ui),
Pair("screen_off", R.string.turn_off_screen),
)

override fun createPublisherForAllAvailable(): Flow.Publisher<Control> =
Expand Down
18 changes: 9 additions & 9 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

<string name="loading">Lädt</string>

<string name="Shutdown">Herunterfahren</string>
<string name="Reboot">Neu starten</string>
<string name="SafeMode">In den sicheren Modus neu starten</string>
<string name="Recovery">In den Wiederherstellungsmodus neu starten</string>
<string name="Bootloader">In den Bootloader neu starten</string>
<string name="EDL">In EDL neu starten</string>
<string name="SoftReboot">Sanft neu starten</string>
<string name="SystemUI">System UI neu starten</string>
<string name="ScreenOff">Bildschirm ausschalten</string>
<string name="shutdown">Herunterfahren</string>
<string name="reboot">Neu starten</string>
<string name="reboot_into_safe_mode">In den sicheren Modus neu starten</string>
<string name="reboot_into_recovery">In den Wiederherstellungsmodus neu starten</string>
<string name="reboot_into_bootloader">In den Bootloader neu starten</string>
<string name="reboot_into_edl">In EDL neu starten</string>
<string name="soft_reboot">Sanft neu starten</string>
<string name="restart_system_ui">System UI neu starten</string>
<string name="turn_off_screen">Bildschirm ausschalten</string>

<string name="confirm_dialog">Sind Sie sich sicher?</string>
<string name="confirm_dialog_summary">Sind Sie sich sicher, dass Sie den ausgewählten Befehl ausführen wollen?</string>
Expand Down
18 changes: 9 additions & 9 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<resources>
<string name="app_name">Gestion de l\’énergie</string>

<string name="Shutdown">Éteindre</string>
<string name="Reboot">Redémarrer</string>
<string name="SafeMode">Redémarrer en mode sans échec</string>
<string name="Recovery">Redémarrer vers l\’outil de récupération</string>
<string name="Bootloader">Redémarrer vers le chargeur de démarrage</string>
<string name="EDL">Redémarrer vers l\’EDL</string>
<string name="SoftReboot">Redémarrage logiciel</string>
<string name="SystemUI">Redémarrer l\’interface utilisateur</string>
<string name="ScreenOff">Éteindre l\’écran</string>
<string name="shutdown">Éteindre</string>
<string name="reboot">Redémarrer</string>
<string name="reboot_into_safe_mode">Redémarrer en mode sans échec</string>
<string name="reboot_into_recovery">Redémarrer vers l\’outil de récupération</string>
<string name="reboot_into_bootloader">Redémarrer vers le chargeur de démarrage</string>
<string name="reboot_into_edl">Redémarrer vers l\’EDL</string>
<string name="soft_reboot">Redémarrage logiciel</string>
<string name="restart_system_ui">Redémarrer l\’interface utilisateur</string>
<string name="turn_off_screen">Éteindre l\’écran</string>

<string name="confirm_dialog">Veuillez confirmer</string>
<string name="confirm_dialog_summary">Voulez-vous vraiment réaliser l\’action sélectionnée ?</string>
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<resources>
<string name="app_name">Energie-app</string>

<string name="Shutdown">Afsluiten</string>
<string name="Reboot">Opnieuw starten</string>
<string name="Recovery">Herstelmodus starten</string>
<string name="Bootloader">Opstartlader starten</string>
<string name="SoftReboot">Zacht opnieuw starten</string>
<string name="SystemUI">Startscherm opnieuw starten</string>
<string name="ScreenOff">Scherm uitschakelen</string>
<string name="shutdown">Afsluiten</string>
<string name="reboot">Opnieuw starten</string>
<string name="reboot_into_recovery">Herstelmodus starten</string>
<string name="reboot_into_bootloader">Opstartlader starten</string>
<string name="soft_reboot">Zacht opnieuw starten</string>
<string name="restart_system_ui">Startscherm opnieuw starten</string>
<string name="turn_off_screen">Scherm uitschakelen</string>

<string name="action_failed">Actie mislukt</string>
<string name="action_failed_summary">Root is vereist - schakel root in.</string>
Expand Down
Loading

0 comments on commit 206349d

Please sign in to comment.