Skip to content

Commit

Permalink
[freeboxos] Internationalize thing actions (#17794)
Browse files Browse the repository at this point in the history
Fix #17635

Signed-off-by: Laurent Garnier <[email protected]>
  • Loading branch information
lolodomo authored Nov 30, 2024
1 parent 15c1d2e commit 3ae78a0
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setThingHandler(@Nullable ThingHandler handler) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setThingHandler(@Nullable ThingHandler handler) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setThingHandler(@Nullable ThingHandler handler) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public void setThingHandler(@Nullable ThingHandler handler) {
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) {
Expand All @@ -60,8 +60,8 @@ public void sendKey(@ActionInput(name = "key") String key) {
}
}

@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) {
Expand All @@ -71,8 +71,9 @@ public void sendLongKey(@ActionInput(name = "key") String key) {
}
}

@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) {
Expand All @@ -82,8 +83,9 @@ public void sendMultipleKeys(@ActionInput(name = "keys") String keys) {
}
}

@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setThingHandler(@Nullable ThingHandler handler) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setThingHandler(@Nullable ThingHandler handler) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3ae78a0

Please sign in to comment.