@serenity-is/corelib / EntityLocalizer
Class: EntityLocalizer
Defined in: src/ui/dialogs/entitylocalizer.tsx:36
Manages the localization grid for an entity dialog, letting users edit translations of localizable fields for each language.
Constructors
Constructor
new EntityLocalizer(
opt):EntityLocalizer
Defined in: src/ui/dialogs/entitylocalizer.tsx:49
Creates a localizer and builds the localization grid.
Parameters
opt
Options for the localizer.
Returns
EntityLocalizer
Properties
grid
protectedgrid:PropertyGrid
Defined in: src/ui/dialogs/entitylocalizer.tsx:38
lastValue
protectedlastValue:any
Defined in: src/ui/dialogs/entitylocalizer.tsx:40
pendingValue
protectedpendingValue:any
Defined in: src/ui/dialogs/entitylocalizer.tsx:39
targetLanguage
protectedtargetLanguage:HTMLSelectElement
Defined in: src/ui/dialogs/entitylocalizer.tsx:41
Methods
buttonClick()
buttonClick():
void
Defined in: src/ui/dialogs/entitylocalizer.tsx:195
Toggles localization mode and loads/saves localization values.
Returns
void
clearValue()
clearValue():
void
Defined in: src/ui/dialogs/entitylocalizer.tsx:158
Clears pending and last localization values.
Returns
void
destroy()
destroy():
void
Defined in: src/ui/dialogs/entitylocalizer.tsx:148
Destroys the localization grid.
Returns
void
editSaveRequest()
editSaveRequest(
req):void
Defined in: src/ui/dialogs/entitylocalizer.tsx:288
Adds pending localizations to a save request.
Parameters
req
SaveRequest<any>
The save request to modify.
Returns
void
getLocalizationGridValue()
protectedgetLocalizationGridValue():any
Defined in: src/ui/dialogs/entitylocalizer.tsx:271
Returns the localization values from the grid, keyed by language and field.
Returns
any
The localization values.
getPendingLocalizations()
protectedgetPendingLocalizations():any
Defined in: src/ui/dialogs/entitylocalizer.tsx:298
Returns pending localizations grouped by language.
Returns
any
The pending localizations.
isEnabled()
isEnabled():
boolean
Defined in: src/ui/dialogs/entitylocalizer.tsx:167
Whether the localization grid is enabled (there are localizable fields).
Returns
boolean
True when enabled.
isLocalizationMode()
protectedisLocalizationMode():boolean
Defined in: src/ui/dialogs/entitylocalizer.tsx:175
Whether the dialog is currently in localization mode.
Returns
boolean
True when in localization mode.
isLocalizationModeAndChanged()
protectedisLocalizationModeAndChanged():boolean
Defined in: src/ui/dialogs/entitylocalizer.tsx:183
Whether the localization values changed since the last save.
Returns
boolean
True when changed.
loadLocalization()
protectedloadLocalization():void
Defined in: src/ui/dialogs/entitylocalizer.tsx:216
Loads localization values into the grid.
Returns
void
setLocalizationGridCurrentValues()
protectedsetLocalizationGridCurrentValues():void
Defined in: src/ui/dialogs/entitylocalizer.tsx:246
Copies current field values into the localization grid as hints.
Returns
void
updateInterface()
updateInterface():
void
Defined in: src/ui/dialogs/entitylocalizer.tsx:324
Updates the UI to reflect the current localization mode.
Returns
void