Skip to content

Commit 250232a

Browse files
committed
XD
1 parent 97070db commit 250232a

File tree

13 files changed

+249
-31
lines changed

13 files changed

+249
-31
lines changed

afk/commands.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ lia.command.add("afktoggle", {
66
type = "player"
77
}
88
},
9-
desc = "Toggle AFK status on a player",
9+
desc = L("afkCommandDesc"),
1010
onRun = function(client, arguments)
1111
local target = lia.util.findPlayer(client, arguments[1])
1212
if not IsValid(target) then return "@invalidTarget" end
13-
if not lia.config.get("AFKProtectionEnabled", true) then return "AFK protection is disabled." end
13+
if not lia.config.get("AFKProtectionEnabled", true) then return L("afkProtectionDisabled") end
1414
local isAFK = target:getNetVar("isAFK", false)
1515
if isAFK then
1616
target:setNetVar("isAFK", false)
1717
target:setNetVar("lastActivity", CurTime())
18-
client:notify("Removed AFK status from " .. target:Name())
19-
target:notify("Your AFK status has been removed by an admin.")
18+
client:notify(L("afkStatusRemoved", target:Name()))
19+
target:notify(L("afkStatusRemovedByAdmin"))
2020
else
2121
target:setNetVar("isAFK", true)
2222
target:setNetVar("afkTime", CurTime())
23-
client:notify("Set AFK status on " .. target:Name())
24-
target:notify("You have been marked as AFK by an admin.")
23+
client:notify(L("afkStatusSet", target:Name()))
24+
target:notify(L("afkStatusSetByAdmin"))
2525
end
2626
end
2727
})
@@ -35,18 +35,18 @@ lia.command.add("afkstatus", {
3535
optional = true
3636
}
3737
},
38-
desc = "Check AFK status of a player or all players",
38+
desc = L("afkStatusCommandDesc"),
3939
onRun = function(client, arguments)
40-
if not lia.config.get("AFKProtectionEnabled", true) then return "AFK protection is disabled." end
40+
if not lia.config.get("AFKProtectionEnabled", true) then return L("afkProtectionDisabled") end
4141
local target = arguments[1] and lia.util.findPlayer(client, arguments[1])
4242
if target then
4343
local isAFK = target:getNetVar("isAFK", false)
4444
local lastActivity = target:getNetVar("lastActivity", 0)
4545
local afkTime = target:getNetVar("afkTime", 0)
4646
local timeSinceActivity = CurTime() - lastActivity
4747
local timeAFK = isAFK and (CurTime() - afkTime) or 0
48-
local status = isAFK and "AFK" or "Active"
49-
client:notify(string.format("%s: %s (Last Activity: %.1fs ago, AFK Time: %.1fs)", target:Name(), status, timeSinceActivity, timeAFK))
48+
local status = isAFK and L("afkStatus") or L("activePlayers")
49+
client:notify(string.format("%s: %s (" .. L("lastActivity") .. ": %.1fs ago, " .. L("afkTimeLabel") .. ": %.1fs)", target:Name(), status, timeSinceActivity, timeAFK))
5050
else
5151
local afkPlayers = {}
5252
local activePlayers = {}
@@ -65,14 +65,14 @@ lia.command.add("afkstatus", {
6565
end
6666
end
6767

68-
client:notify("=== AFK Status ===")
68+
client:notify("=== " .. L("afkStatus") .. " ===")
6969
if #afkPlayers > 0 then
70-
client:notify("AFK Players: " .. table.concat(afkPlayers, ", "))
70+
client:notify(L("afkPlayers") .. ": " .. table.concat(afkPlayers, ", "))
7171
else
72-
client:notify("No players are currently AFK")
72+
client:notify(L("noPlayersAFK"))
7373
end
7474

75-
if #activePlayers > 0 then client:notify("Active Players: " .. table.concat(activePlayers, ", ")) end
75+
if #activePlayers > 0 then client:notify(L("activePlayers") .. ": " .. table.concat(activePlayers, ", ")) end
7676
end
7777
end
7878
})

