DgsAttachToTranslation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 23: Line 23:
DGS:dgsSetTranslationTable("EN",TranslationTable)
DGS:dgsSetTranslationTable("EN",TranslationTable)
local button = DGS:dgsCreateButton(200,200,200,100,"Login",false)
local button = DGS:dgsCreateButton(200,200,200,100,"Login",false)
DGS:dgsAttachToTranslation(button,"EN")
DGS:dgsAttachToTranslation(button,"EN") --Attach
DGS:dgsSetText(button,{"Test","Test","DGS"})
DGS:dgsSetText(button,{"Test","Test","DGS"}) --Change text with table to use translation table


setTimer(function()
setTimer(function()
Line 30: Line 30:
Test="L %rep% O %rep% L"
Test="L %rep% O %rep% L"
}
}
DGS:dgsSetTranslationTable("EN",TranslationTable2)
DGS:dgsSetTranslationTable("EN",TranslationTable2) --Change Translation Table
end,1000,1)
end,1000,1)
</syntaxhighlight>
</syntaxhighlight>

Revision as of 04:55, 7 September 2018

This function attaches dgs element to a specfic translation table.

Syntax

bool dgsAttachToTranslation ( element dgsElement, string name )

Required Arguments

  • dgsElement: The dgs element you want to attach.
  • name: The name of tranlation table you want to attach to.

Returns

Returns a string if succeed, false otherwise.

Example

DGS = exports.dgs
TranslationTable = {
	Test="Text %rep% %rep%"
}
DGS:dgsSetTranslationTable("EN",TranslationTable)
local button = DGS:dgsCreateButton(200,200,200,100,"Login",false)
DGS:dgsAttachToTranslation(button,"EN")  --Attach
DGS:dgsSetText(button,{"Test","Test","DGS"})  --Change text with table to use translation table

setTimer(function()
	TranslationTable2 = {
		Test="L %rep% O %rep% L"
	}
	DGS:dgsSetTranslationTable("EN",TranslationTable2) --Change Translation Table
end,1000,1)

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips