DgsAttachToTranslation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
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-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.


Line 24: Line 33:
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")  --Attach
DGS:dgsAttachToTranslation(button,"EN")  --Attach a single dgs element to the translation table ( which is different from dgsSetAttachTranslation )
DGS:dgsSetText(button,{"Test","Test","DGS"})  --Change text with table to use translation table
DGS:dgsSetText(button,{"Test","Test","DGS"})  --Change text with table to use translation table



Latest revision as of 05:06, 8 April 2020

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 a single dgs element to the translation table ( which is different from dgsSetAttachTranslation )
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