DgsAttachToTranslation: Difference between revisions

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


===Required Arguments===  
===Required Arguments===  
*'''dgsElement:''' The dgs element you want to attach.
*'''dgsElement:''' The dgs element you want to attach. Support following dgs types:
**[[dgs-dx3dtext]]
**[[dgs-dxarrowlist]]
**[[dgs-dxbutton]]
**[[dgs-dxgridlist]]
**[[dgs-dxradiobutton]]
**[[dgs-dxcheckbox]]
**[[dgs-dxlabel]]
**[[dgs-dxwindow]]
**[[dgs-dxtab]]
**[[dgs-dxcombobox]]
*'''name:''' The name of tranlation table you want to attach to.
*'''name:''' The name of tranlation table you want to attach to.



Revision as of 05:53, 7 September 2018

This function attaches a single dgs element to a specfic translation table.

[[{{{image}}}|link=|]] Note: This function is different from dgsSetAttachTranslation

Syntax

bool dgsAttachToTranslation ( element dgsElement, string name )

Required Arguments

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