-
Notifications
You must be signed in to change notification settings - Fork 12
Localization
The plugin uses a localization system to display in-game text, enabling multi-language support through JSON-based translation files.
The language shown to players is determined by the server’s configured language. You can change this setting in the core.json file located at:
.\addons\counterstrikesharp\configs\core.json
Translation files are located in addons/counterstrikesharp/plugins/WarcraftPlugin/lang/
The naming follows a 2 letter ISO code.
en.json (English)
ru.json (Russian)
...
Within these files, you'll find keys and values
"shadowblade.venomstrike": "{Green}Poisoned {LightYellow}{0} {Green}for {DarkRed}{1} {Green}damage!"This is then used in code like this
Player.PrintToChat(" " + Localizer["shadowblade.venomstrike", Victim.GetRealPlayerName(), damage]);Which prints something like this in the game Poisoned BoinK for 6 damage!
It's possible to create localization files for your custom heroes.
- Create a new file, with the name of your hero and language,
WarcraftPlugin\lang\myhero.en.json(English) - Add translation keys and values
- Use in code
The translation keys for abilities are assumed to follow the format
"<heroName>.ability.<abilityNumber>": "<translation>"
Example
"shadowblade.ability.0": "Shadowstep"
- Getting Started
- Setup Guide
- Your First Hero
- Event Handlers
- Damage
- Particles
- Warcraft Effects
- Props and Velocity
- Collisions and Triggers
- Ray tracing
- Advanced Geometry
- Sounds
- Custom Player Models
- Localization