DgsAttachToTranslation: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 34: Line 34:
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 a single dgs element to the translation table ( which is different from [[dgsSetAttachTranslation]] )
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



Revision as of 05:49, 23 March 2019

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