Перейти к основному содержимому

Localization

CommandGuard supports multiple languages. All messages including the plugin prefix are defined in lang files.

Selecting a Language

In config.yml (backend) or velocity-config.yml / bungee-config.yml (proxy):

lang: en_EN

Bundled languages: en_EN, ru_RU.

File Location

Lang files are extracted to the plugin folder on first start:

plugins/CommandGuard/lang/en_EN.yml
plugins/CommandGuard/lang/ru_RU.yml

You can edit them freely — they are not overwritten on server restart.


Adding a Custom Language

  1. Create plugins/CommandGuard/lang/uk_UA.yml
  2. Copy the contents of en_EN.yml as a base
  3. Translate all message values
  4. Set lang: uk_UA in the config
  5. Run /cg reload or /cgv reload

Changing the Prefix

The prefix is defined inside the lang file, not in config.yml:

# en_EN.yml
prefix: "&8[&cCommand&fGuard&8]"

Color codes (&a, &c...) and hex colors (#ff5555) are supported:

prefix: "&8[&6CG&8]"
prefix: "#ff5555[CommandGuard]"
prefix: "&5&lCommandGuard &8»"

After editing, run /cg reload — the new prefix takes effect immediately.


Placeholders

PlaceholderDescription
%prefix%Plugin prefix (available in all messages automatically)
%player%Player name
%version%Plugin version
%count%A number (tab sync count, command count)
%groups%Active group name(s)
%commands%List of allowed commands
%server%Server name
%sound%Sound name (used in error messages)

Full Lang File Reference

# Plugin prefix (used in all messages)
prefix: "&8[&cCommand&fGuard&8]"

# Command messages
cmd.no_permission: "&cYou don't have permission to use this command."
cmd.help.header: "&fCommands:"
cmd.help.reload: " &c/cg reload &7— &freload config and refresh tab for all players"
cmd.help.check: " &c/cg check <player> &7— &fshow active tab group for a player"
cmd.help.updategroup: " &c/cg updategroup <player> &7— &fpush updated tab list to a player"
cmd.reload.success: "&aConfig reloaded!"
cmd.reload.tabsync_sent: "&aTabSync sent to &f%count% &aonline players."
cmd.check.not_found: "&cPlayer &f%player% &cnot found."
cmd.check.player: "&fPlayer: &c%player%"
cmd.check.server: "&fServer: &c%server%"
cmd.check.groups: "&fActive group(s): &c%groups%"
cmd.check.commands: "&fAllowed commands &8(&c%count%&8): &f%commands%"
cmd.updategroup.not_found: "&fPlayer &c%player% &fnot found."
cmd.updategroup.success: "&fTab list updated for &c%player%."
cmd.usage.check: "&fUsage: &c/cg check <player>"
cmd.usage.updategroup: "&fUsage: &c/cg updategroup <player>"

# Update notifications (shown to OP players on join)
update.available: "&fNew version available. &8(&c%version%&8)"
update.download: "&fDownload: &chttps://modrinth.com/plugin/commandguard"

# Console / startup messages
console.enabled: "&eEnabled! &fVersion: &c%version%"
console.disabled: "&eDisabled! &fVersion: &c%version%"
console.update_available: "&fNew version: &c%version%"
console.update_download: "&fDownload: &chttps://modrinth.com/plugin/commandguard"
console.update_error: "&cError while checking for updates."

# Misc
misc.invalid_sound: "&fSound &c%sound% &fis not valid. Change it in the config!"