Skip to content

Commit 0eba6fa

Browse files
committed
docs: Add multi-language extension information
1 parent 6f26351 commit 0eba6fa

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Docs/Adding.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ It contains snippets and shortcuts to make developing for AzerothCoreAdmin easie
1010
I want to add:
1111

1212
1. [Adding a new command button](#Adding-a-new-command-button)
13+
2. [Adding a new language](#Adding-a-new-language)
1314

1415
### Adding a new command button
1516

@@ -19,3 +20,21 @@ In order to add a button with a command, four steps are required (in toc order):
1920
2. Write the function in ./Commands/Commands_xxxx.lua
2021
3. Prototype/init the button, function, text, and tooltip in FunctionInit.lua
2122
4. Draw the button in the ./Frames/MangFrames_Sectionxxxx.lua
23+
24+
### Adding a new language
25+
26+
**So far, the add-on supports only enUS. To add multi-language support, which was present on the TrinityAdmin v2, it is necessary to retrieve and adapt the code of that version. My adaption aim to a fast release, so I am not going to adapt that feature for now. Any contribution is appreciated.**
27+
28+
The add-on uses two files containing strings:
29+
30+
1. %Your-Language%.lua, which contains the actual text that will be displayed in-game
31+
2. strings.lua, which contains a set of patterns that will be used by the add-on to retrieve information. There patterns must match with the language that the servers uses to print system messages!
32+
33+
In order to add a language support, three steps are required (in toc order):
34+
35+
1. Translate tooltips and button text into your desired language in a file located in ./Locales/xxxx.lua
36+
2. Inside ./Locales/strings.lua create a function that will return the internal-usage translated strings
37+
3. Inside AzerothCoreAdmin look up for the language registration section and add the following:
38+
39+
Locale:RegisterTranslations("%Your-Language%", function() return Return_%Your-Language%() end)
40+
Strings:RegisterTranslations("%Your-Language%", function() return ReturnStrings_%Your-Language%() end)

0 commit comments

Comments
 (0)