DGS Multilingual: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 6: Line 6:


==<span style="color:#000000;text-shadow:0.05em 0.05em 0.2em #00000099;">Usage</span>==
==<span style="color:#000000;text-shadow:0.05em 0.05em 0.2em #00000099;">Usage</span>==
===<span style="color:#FF7F00;">Server-Sided</span> G2D script converter (G2DSC)===
*1. A '''Translation Table''' (Dictionary) should be specified:
Command: g2d [-Option] [Arguments]
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;"
|-
!Options
!Arguments
!Comment
|-
| -add
|Resource Name
|Retain selections and select other resources (-m :Pattern Match)
|-
| -c
|
|Clear selections
|-
| -h
|
|G2D Help
|-
| -rm
|Resource Name
|Remove specific selected resources from list  (-m :Pattern Match)
|-
| -l
|
|List all selected resources
|-
| -e
|
|Start to convert (execute)
|-
| -q
|
|Stop converting process
|-
|}
'''Example'''<br>
These command is used in MTA Server console.
 
Basic:
<syntaxhighlight>
g2d -add resA
g2d -e
</syntaxhighlight>
 
Advanced Pattern Mode:
<syntaxhighlight>
g2d -add .A -m
g2d -e
</syntaxhighlight>
 
Output files are stored in '''dgs/G2DOutput/'''
<br>
<br>
 
===<span style="color:#FF0000;">Client-Sided</span> G2D Hooker (G2D Hooker)===
See detail [[dgsG2DLoadHooker]]
 
'''Example'''
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
loadstring(exports.dgs:dgsImportFunction())() --Import functions before
Dict = {
loadstring(exports.dgs:dgsG2DLoadHooker())()  --Load G2D Hooker
TestText1="Welcome To %rep%",
local buttonElement = guiCreateButton(200,200,300,300,"Test",false)  --Though you are using gui functions and events, but they have already hooked by DGS
}
addEventHandler ( "onClientGUIClick", buttonElement, function()
outputChatBox("clicked")
end, false )
</syntaxhighlight>
</syntaxhighlight>

Revision as of 05:54, 11 December 2020

Description

  • 1. DGS has a built-in multilingul (multi-languae) system.
  • 2. Multilingul allows dynamic language changing and prevents non-essential GUI recreating or text reset by code.
  • 3. DGS Multilingul system will specify the structure of Translation Table (Dictionary).

Usage

  • 1. A Translation Table (Dictionary) should be specified:
	Dict = {
		TestText1="Welcome To %rep%",
	}