Multilanguage with @lang

ZelosAvalon

New member
Messages
218
Points
0
Age
34
Emulator
My suggestion is as follows:

we'll use the existing system generate_translations (@lang)

and @lang would be released for all players

but when entering @lang the player only change the local language

for example:

in a script we define a variable:

if @lang = pt_br

then account receives a variable "lang_type"

if example: lang_type = pt_br

then the game will load the language contained in = pt_br.po or you language.po

I don't know how to modify plugins, or I even try to make it

So we would have fewer problems in the matter of players don't enter into some server, due to lack of support in their language, only we would have the job of creating translations that I think would be the least we should do to draw attention of the public!

PS: I would like to have more knowledge on plugins to be able to help, if someone is willing to share the knowledge know where to find me, I would be happy to contribute to the community!
i do what I can when I can!

 
Last edited by a moderator:
That is the way how HULD (Hercules Ultimate Localization Design) works. With @lang command players can set up the language they want to use for scripts, but it is still needed to do manually the translation in that language.

To start to be familiarized with huld I recommend you to experience the generate-translations plugin.

In recent version of the emulator it is needed to manually compile the plugin. I put some steps to compile the plugin. I will repeat them here since I don't know if you already know how to compile the plugin:

1. Open folder \vcproj-14\

2. Copy and paste plugin-sample.vcxproj to duplicate it.
 
3. Rename file "plugin-sample.vcxproj" to "generate-translations.vcxproj"
 
4. Open generate-translations.vcxproj in Notepad++
 
5. Find this line:
    <ProjectName>plugin-sample</ProjectName>
 
6. Rename 'plugin-sample' to 'generate-translations'
 
7. Find this line:
    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">generate-translations</TargetName>
 
8. Rename sample to generate-translations
 
9. Find this line:
    <ClCompile Include="..\src\plugins\sample.c" />
 
10. Rename sample to generate-translations
 
11. Save changes and close
 
12. Open MSVC. Do right-clic on Solution 'Hercules-14'. Select Add -> Existing Project...
 
13. Select generate-translations.vcxproj in folder \vcproj-14\
 
14. Right-click Hercules-14, Select Build-Solution
 
15. Add it to /conf/plugins.conf
plugins_list: [
    /* Enable HPMHooking when plugins in use rely on Hooking */
    "HPMHooking",     // <-- Uncomment this
    //"db2sql",
    //"sample",
    //"other",
    "generate-translations", // loads generate-translations plugin
]
Then, when you have already compiled the generate-translations plugin, you just make a .bat file in the emulator folder and put this line:

map-server.exe --generate-translations

When open the .bat file the map-server will process all the scripts active in your npc folder and will generate a file named generated_translations.pot in the root folder of the emulator.

Rename the extension of that file from .pot to .po and you can open it with a simple text editor (like Notepad++) or with PO Editor, an speciallized program to manage that kind of files to start the translation.

It is pretty cool when you finish to translate one npc. With the file loaded by the server use the @lang command with the name of the file (in example @lang Spanish for Spanish.po file). You can play with the npcs alternating their language with that command, but, now that I remmember, it has the issue that @lang command doesn't save the selected language, players still have to manually select the language they want when it is not the default one configured in the server.

Almost forgot, you can always see a generated translatable file in HerculesWS Community Translations git: https://github.com/HerculesWS/CommunityTranslations

If you have any question please tell me, I loved that stuff.

 
Last edited by a moderator:
Back
Top