[freeboxos] Internationalize thing actions (#17794)

Fix #17635

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2024-11-30 22:38:04 +01:00 committed by GitHub
parent 15c1d2eaf7
commit 3ae78a0f91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 44 additions and 14 deletions

View File

@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
public class ActivePlayerActions extends PlayerActions {
private final Logger logger = LoggerFactory.getLogger(ActivePlayerActions.class);
@RuleAction(label = "reboot freebox player", description = "Reboots the Freebox Player")
@RuleAction(label = "@text/action.rebootPlayer.label", description = "@text/action.rebootPlayer.description")
public void rebootPlayer() {
logger.debug("Player reboot called");
PlayerHandler localHandler = this.handler;

View File

@ -48,7 +48,7 @@ public class CallActions implements ThingActions {
return handler;
}
@RuleAction(label = "clear call queue", description = "Deletes all calls logged in the queue")
@RuleAction(label = "@text/action.resetCalls.label", description = "@text/action.resetCalls.description")
public void resetCalls() {
logger.debug("Call log clear called");
CallHandler localHandler = handler;

View File

@ -48,7 +48,7 @@ public class FreeplugActions implements ThingActions {
return this.handler;
}
@RuleAction(label = "reset freeplug", description = "Resets the Freeplug")
@RuleAction(label = "@text/action.resetPlug.label", description = "@text/action.resetPlug.description")
public void resetPlug() {
logger.debug("Freeplug reset requested");
FreeplugHandler plugHandler = this.handler;

View File

@ -48,7 +48,7 @@ public class HostActions implements ThingActions {
return this.handler;
}
@RuleAction(label = "wol host", description = "Sends a wake on lan packet to the lan connected host")
@RuleAction(label = "@text/action.wol.label", description = "@text/action.wol.description")
public void wol() {
logger.debug("Host WOL called");
HostHandler hostHandler = this.handler;

View File

@ -49,8 +49,8 @@ public class PlayerActions implements ThingActions {
return this.handler;
}
@RuleAction(label = "send a key to player", description = "Sends a given key to the player")
public void sendKey(@ActionInput(name = "key") String key) {
@RuleAction(label = "@text/action.sendKey.label", description = "@text/action.sendKey.description")
public void sendKey(@ActionInput(name = "key", label = "@text/action.input.key.label") String key) {
logger.debug("Sending key {} to player", key);
PlayerHandler playerHandler = this.handler;
if (playerHandler != null) {
@ -60,8 +60,8 @@ public class PlayerActions implements ThingActions {
}
}
@RuleAction(label = "send a long key to player", description = "Sends a given key to the player and keep it pressed")
public void sendLongKey(@ActionInput(name = "key") String key) {
@RuleAction(label = "@text/action.sendLongKey.label", description = "@text/action.sendLongKey.description")
public void sendLongKey(@ActionInput(name = "key", label = "@text/action.input.key.label") String key) {
logger.debug("Sending long press key {} to player", key);
PlayerHandler playerHandler = this.handler;
if (playerHandler != null) {
@ -71,8 +71,9 @@ public class PlayerActions implements ThingActions {
}
}
@RuleAction(label = "send multiple keys to player", description = "Sends multiple keys to the player, comma separated")
public void sendMultipleKeys(@ActionInput(name = "keys") String keys) {
@RuleAction(label = "@text/action.sendMultipleKeys.label", description = "@text/action.sendMultipleKeys.description")
public void sendMultipleKeys(
@ActionInput(name = "keys", label = "@text/action.sendMultipleKeys.input.keys.label", description = "@text/action.sendMultipleKeys.input.keys.description") String keys) {
logger.debug("Sending keys {} to player", keys);
PlayerHandler playerHandler = this.handler;
if (playerHandler != null) {
@ -82,8 +83,9 @@ public class PlayerActions implements ThingActions {
}
}
@RuleAction(label = "send repeating key to player", description = "Sends a given key multiple times to the player")
public void sendKeyRepeat(@ActionInput(name = "key") String key, @ActionInput(name = "count") int count) {
@RuleAction(label = "@text/action.sendKeyRepeat.label", description = "@text/action.sendKeyRepeat.description")
public void sendKeyRepeat(@ActionInput(name = "key", label = "@text/action.input.key.label") String key,
@ActionInput(name = "count", label = "@text/action.sendKeyRepeat.input.count.label", description = "@text/action.sendKeyRepeat.input.count.description") int count) {
logger.debug("Sending key {} to player {} times", key, count);
PlayerHandler playerHandler = this.handler;
if (playerHandler != null) {

View File

@ -48,7 +48,7 @@ public class RepeaterActions implements ThingActions {
return handler;
}
@RuleAction(label = "reboot free repeater", description = "Reboots the Free Repeater")
@RuleAction(label = "@text/action.rebootRepeater.label", description = "@text/action.rebootRepeater.description")
public void rebootRepeater() {
logger.debug("Repeater reboot called");
RepeaterHandler localHandler = this.handler;

View File

@ -48,7 +48,7 @@ public class ServerActions implements ThingActions {
return this.handler;
}
@RuleAction(label = "reboot freebox server", description = "Reboots the Freebox Server")
@RuleAction(label = "@text/action.rebootServer.label", description = "@text/action.rebootServer.description")
public void rebootServer() {
logger.debug("Server reboot called");
ServerHandler serverHandler = this.handler;

View File

@ -418,3 +418,31 @@ discovery.vm.label = Virtual Machine {0}
iconset.label = FreeboxOS Icons
iconset.description = Icons provided by FreeboxOS itself
# actions
action.resetCalls.label = clear call queue
action.resetCalls.description = Deletes all calls logged in the queue
action.resetPlug.label = reset freeplug
action.resetPlug.description = Resets the Freeplug
action.wol.label = wol host
action.wol.description = Sends a wake on lan packet to the lan connected host
action.rebootPlayer.label = reboot freebox player
action.rebootPlayer.description = Reboots the Freebox Player
action.rebootRepeater.label = reboot free repeater
action.rebootRepeater.description = Reboots the Free Repeater
action.rebootServer.label = reboot freebox server
action.rebootServer.description = Reboots the Freebox Server
action.input.key.label = Key
action.sendKey.label = send a key to player
action.sendKey.description = Sends a given key to the player
action.sendLongKey.label = send a long key to player
action.sendLongKey.description = Sends a given key to the player and keep it pressed
action.sendMultipleKeys.label = send multiple keys to player
action.sendMultipleKeys.description = Sends multiple keys to the player
action.sendMultipleKeys.input.keys.label = Keys
action.sendMultipleKeys.input.keys.description = Comma separated list of keys
action.sendKeyRepeat.label = send repeating key to player
action.sendKeyRepeat.description = Sends a given key multiple times to the player
action.sendKeyRepeat.input.count.label = Count
action.sendKeyRepeat.input.count.description = Number of times the key will be repeated