Class lajax\translatemanager\widgets\ToggleTranslate
Inheritance | lajax\translatemanager\widgets\ToggleTranslate » yii\base\Widget |
---|---|
Available since version | 1.0 |
Widget that displays button for switching to translating mode.
Simple example:
\lajax\translatemanager\widgets\ToggleTranslate::widget();
Example for changing position:
\lajax\translatemanager\widgets\ToggleTranslate::widget([
'position' => \lajax\translatemanager\widgets\ToggleTranslate::POSITION_TOP_RIGHT,
]);
Example for changing skin:
\lajax\translatemanager\widgets\ToggleTranslate::widget([
'frontendTranslationAsset' => 'lajax\translatemanager\bundles\FrontendTranslationAsset',
]);
Example for changing template and skin:
\lajax\translatemanager\widgets\ToggleTranslate::widget([
'template' => '<a href="javascript:void(0);" id="toggle-translate" class="{position}" data-language="{language}" data-url="{url}"><i></i> {text}</a><div id="translate-manager-div"></div>',
'frontendTranslationAsset' => 'lajax\translatemanager\bundles\FrontendTranslationAsset',
]);
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$frontendTranslationAsset | string | Added StyleSheets and their dependencies | lajax\translatemanager\widgets\ToggleTranslate |
$frontendTranslationPluginAsset | string | Added JavaScripts and their dependencies | lajax\translatemanager\widgets\ToggleTranslate |
$position | string | The position of the translate mode switch button relative to the screen. | lajax\translatemanager\widgets\ToggleTranslate |
$template | string | The template of the translate mode switch button. | lajax\translatemanager\widgets\ToggleTranslate |
Public Methods
Method | Description | Defined By |
---|---|---|
run() | lajax\translatemanager\widgets\ToggleTranslate |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
DIALOG_URL | '/translatemanager/language/dialog' | Url of the dialog window. | lajax\translatemanager\widgets\ToggleTranslate |
POSITION_BOTTOM_LEFT | 'bottom-left' | Button in bottom left corner. | lajax\translatemanager\widgets\ToggleTranslate |
POSITION_BOTTOM_RIGHT | 'bottom-right' | Button in bottom right corner. | lajax\translatemanager\widgets\ToggleTranslate |
POSITION_TOP_LEFT | 'top-left' | Button in top left corner. | lajax\translatemanager\widgets\ToggleTranslate |
POSITION_TOP_RIGHT | 'top-right' | Button in top right corner. | lajax\translatemanager\widgets\ToggleTranslate |
Property Details
Added StyleSheets and their dependencies
Added JavaScripts and their dependencies
public string $frontendTranslationPluginAsset = 'lajax\translatemanager\bundles\FrontendTranslationPluginAsset'
The position of the translate mode switch button relative to the screen. Pre-defined positions: bottom-left (default), bottom-right, top-left, top-tright.
The template of the translate mode switch button.