afk/config.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
lia.config.add("AFKTime", "AFK Time", 180, nil, {
2-
desc = "Time in seconds before a player is considered AFK",
3-
category = "AFK Protection",
1+
lia.config.add("AFKTime", L("afkTime"), 180, nil, {
2+
desc = L("afkTimeDesc"),
3+
category = L("afkProtection"),
44
type = "Int",
55
min = 30,
66
max = 600
77
})
88

9-
lia.config.add("AFKProtectionEnabled", "AFK Protection Enabled", true, nil, {
10-
desc = "Enable or disable AFK protection system",
11-
category = "AFK Protection",
9+
lia.config.add("AFKProtectionEnabled", L("afkProtectionEnabled"), true, nil, {
10+
desc = L("afkProtectionEnabledDesc"),
11+
category = L("afkProtection"),
1212
type = "Boolean"
1313
})

afk/docs/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Version 1.1
2+
3+
- Added comprehensive multi-language support (English, Spanish, French, German, Russian, Portuguese, Italian)
4+
- Updated all hardcoded strings to use language system
5+
- Enhanced module description with detailed feature list
6+
- Improved documentation with complete feature overview
7+
- Updated version number to reflect improvements
8+
19
# Version 1.0
210

311
- Initial Release

afk/languages/english.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
NAME = "English"
2+
LANGUAGE = {
3+
afkCommandDesc = "Toggle AFK status on a player",
4+
afkStatusCommandDesc = "Check AFK status of a player or all players",
5+
afkProtectionEnabled = "AFK Protection Enabled",
6+
afkProtectionEnabledDesc = "Enable or disable AFK protection system",
7+
afkTime = "AFK Time",
8+
afkTimeDesc = "Time in seconds before a player is considered AFK",
9+
afkProtection = "AFK Protection",
10+
afkStatusRemoved = "Removed AFK status from %s",
11+
afkStatusSet = "Set AFK status on %s",
12+
afkStatusRemovedByAdmin = "Your AFK status has been removed by an admin.",
13+
afkStatusSetByAdmin = "You have been marked as AFK by an admin.",
14+
afkProtectionDisabled = "AFK protection is disabled.",
15+
afkStatus = "AFK Status",
16+
afkPlayers = "AFK Players",
17+
activePlayers = "Active Players",
18+
noPlayersAFK = "No players are currently AFK",
19+
afkForTime = "AFK for %s",
20+
youAreAFK = "YOU ARE AFK",
21+
time = "Time",
22+
lastActivity = "Last Activity",
23+
afkTimeLabel = "AFK Time",
24+
cannotBeRestrained = "This player is AFK and cannot be restrained.",
25+
cannotBeUnrestrained = "This player is AFK and cannot be unrestrained.",
26+
cannotBeArrested = "This player is AFK and cannot be arrested.",
27+
cannotBeUnarrested = "This player is AFK and cannot be unarrested.",
28+
cannotBeStunned = "This player is AFK and cannot be stunned.",
29+
cannotBeKnockedOut = "This player is AFK and cannot be knocked out.",
30+
}

afk/languages/french.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
NAME = "French"
2+
LANGUAGE = {
3+
afkCommandDesc = "Basculer le statut AFK d'un joueur",
4+
afkStatusCommandDesc = "Vérifier le statut AFK d'un joueur ou de tous les joueurs",
5+
afkProtectionEnabled = "Protection AFK Activée",
6+
afkProtectionEnabledDesc = "Activer ou désactiver le système de protection AFK",
7+
afkTime = "Temps AFK",
8+
afkTimeDesc = "Temps en secondes avant qu'un joueur soit considéré comme AFK",
9+
afkProtection = "Protection AFK",
10+
afkStatusRemoved = "Statut AFK retiré de %s",
11+
afkStatusSet = "Statut AFK défini sur %s",
12+
afkStatusRemovedByAdmin = "Votre statut AFK a été retiré par un administrateur.",
13+
afkStatusSetByAdmin = "Vous avez été marqué comme AFK par un administrateur.",
14+
afkProtectionDisabled = "La protection AFK est désactivée.",
15+
afkStatus = "Statut AFK",
16+
afkPlayers = "Joueurs AFK",
17+
activePlayers = "Joueurs Actifs",
18+
noPlayersAFK = "Aucun joueur n'est actuellement AFK",
19+
afkForTime = "AFK depuis %s",
20+
youAreAFK = "VOUS ÊTES AFK",
21+
time = "Temps",
22+
lastActivity = "Dernière Activité",
23+
afkTimeLabel = "Temps AFK",
24+
cannotBeRestrained = "Ce joueur est AFK et ne peut pas être attaché.",
25+
cannotBeUnrestrained = "Ce joueur est AFK et ne peut pas être détaché.",
26+
cannotBeArrested = "Ce joueur est AFK et ne peut pas être arrêté.",
27+
cannotBeUnarrested = "Ce joueur est AFK et ne peut pas être libéré.",
28+
cannotBeStunned = "Ce joueur est AFK et ne peut pas être étourdi.",
29+
cannotBeKnockedOut = "Ce joueur est AFK et ne peut pas être assommé.",
30+
}

afk/languages/german.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
NAME = "German"
2+
LANGUAGE = {
3+
afkCommandDesc = "AFK-Status eines Spielers umschalten",
4+
afkStatusCommandDesc = "AFK-Status eines Spielers oder aller Spieler überprüfen",
5+
afkProtectionEnabled = "AFK-Schutz Aktiviert",
6+
afkProtectionEnabledDesc = "AFK-Schutzsystem aktivieren oder deaktivieren",
7+
afkTime = "AFK-Zeit",
8+
afkTimeDesc = "Zeit in Sekunden, bevor ein Spieler als AFK betrachtet wird",
9+
afkProtection = "AFK-Schutz",
10+
afkStatusRemoved = "AFK-Status von %s entfernt",
11+
afkStatusSet = "AFK-Status auf %s gesetzt",
12+
afkStatusRemovedByAdmin = "Ihr AFK-Status wurde von einem Administrator entfernt.",
13+
afkStatusSetByAdmin = "Sie wurden von einem Administrator als AFK markiert.",
14+
afkProtectionDisabled = "AFK-Schutz ist deaktiviert.",
15+
afkStatus = "AFK-Status",
16+
afkPlayers = "AFK-Spieler",
17+
activePlayers = "Aktive Spieler",
18+
noPlayersAFK = "Derzeit sind keine Spieler AFK",
19+
afkForTime = "AFK für %s",
20+
youAreAFK = "SIE SIND AFK",
21+
time = "Zeit",
22+
lastActivity = "Letzte Aktivität",
23+
afkTimeLabel = "AFK-Zeit",
24+
cannotBeRestrained = "Dieser Spieler ist AFK und kann nicht gefesselt werden.",
25+
cannotBeUnrestrained = "Dieser Spieler ist AFK und kann nicht entfesselt werden.",
26+
cannotBeArrested = "Dieser Spieler ist AFK und kann nicht verhaftet werden.",
27+
cannotBeUnarrested = "Dieser Spieler ist AFK und kann nicht freigelassen werden.",
28+
cannotBeStunned = "Dieser Spieler ist AFK und kann nicht betäubt werden.",
29+
cannotBeKnockedOut = "Dieser Spieler ist AFK und kann nicht bewusstlos geschlagen werden.",
30+
}

afk/languages/italian.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
NAME = "Italian"
2+
LANGUAGE = {
3+
afkCommandDesc = "Attiva/disattiva lo stato AFK di un giocatore",
4+
afkStatusCommandDesc = "Controlla lo stato AFK di un giocatore o tutti i giocatori",
5+
afkProtectionEnabled = "Protezione AFK Abilitata",
6+
afkProtectionEnabledDesc = "Abilita o disabilita il sistema di protezione AFK",
7+
afkTime = "Tempo AFK",
8+
afkTimeDesc = "Tempo in secondi prima che un giocatore sia considerato AFK",
9+
afkProtection = "Protezione AFK",
10+
afkStatusRemoved = "Stato AFK rimosso da %s",
11+
afkStatusSet = "Stato AFK impostato su %s",
12+
afkStatusRemovedByAdmin = "Il tuo stato AFK è stato rimosso da un amministratore.",
13+
afkStatusSetByAdmin = "Sei stato marcato come AFK da un amministratore.",
14+
afkProtectionDisabled = "La protezione AFK è disabilitata.",
15+
afkStatus = "Stato AFK",
16+
afkPlayers = "Giocatori AFK",
17+
activePlayers = "Giocatori Attivi",
18+
noPlayersAFK = "Nessun giocatore è attualmente AFK",
19+
afkForTime = "AFK per %s",
20+
youAreAFK = "SEI AFK",
21+
time = "Tempo",
22+
lastActivity = "Ultima Attività",
23+
afkTimeLabel = "Tempo AFK",
24+
cannotBeRestrained = "Questo giocatore è AFK e non può essere legato.",
25+
cannotBeUnrestrained = "Questo giocatore è AFK e non può essere slegato.",
26+
cannotBeArrested = "Questo giocatore è AFK e non può essere arrestato.",
27+
cannotBeUnarrested = "Questo giocatore è AFK e non può essere rilasciato.",
28+
cannotBeStunned = "Questo giocatore è AFK e non può essere stordito.",
29+
cannotBeKnockedOut = "Questo giocatore è AFK e non può essere stordito.",
30+
}

afk/languages/portuguese.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
NAME = "Portuguese"
2+
LANGUAGE = {
3+
afkCommandDesc = "Alternar status AFK de um jogador",
4+
afkStatusCommandDesc = "Verificar status AFK de um jogador ou todos os jogadores",
5+
afkProtectionEnabled = "Proteção AFK Habilitada",
6+
afkProtectionEnabledDesc = "Habilitar ou desabilitar sistema de proteção AFK",
7+
afkTime = "Tempo AFK",
8+
afkTimeDesc = "Tempo em segundos antes de um jogador ser considerado AFK",
9+
afkProtection = "Proteção AFK",
10+
afkStatusRemoved = "Status AFK removido de %s",
11+
afkStatusSet = "Status AFK definido em %s",
12+
afkStatusRemovedByAdmin = "Seu status AFK foi removido por um administrador.",
13+
afkStatusSetByAdmin = "Você foi marcado como AFK por um administrador.",
14+
afkProtectionDisabled = "Proteção AFK está desabilitada.",
15+
afkStatus = "Status AFK",
16+
afkPlayers = "Jogadores AFK",
17+
activePlayers = "Jogadores Ativos",
18+
noPlayersAFK = "Nenhum jogador está AFK atualmente",
19+
afkForTime = "AFK por %s",
20+
youAreAFK = "VOCÊ ESTÁ AFK",
21+
time = "Tempo",
22+
lastActivity = "Última Atividade",
23+
afkTimeLabel = "Tempo AFK",
24+
cannotBeRestrained = "Este jogador está AFK e não pode ser amarrado.",
25+
cannotBeUnrestrained = "Este jogador está AFK e não pode ser desamarrado.",
26+
cannotBeArrested = "Este jogador está AFK e não pode ser preso.",
27+
cannotBeUnarrested = "Este jogador está AFK e não pode ser solto.",
28+
cannotBeStunned = "Este jogador está AFK e não pode ser atordoado.",
29+
cannotBeKnockedOut = "Este jogador está AFK e não pode ser nocauteado.",
30+
}

afk/languages/russian.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
NAME = "Russian"
2+
LANGUAGE = {
3+
afkCommandDesc = "Переключить статус AFK игрока",
4+
afkStatusCommandDesc = "Проверить статус AFK игрока или всех игроков",
5+
afkProtectionEnabled = "Защита AFK Включена",
6+
afkProtectionEnabledDesc = "Включить или отключить систему защиты AFK",
7+
afkTime = "Время AFK",
8+
afkTimeDesc = "Время в секундах, прежде чем игрок будет считаться AFK",
9+
afkProtection = "Защита AFK",
10+
afkStatusRemoved = "Статус AFK удален у %s",
11+
afkStatusSet = "Статус AFK установлен у %s",
12+
afkStatusRemovedByAdmin = "Ваш статус AFK был удален администратором.",
13+
afkStatusSetByAdmin = "Вы были отмечены как AFK администратором.",
14+
afkProtectionDisabled = "Защита AFK отключена.",
15+
afkStatus = "Статус AFK",
16+
afkPlayers = "AFK Игроки",
17+
activePlayers = "Активные Игроки",
18+
noPlayersAFK = "В настоящее время нет AFK игроков",
19+
afkForTime = "AFK в течение %s",
20+
youAreAFK = "ВЫ AFK",
21+
time = "Время",
22+
lastActivity = "Последняя Активность",
23+
afkTimeLabel = "Время AFK",
24+
cannotBeRestrained = "Этот игрок AFK и не может быть связан.",
25+
cannotBeUnrestrained = "Этот игрок AFK и не может быть развязан.",
26+
cannotBeArrested = "Этот игрок AFK и не может быть арестован.",
27+
cannotBeUnarrested = "Этот игрок AFK и не может быть освобожден.",
28+
cannotBeStunned = "Этот игрок AFK и не может быть оглушен.",
29+
cannotBeKnockedOut = "Этот игрок AFK и не может быть нокаутирован.",
30+
}

afk/languages/spanish.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
NAME = "Spanish"
2+
LANGUAGE = {
3+
afkCommandDesc = "Alternar el estado AFK de un jugador",
4+
afkStatusCommandDesc = "Verificar el estado AFK de un jugador o todos los jugadores",
5+
afkProtectionEnabled = "Protección AFK Habilitada",
6+
afkProtectionEnabledDesc = "Habilitar o deshabilitar el sistema de protección AFK",
7+
afkTime = "Tiempo AFK",
8+
afkTimeDesc = "Tiempo en segundos antes de que un jugador sea considerado AFK",
9+
afkProtection = "Protección AFK",
10+
afkStatusRemoved = "Estado AFK removido de %s",
11+
afkStatusSet = "Estado AFK establecido en %s",
12+
afkStatusRemovedByAdmin = "Tu estado AFK ha sido removido por un administrador.",
13+
afkStatusSetByAdmin = "Has sido marcado como AFK por un administrador.",
14+
afkProtectionDisabled = "La protección AFK está deshabilitada.",
15+
afkStatus = "Estado AFK",
16+
afkPlayers = "Jugadores AFK",
17+
activePlayers = "Jugadores Activos",
18+
noPlayersAFK = "No hay jugadores AFK actualmente",
19+
afkForTime = "AFK por %s",
20+
youAreAFK = "ESTÁS AFK",
21+
time = "Tiempo",
22+
lastActivity = "Última Actividad",
23+
afkTimeLabel = "Tiempo AFK",
24+
cannotBeRestrained = "Este jugador está AFK y no puede ser atado.",
25+
cannotBeUnrestrained = "Este jugador está AFK y no puede ser desatado.",
26+
cannotBeArrested = "Este jugador está AFK y no puede ser arrestado.",
27+
cannotBeUnarrested = "Este jugador está AFK y no puede ser liberado.",
28+
cannotBeStunned = "Este jugador está AFK y no puede ser aturdido.",
29+
cannotBeKnockedOut = "Este jugador está AFK y no puede ser noqueado.",
30+
}

0 commit comments

Comments
 (0)