{#
    Common files ( translations and other common variables )
        Add by including in another twig file javaScript block: {% include "common.twig" %}
#}
{% block javaScript %}
    <script type="text/javascript">

        // COMMON VARIABLES
        var serverMode = "{{ settings.SERVER_MODE }}";
        var playlistRegionColouring =  "{{ settings.REGION_OPTIONS_COLOURING }}";
        var libraryUpload = {{ libraryUpload|json_encode|raw }};
        var librarySearchUrl = "{{ url_for("library.search.all") }}";
        var libraryAddUrl = "{{ url_for("library.add") }}";
        var templateSearchUrl = "{{ url_for("template.search.all") }}";
        var defaultThumbnailUrl = '{{ theme.rootUri() }}theme/default/img/thumbs/placeholder.png';
        var uploadFormUpdateAllDefault = {% if settings.LIBRARY_MEDIA_UPDATEINALL_CHECKB == 1 %}true{% else %}false{% endif %};
        var uploadFormDeleteOldDefault = {% if settings.LIBRARY_MEDIA_DELETEOLDVER_CHECKB == 1 %}true{% else %}false{% endif %};
        var assetDownloadUrl = "{{ url_for("module.asset.download", {assetId: ':assetId'}) }}";
        var tooltipDelay = {'show': 250, 'hide': 0};
        var playlistEditorUrl = "{{ url_for("playlist.timeline.form", {id:':id'}) }}";
        var timezones = {{ timeZones|json_encode|raw }};

        // Save navbar position
        var navbarPosition = 'vertical';
        {% set horizontalNav = currentUser.getOptionValue("navigationMenuPosition", theme.getSetting("NAVIGATION_MENU_POSITION", "vertical")) == "horizontal" %}
        {% if horizontalNav %}
            navbarPosition = 'horizontal';
        {% endif %}

        // MODULES LIST
        var modulesList = [];
        {% for module in modules %}
            modulesList.push({{ module|json_encode|raw }});
        {% endfor %}

        // USERS LIST
        var usersList = [];
        {% for user in users %}
            usersList.push({{ user|json_encode|raw }});
        {% endfor %}

        // Structure with API URLs
        var urlsForApi = {
            layout: {
                designer: {
                    url: "{{ url_for("layout.designer", {id: ':id'}) }}",
                    type: 'GET'
                },
                get: {
                    url: "{{ url_for("layout.search") }}",
                    type: 'GET'
                },
                add: {
                    url: "{{ url_for("layout.add") }}",
                    type: 'POST'
                },
                getForm: {
                    url: "{{ url_for("layout.background.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                editForm: {
                    url: "{{ url_for("layout.edit.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                saveForm: {
                    url: "{{ url_for("layout.edit.background", {id: ':id'}) }}",
                    type: 'PUT'
                },
                downloadBackground: {
                    url: "{{ url_for("layout.download.background", {id: ':id'}) }}",
                    type: 'GET'
                },
                preview: {
                    url: "{{ url_for("layout.preview", {id: ':id'}) }}",
                    type: 'GET'
                },
                checkout: {
                    url: "{{ url_for("layout.checkout", {id: ':id'}) }}",
                    type: 'PUT'
                },
                publish: {
                    url: "{{ url_for("layout.publish", {id: ':id'}) }}",
                    type: 'PUT'
                },
                discard: {
                    url: "{{ url_for("layout.discard", {id: ':id'}) }}",
                    type: 'PUT'
                },
                delete: {
                    url: "{{ url_for("layout.delete", {id: ':id'}) }}",
                    type: 'DELETE'
                },
                unlock: {
                    url: "{{ url_for("layout.lock.release", {id: ':id'}) }}",
                    type: 'PUT'
                },
                applyTemplate: {
                    url: "{{ url_for("layout.apply.template", {id: ':id'}) }}",
                    type: 'PUT'
                },
                list: {
                    url: "{{ url_for("layout.view") }}"
                },
                status: {
                    url: "{{ url_for("layout.status", {id: ':id'}) }}"
                },
                designer: {
                    url: "{{ url_for("layout.designer", {id: ':id'}) }}"
                },
                schedule: {
                    url: "{{ url_for("schedule.add.form", {from: 'Layout', id: ':id'}) }}",
                    type: 'GET'
                },
                saveTemplate: {
                    url: "{{ url_for("template.from.layout.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                publishForm: {
                    url: "{{ url_for("layout.publish.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                discardForm: {
                    url: "{{ url_for("layout.discard.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                deleteForm: {
                    url: "{{ url_for("layout.delete.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                addDrawer: {
                    url: "{{ url_for("region.add.drawer", {id: ':id'}) }}",
                    type: 'POST'
                },
                saveDrawer: {
                    url: "{{ url_for("region.save.drawer", {id: ':id'}) }}",
                    type: 'PUT'
                },
                addThumbnail: {
                  url: '{{ url_for("layout.thumbnail.add", {id: ":id"}) }}',
                  type: 'POST'
                },
                codeSearch: {
                    url: "{{ url_for("layout.code.search") }}",
                    type: 'GET'
                },
            },
            template: {
                list: {
                    url: "{{ url_for("template.view") }}"
                },
            },
            region: {
                transform: {
                    url: "{{ url_for("region.position.all", {id: ':id'}) }}",
                    type: 'PUT',
                    useMainObjectId: true
                },
                getForm: {
                    url: "{{ url_for("region.edit.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                saveForm: {
                    url: "{{ url_for("region.edit", {id: ':id'}) }}",
                    type: 'PUT'
                },
                create: {
                    url: "{{ url_for("region.add", {id: ':id'}) }}",
                    type: 'POST',
                    useMainObjectId: true
                },
                delete: {
                    url: "{{ url_for("region.delete", {id: ':id'}) }}",
                    type: 'DELETE'
                },
                preview: {
                    url: "{{ url_for("region.preview", {id: ':id'}) }}",
                    type: 'GET'
                },
                getPermissions:  {
                    url: "{{ url_for("user.permissions.form", {entity: 'Region', id: ':id'}) }}",
                    type: 'GET'
                }
            },
            widget: {
                getForm: {
                    url: "{{ url_for("module.widget.edit.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                saveForm: {
                    url: "{{ url_for("module.widget.edit", {id: ':id'}) }}",
                    type: 'PUT'
                },
                preview: {
                    url: "{{ url_for("region.preview", {id: ':id'}) }}",
                    type: 'GET'
                },
                delete: {
                    url: "{{ url_for("module.widget.delete", {id: ':id'}) }}",
                    type: 'DELETE'
                },
                getAudio: {
                    url: "{{ url_for("module.widget.audio.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                saveAudio:  {
                    url: "{{ url_for("module.widget.audio", {id: ':id'}) }}",
                    type: 'PUT'
                },
                getExpiry: {
                    url: "{{ url_for("module.widget.expiry.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                saveExpiry:  {
                    url: "{{ url_for("module.widget.expiry", {id: ':id'}) }}",
                    type: 'PUT'
                },
                getTransition: {
                    url: "{{ url_for("module.widget.transition.edit.form", {id: ':id', type: ':type'}) }}",
                    type: 'GET'
                },
                saveTransition:  {
                    url: "{{ url_for("module.widget.transition.edit", {id: ':id', type: ':type'}) }}",
                    type: 'PUT'
                },
                getPermissions:  {
                    url: "{{ url_for("user.permissions.form", {entity: 'Widget', id: ':id'}) }}",
                    type: 'GET'
                },
                setRegion: {
                    url: "{{ url_for("module.widget.set.region", {id: ':id'}) }}",
                    type: 'PUT'
                },
                getDataType: {
                    url: "{{ url_for("module.widget.dataType", {id: ':id'}) }}",
                    type: 'GET'
                },
                saveElements: {
                    url: "{{ url_for("module.widget.elements", {id: ':id'}) }}",
                    type: 'PUT'
                },
            },
            library: {
                get: {
                    url: "{{ url_for("library.search") }}",
                    type: 'GET'
                },
                connectorImport: {
                    url: "{{ url_for("library.connector.import") }}",
                    type: 'POST'
                },
                download: {
                    url: "{{ url_for("library.download", {id: ':id'}) }}",
                    type: 'GET'
                },
            },
            playlist: {
                get: {
                    url: "{{ url_for("playlist.search") }}",
                    type: 'GET'
                },
                getForm: {
                    url: "{{ url_for("playlist.edit.form", {id: ':id'}) }}",
                    type: 'GET'
                },
                addMedia: {
                    url: "{{ url_for("playlist.library.assign", {id: ':id'}) }}",
                    type: 'POST'
                },
                addWidget: {
                    url: "{{ url_for("module.widget.add", {type: ':type', id: ':id'}) }}",
                    type: 'POST'
                },
                preview: {
                    url: "{{ url_for("region.preview", {id: ':id'}) }}",
                    type: 'GET'
                },
                order: {
                    url: "{{ url_for("playlist.order", {id: ':id'}) }}",
                    type: 'POST'
                }
            },
            user: {
                getPref: {
                    url: "{{ url_for("user.pref") }}",
                    type: 'GET'
                },
                savePref: {
                    url: "{{ url_for("user.pref") }}",
                    type: 'POST'
                },
                permissions: {
                    url: "{{ url_for("user.permissions.form", {entity: ':entity', id: ':id'}) }}",
                    type: 'GET'
                }
            },
            media: {
                isUsed: {
                    url: "{{ url_for("library.isused", {id: ':id'}) }}",
                    type: 'GET'
                }
            },
            module: {
                getTemplates: {
                    url: "{{ url_for("module.template.search", {dataType: ':dataType'}) }}",
                    type: 'GET'
                },
                getData: {
                    url: "{{ url_for("module.getData", {regionId: ':regionId', id: ':id'}) }}",
                    type: 'GET'
                },
                assetDownload: {
                    url: "{{ url_for("module.asset.download", {assetId: ':assetId'}) }}",
                    type: 'GET'
                },
            },
            actions: {
                get: {
                    url: "{{ url_for("action.search") }}",
                    type: 'GET'
                },
                delete: {
                    url: "{{ url_for("action.delete", {id: ':id'}) }}",
                    type: 'DELETE'
                },
                add: {
                    url: "{{ url_for("action.add", {source: ':source', id: ':id'}) }}",
                    type: 'POST'
                },
                edit: {
                    url: "{{ url_for("action.edit", {id: ':id'}) }}",
                    type: 'PUT'
                },
            },
            dataset: {
                search: {
                    url: "{{ url_for("dataSet.search") }}",
                    type: 'GET'
                },
            },
            menuBoard: {
                search: {
                    url: "{{ url_for("menuBoard.search") }}",
                    type: 'GET'
                },
                categorySearch: {
                    url: "{{ url_for("menuBoard.category.search", {id: ':id'}) }}",
                    type: 'GET'
                },
            },
            command: {
                search: {
                    url: "{{ url_for("command.search") }}",
                    type: 'GET'
                },
            },
            connectorProperties: {
                search: {
                    url: "{{ url_for("widget.edit.options", {id: ':id'}) }}",
                    type: 'GET'
                }
            },
            layoutTemplates: {
                search: {
                    url: "{{ url_for("template.search") }}",
                    type: 'GET',
                }
            },
        };

        {% autoescape "js" %}
            // TRANSLATIONS
            var editorsTrans = {
                deleteTitle: "{{ "Delete %obj%" |trans }}",
                deleteMultipleTitle: "{{ "Delete selected items" |trans }}",
                deleteConfirm: "{{ "Are you sure? All changes related to this object will be erased" |trans }}",
                onbeforeunload: "{{ "Changes that you have made may not be saved!" |trans }}",
                yes: "{{ "Yes" |trans }}",
                no: "{{ "No" |trans }}",
                selectAll: "{{ "Select All" |trans }}",
                allChangesSaved: "{{ "All changes saved!" |trans }}",
                back: "{{ "Back" |trans }}",
                delete: "{{ "Delete" |trans }}",
                loadPropertyForObject: "{{ "Load %prop% for %obj%" |trans }}",
                loading: "{{ "Loading" |trans }}",
                resetTourNotification: "{{ "Layout Designer Tour enabled!" |trans }}",
                tooltipsDisabled: "{{ "Tooltips disabled!" |trans }}",
                tooltipsEnabled: "{{ "Tooltips enabled!" |trans }}",
                retire: "{{ "Retire" |trans }}",
                publish: "{{ "Publish" |trans }}",
                discard: "{{ "Discard"|trans }}",
                copyToClipboard: "{{ "Copy to Clipboard"|trans }}",
                detachEditor: "{{ "Detach Editor"|trans }}",
                attachEditor: "{{ "Attach Editor"|trans }}",
                zoomInEditor: "{{ "Zoom in"|trans }}",
                zoomOutEditor: "{{ "Zoom out"|trans }}",
                couldNotCopy: "{{ "Could not copy"|trans }}",
                copied: "{{ "Copied!"|trans }}",
                invalidModule:  "{{ "Module not enabled!"|trans }}",
                timeline: "{{ "Timeline"|trans }}",
                actions: {
                    layouts:  "{{ "Layouts"|trans }}",
                    regions: "{{ "Regions"|trans }}",
                    widgets: "{{ "Widgets"|trans }}",
                    deleteModal: {
                        title: "{{ "Delete Action"|trans }}",
                        message: "{{ "Are you sure you want to delete this action?"|trans }}",
                        buttons: {
                            cancel: "{{ "Cancel"|trans }}",
                            delete: "{{ "Delete"|trans }}"
                        },
                    },
                },
                layoutTemplateReplace: {
                    title: "{{ "Replace Layout"|trans }}",
                    message: "{{ "Are you sure you want to replace your Layout with a template?"|trans }}",
                    buttons: {
                        cancel: "{{ "Cancel"|trans }}",
                        delete: "{{ "Replace"|trans }}"
                    },
                },
                exit: "{{ "Exit"|trans }}",
            };

            var uploadTrans = {
                uploadMessage: "{{ "Upload media" |trans }}",
                addFiles: "{{ "Add files" |trans }}",
                startUpload: "{{ "Start upload" |trans }}",
                cancelUpload: "{{ "Cancel upload" |trans }}",
                processing: "{{ "Processing..." |trans }}",
                widgetFromDt: "{{ "Start time" |trans }}",
                widgetToDt: "{{ "End time" |trans }}",
                widgetExpiryDates: "{{ "Set Expiry Dates" |trans }}",
                widgetExpiryDatesMessage: "{{ "Use the check box to set Start and End dates and times for Widgets" |trans }}",
                widgetFromDtMessage: "{{ "Select the start time for this widget" |trans }}",
                widgetToDtMessage: "{{ "Select the end time for this widget" |trans }}",
                deleteOnExpiry: "{{ "Delete on Expiry" |trans }}",
                deleteOnExpiryMessage: "{{ "When the End Time for this Widget passes should the Widget be removed from the Playlist?" |trans }}",
                applyToMedia: "{{ "Delete from Library" |trans }}",
                applyToMediaMessage: "{{ "Remove file from the Media Library" |trans }}",
                selectFolder: "{{ "Select Folder"|trans }}",
                selectFolderTitle: "{{ "Change Current Folder location"|trans }}",
                selectedFolder: "{{ "Current Folder"|trans }}:",
                selectedFolderTitle: "{{ "Upload files to this Folder"|trans }}:"
            };

            var deleteMenuTrans = {
                mainMessage: "{{ "Are you sure you want to remove this %obj%? This action cannot be undone." |trans }}",
                infoDeleteMessage: "{{ "This widget is linked to Media in the Library which is also in use elsewhere. If this should be deleted then please do so from the Library page." |trans }}",
                deleteMediaFromLibraryTitle: "{{ "Also delete from the Library?" |trans }}",
                deleteMediaFromLibraryMessage: "{{ "This widget is linked to Media in the Library. Check this option to also delete that Media." |trans }}",
                deleteMultipleObjects: "{{ "Are you sure you want to remove these items? This action cannot be undone."|trans }}"
            };

            var contextMenuTrans = {
                editAudio: "{{ "Edit Attached Audio" |trans }}",
                editExpiry: "{{ "Edit Expiry Dates" |trans }}",
                editTransIn: "{{ "Edit Transition In"|trans }}",
                editTransOut: "{{ "Edit Transition Out" |trans }}",
                editPermissions: "{{ "Edit Sharing" |trans }}",
                editPlaylist: "{{ "Edit Playlist" |trans }}",
                moveLeft: "{{ "Move one step left" |trans }}",
                moveRight: "{{ "Move one step right" |trans }}",
                moveTopLeft: "{{ "Move to the top left" |trans }}",
                moveTopRight: "{{ "Move to the top right" |trans }}",
                bringToFront: "{{ "Bring to front" |trans }}",
                bringForward: "{{ "Bring forward" |trans }}",
                sendBackwards: "{{ "Send backwards" |trans }}",
                sendToBack: "{{ "Send to back" |trans }}",
                delete: "{{ "Delete"|trans }}",
                copy: "{{ "Duplicate"|trans }}",
                groupElements: "{{ "Group elements"|trans }}",
                ungroupElements: "{{ "Ungroup elements"|trans }}",
                deleteGroupElements: "{{ "Delete all"|trans }}",
            };

            var propertiesPanelTrans = {
                playlist: "{{ "Playlist" |trans }}",
                zone: "{{ "Zone" |trans }}",
                widget: "{{ "Widget" |trans }}",
                playlist: "{{ "Playlist" |trans }}",
                configure: "{{ "Configure" |trans }}",
                appearance: "{{ "Appearance" |trans }}",
                advanced: "{{ "Advanced" |trans }}",
                general: "{{ "General" |trans }}",
                positioning: "{{ "Positioning" |trans }}",
                transition: "{{ "Transition" |trans }}",
                width: "{{ "Width" |trans }}",
                height: "{{ "Height" |trans }}",
                top: "{{ "Top" |trans }}",
                left: "{{ "Left" |trans }}",
                scale: "{{ "Scale"|trans }}",
                layer: "{{ "Layer"|trans }}",
                invalidWidget:  "{{ "This widget needs to be configured before it will be shown"|trans }}",
                requiredElementsMessage: "{{ "This widget needs to have at least one of the following elements: %elements%." |trans }}",
                dataSlot: "{{ "Data Slot"|trans }}",
                dataSlotHelpText: "{{ "When there are more than one of the same element for a widget you can set the slot for each element. For example with two of the same element you'd have data slot 1 and data slot 2. If 10 items were returned slot 1 would receive items 1,3,5,7,9 and slot 2 would receive items 2,4,6,8,19."|trans }}",
                pinSlot: "{{ "Pin this slot?"|trans }}",
                pinSlotHelpText: "{{ "The first item that appears in a slot will be pinned and will not cycle with the rest of the items."|trans }}",
                groupScale: "{{ "Scale with group"|trans }}",
                groupScaleHelpText: "{{ "Scale element when scaling containing group."|trans }}",
                groupScaleType: "{{ "Align"|trans }}",
                groupScaleTypeHelpText: "{{ "Alignment when scaling the containing group."|trans }}",
                groupScaleTypeOptions: {
                    topLeft: "{{ "Top/Left" |trans }}",
                    topRight: "{{ "Top/Right" |trans }}",
                    bottomLeft: "{{ "Bottom/Left" |trans }}",
                    bottomRight: "{{ "Bottom/Right" |trans }}",
                },
                somethingWentWrong: "{{ "Something went wrong!"|trans }}",
                selectATarget: "{{ "Select a target region!"|trans }}",
                actions: {
                    noActionsToShow: "{{ "No actions to show"|trans }}",
                    otherActions: "{{ "Other Actions" |trans }}",
                    notDefined: "{{ "Not Defined"|trans }}",
                    itemActions: {
                        layout: "{{ "Layout Actions" |trans }}",
                        region: "{{ "Region Actions" |trans }}",
                        widget: "{{ "Widget Actions" |trans }}",
                    },
                    trigger: "{{ "Trigger" |trans }}",
                    target: "{{ "Target" |trans }}",
                    save: "{{ "Save" |trans }}",
                    cancel: "{{ "Cancel" |trans }}",
                },
                positionTab: {
                    layer: "{{ "Layer" |trans }}",
                    layerHelp: "{{ "Layer related to all layout objects" |trans }}",
                    elementLayer: "{{ "Element Layer" |trans }}",
                    elementLayerHelp: "{{ "Layer for the element related to other elements" |trans }}",
                    canvasLayer: "{{ "Canvas Layer" |trans }}",
                    canvasLayerHelp: "{{ "Layer for the canvas containing all elements" |trans }}",
                    top: "{{ "Top" |trans }}",
                    left: "{{ "Left" |trans }}",
                    width: "{{ "Width" |trans }}",
                    height: "{{ "Height" |trans }}",
                    rotation: "{{ "Rotation" |trans }}",
                    setFullscreen: "{{ "Make this full screen, dimensions will be set to %layout.width% by %layout.height%." |trans }}",
                },
                effect: "Effect",
                effectHelpText: "Please select the effect that will be used to transition between items.",
            };

            var toolbarTrans = {
                toolbarTagsMessage: "{{ "%tagCount% tags" |trans }}",
                deleteObject: "{{ "Delete selected %object%" |trans }}",
                selectMultipleWidgets: "{{ "Select multiple widgets" |trans }}",
                changeLayout: "{{ "Change Layout" |trans }}",
                options: "{{ "Options" |trans }}",
                displayTooltipsName: "{{ "Tooltips?" |trans }}",
                displayTooltipsTitle: "{{ "Show/Hide Tooltips" |trans }}",
                resetTour: "{{ "Show tour!" |trans }}",
                resetTourTitle: "{{ "Show Layout Designer tour" |trans }}",
                createNewTab: "{{ "Library Media Search" |trans }}",
                closeAllTabs: "{{ "Close all tabs" |trans }}",
                search: "{{ "Search" |trans }}",
                select: "{{ "Select" |trans }}",
                deselect: "{{ "Deselect" |trans }}",
                duration: "{{ "Duration" |trans }}",
                preview: "{{ "Preview media" |trans }}",
                open: "{{ "Open" |trans }}",
                addAsFavourite: "{{ "Mark as favourite" |trans }}",
                moduleNavStart: "{{ "Scroll to the start!" |trans }}",
                moduleNavEnd: "{{ "Scroll to the end!" |trans }}",
                moduleNavLeft: "{{ "Scroll left!" |trans }}",
                moduleNavRight: "{{ "Scroll right!" |trans }}",
                upload: "{{ "Upload new" |trans }}",
                uploadType: "{{ "Upload %obj%" |trans }}",
                searchFilters: {
                    search: "{{ "Search" |trans }}",
                    name: "{{ "Name" |trans }}",
                    tag: "{{ "Tag" |trans }}",
                    type: "{{ "Type" |trans }}",
                    owner: "{{ "Owner"|trans }}",
                    orientation: "{{ "Orientation"|trans }}",
                    provider: "{{ "Provider"|trans }}",
                },
                searchSortBy: "{{ "Sort by"|trans }}",
                searchSort: {
                    mediaId: "{{ "Media Id" |trans }}",
                    name: "{{ "Name" |trans }}",
                    orientation: "{{ "Orientation" |trans }}",
                    width: "{{ "Width" |trans }}",
                    height: "{{ "Height" |trans }}",
                    duration: "{{ "Duration" |trans }}",
                    fileSize: "{{ "File Size" |trans }}",
                    createdDt: "{{ "Created Date" |trans }}",
                    modifiedDt: "{{ "Modified Date" |trans }}",
                },
                orientationValues: {
                  all: "{{ "All"|trans }}",
                  landscape: "{{ "Landscape"|trans }}",
                  portrait: "{{ "Portrait"|trans }}"
                },
                providerValues: {
                  both: "{{ "All"|trans }}",
                  local: "{{ "Local"|trans }}",
                  remote: "{{ "Remote"|trans }}"
                },
                tabName: "{{ "Library Search %tagId%" |trans }}",
                tableHeader: {
                    toolsName: "{{ "Tools" |trans }}",
                    id: "{{ "Id"|trans }}",
                    name: "{{ "Name"|trans }}",
                    type: "{{ "Type"|trans }}",
                    tags: "{{ "Tags"|trans }}",
                    thumbnail: "{{ "Thumbnail"|trans }}"
                },
                queue: {
                    title: "{{ "Media Add Queue"|trans }}",
                    clear: "{{ "Clear Queue"|trans }}",
                    addToRegion: "{{ "Add to Selected Region"|trans }}",
                    addToPlaylist: "{{ "Add to Playlist"|trans }}",
                    selectRegion: "{{ "Click in Region to Add"|trans }}",
                    cancel: "{{ "Cancel"|trans }}"
                },
                menuItems: {
                    widgetsName: "{{ "Widgets" |trans }}",
                    widgetsTitle: "{{ "Add widgets" |trans }}",
                    globalElementsName: "{{ "Global" |trans }}",
                    globalElementsTitle: "{{ "Global Elements" |trans }}",
                    imageName: "{{ "Image" |trans }}",
                    imageTitle: "{{ "Library image search"|trans }}",
                    audioName: "{{ "Audio" |trans }}",
                    audioTitle: "{{ "Library audio search"|trans }}",
                    videoName: "{{ "Video" |trans }}",
                    videoTitle: "{{ "Library video search"|trans }}",
                    libraryName: "{{ "Other" |trans }}",
                    libraryTitle: "{{ "Library other media search"|trans }}",
                    actionsName: "{{ "Actions" |trans }}",
                    actionsTitle: "{{ "Interactive actions"|trans }}",
                    layoutTemplateName: "{{ "Layout Templates" |trans }}",
                    layoutTemplateTitle: "{{ "Search for Layout Templates"|trans }}",
                },
                window: {
                    drag: "{{ "Move Window" |trans }}",
                    close: "{{ "Close Window" |trans }}",
                    minimise: "{{ "Minimise Window" |trans }}",
                    newTab: "{{ "New Tab"|trans }}"
                },
                interactive: {
                    actions: {
                        nextLayout: "{{ "Next Layout" |trans }}",
                        previousLayout: "{{ "Previous Layout" |trans }}",
                        nextWidget: "{{ "Next Widget" |trans }}",
                        previousWidget: "{{ "Previous Widget" |trans }}",
                        navLayout: "{{ "Navigate to Layout" |trans }}",
                        navWidget: "{{ "Navigate to Widget" |trans }}",
                    },
                },
                widgets: "{{ "Widgets"|trans }}",
                dataWidgets: "{{ "Data Widgets"|trans }}",
                actions: "{{ "Actions"|trans }}",
                favourites: "{{ "Favourites"|trans }}",
                elements: "{{ "Elements"|trans }}",
                stencils: "{{ "Stencils"|trans }}",
                templates: "{{ "Static Templates"|trans }}",
                closeTab: "{{ "Close content"|trans }}",
                noWidgetsToShow: "{{ "No widgets to display"|trans }}",
                noActionsToShow: "{{ "No actions to display" |trans }}",
                noTemplatesToShow: "{{ "No templates to display"|trans }}",
                noMediaToShow: "{{ "No media to display!" |trans }}",
                showMore: "{{ "Show more" |trans }}",
                noShowMore: "{{ "No more results for this filter!" |trans }}",
                mediaPreview: {
                    close: "{{ "Close Preview" |trans }}",
                    change: "{{ "Change window size" |trans }}",
                    select: "{{ "Select media to add" |trans }}",
                    dimensions: "{{ "Dimensions" |trans }}",
                    size: "{{ "Size" |trans }}",
                },
                playlist: "{{ "Playlist"|trans }}",
                zone: "{{ "Zone"|trans }}",
                element: "{{ "Element"|trans }}",
                elementGroup: "{{ "Element Group"|trans }}",
                layout: "{{ "Layout"|trans }}",
                region: "{{ "Region"|trans }}",
                layoutTemplatesMessage: "{{ "Replace your Layout with a template?"|trans }}",
                isRequired: "{{ "Required"|trans }}",
            };

            var topbarTrans = {
                name: "{{ "Name" |trans }}",
                nameDetail: "{{ "Layout name" |trans }}",
                duration: "{{ "Duration" |trans }}",
                durationDetail: "{{ "Layout duration" |trans }}",
                dimensions: "{{ "Dimensions" |trans }}",
                dimensionsDetail: "{{ "Layout dimensions"|trans }}",
                layoutActions: "{{ "Layout Actions:"|trans }}",
                onlyMyLayouts: "{{ "My Layouts?"|trans }}"
            };

            var historyManagerTrans = {
                revert: {
                    saveForm: "{{ "Revert %target% form save" |trans }}",
                    order: "{{ "Revert %target% order" |trans }}",
                    transform: "{{ "Revert %target% transformation" |trans }}",
                    addWidget: "{{ "Revert %target% creation" |trans }}",
                    addMedia: "{{ "Revert %target% assignment" |trans }}",
                    create: "{{ "Revert %target% creation"|trans }}"
                }
            };

            var layerManagerTrans = {
                title: "{{ "Layers" |trans }}",
                layer: "{{ "Layer" |trans }}",
                canvas: "{{ "Canvas" |trans }}",
                inGroup: "{{ "In %groupId%" |trans }}",
                name: "{{ "Name" |trans }}",
                duration: "{{ "Duration" |trans }}",
                emptyLayout: "{{ "Empty layout" |trans }}",
            };

            var playlistAddFilesTrans = {
                uploadMessage: "{{ "Replace" |trans }}",
                addFiles: "{{ "Add Replacement" |trans }}",
                startUpload: "{{ "Start Replace" |trans }}",
                cancelUpload: "{{ "Cancel Replace" |trans }}",
                selectFolder: "{{ "Select Folder"|trans }}",
                selectFolderTitle: "{{ "Change Current Folder location"|trans }}",
                processing: "{{ "Processing..." |trans }}",
                updateInLayouts: {
                    title: "{{ "Update this media in all layouts it is assigned to?" |trans }}",
                    helpText: "{{ "Note: It will only be updated in layouts you have permission to edit."|trans }}"
                },
                deleteOldRevisions: {
                    title: "{{ "Delete the old version?" |trans }}",
                    helpText: "{{ "Completely remove the old version of this media item if a new file is being uploaded."|trans }}"
                },
                widgetExpiryDates: "{{ "Set Expiry Dates" |trans }}",
                widgetExpiryDatesMessage: "{{ "Use the check box to set Start and End dates and times for Widgets" |trans }}",
                widgetFromDtMessage: "{{ "Select the start time for this widget" |trans }}",
                widgetToDtMessage: "{{ "Select the end time for this widget" |trans }}",
                deleteOnExpiry: "{{ "Delete on Expiry" |trans }}",
                deleteOnExpiryMessage: "{{ "When the End Time for this Widget passes should the Widget be removed from the Playlist?" |trans }}",

            };

            var errorMessagesTrans = {
                error: "{{ "ERROR" |trans }}",
                loadingLayout: "{{ "There was a problem loading the Layout!" |trans }}",
                loadingPlaylist: "{{ "There was a problem loading the Playlist!" |trans }}",
                userSavePreferencesFailed: "{{ "User save preferences failed!" |trans }}",
                userLoadPreferencesFailed: "{{ "User load preferences failed!" |trans }}",
                libraryLoadFailed: "{{ "Library load failed!" |trans }}",
                formLoadFailed: "{{ "Form load failed!" |trans }}",
                revertFailed: "{{ "Revert failed: %error%" |trans }}",
                saveOrderFailed: "{{ "Save order failed: %error%" |trans }}",
                deleteFailed: "{{ "Delete failed: %error%" |trans }}",
                saveAllChangesFailed: "{{ "Save all changes failed!" |trans }}",
                removeAllChangesFailed: "{{ "Remove all changes failed!!" |trans }}",
                importingMediaFailed: "{{ "Importing media failed!!" |trans }}",
                addMediaFailed: "{{ "Add media failed: %error%" |trans }}",
                addModuleFailed: "{{ "Add module failed: %error%" |trans }}",
                createRegionFailed: "{{ "Create region failed: %error%" |trans }}",
                listOrderNotChanged: "{{ "List order not Changed!" |trans }}",
                playlistOrderSave: "{{ "Playlist save order failed!" |trans }}",
                getFormFailed: "{{ "Get form failed!" |trans }}",
                transformRegionFailed: "{{ "Transform region failed!" |trans }}",
                previewFailed: "{{ "Preview failed!" |trans }}",
                noWidgetsNeedSaving: "{{ "No widgets need saving!"|trans }}",
                requiredField: "{{  "Missing required property %property%"|trans }}",
                unknown: "{{ "Unknown Error"|trans }}",
            };

            var widgetStatusTrans = {
                setToStart: "{{ "Set to start" |trans }}",
                setToExpire: "{{ "Set to expire" |trans }}",
                expired: "{{ "Expired" |trans }}",
                startTime: "{{ "Start Time"|trans }}",
                endTime: "{{ "End Time"|trans }}"
            };

            var datasetQueryBuilderTranslations = {
                ascTitle: "{{ "Ascending" |trans }}",
                descTitle: "{{ "Descending" |trans }}",
                filterOptions: [
                    {
                        id: "starts-with",
                        value: "{{ "starts with"|trans }}"
                    }, {
                        id: "ends-with",
                        value: "{{ "ends with"|trans }}"
                    }, {
                        id: "contains",
                        value: "{{ "contains"|trans }}"
                    }, {
                        id: "equals",
                        value: "{{ "equals"|trans }}"
                    }, {
                        id: "not-starts-with",
                        value: "{{ "does not start with"|trans }}"
                    }, {
                        id: "not-ends-with",
                        value: "{{ "does not end with"|trans }}"
                    }, {
                        id: "not-contains",
                        value: "{{ "does not contain"|trans }}"
                    }, {
                        id: "not-equals",
                        value: "{{ "does not equal"|trans }}"
                    }, {
                        id: "greater-than",
                        value: "{{ "greater than"|trans }}"
                    }, {
                        id: "less-than",
                        value: "{{ "less than"|trans }}"
                    }
                ],
                filterOperatorOptions: [
                    {
                        id: "OR",
                        value: "{{ "Or"|trans }}"
                    }, {
                        id: "AND",
                        value: "{{ "And"|trans }}"
                    }
                ]
            };

            var playlistMixerTranslations = {
                fillTitle: "{% trans "Fill" %}",
                fillHelpText: "{% trans "Fill - use the first Playlist to fill any remaining Spots" %}",
                padTitle: "{% trans "Pad" %}",
                padHelpText: "{% trans "Pad - use the first Playlist to pad any remaining Spots" %}",
                repeatTitle: "{% trans "Repeat" %}",
                repeatHelpText: "{% trans "Repeat - repeat the Widgets in this Playlist until the number of Spots have been filled" %}",
                playlists: "{% trans "Playlists" %}",
                spotsHelp: "{% trans "How many spots would you like on this Sub-Playlist? This is used before ordering to expand or shrink the list to the specified size. Leave empty to use the count of Widgets." %}",
                spots: "{% trans "Spots" %}",
                spotsLengthHelp: "{% trans "Set the duration of all Widgets in the Playlist to a specific value in seconds. Leave empty to use each Widget duration." %}",
                spotsLength: "{% trans "Spot Length" %}",
                spotsFillHelp: "{% trans "If there are not enough Widgets fill all spots, how should the remaining spots be filled?" %}",
                spotsFill: "{% trans "Spot Fill" %}",
                noPermission: "{% trans "You do not have access to this playlist" %}",
                playlistId: "{% trans "Playlist Id" %}",
            };

            var datasetColumnSelectorTranslations = {
                colAvailable: "{{ "Columns Available"|trans }}",
                colSelected: "{{ "Columns Selected"|trans }}",
            };

            var actionsTranslations = {
                tableHeaders: {
                    name: "{{ "Actions" |trans }}",
                    id: "{{ "Id"|trans }}",
                    ownerId: "{{ "Owner Id"|trans }}",
                    triggerType: "{{ "Trigger Type"|trans }}",
                    triggerCode: "{{ "Trigger Code"|trans }}",
                    actionType: "{{ "Action Type"|trans }}",
                    target: "{{ "Target Type"|trans }}",
                    targetId: "{{ "Target"|trans }}",
                    widgetId: "{{ "Widget"|trans }}",
                    layoutCode: "{{ "Layout Code"|trans }}",
                },
                button: {
                    name: "{{ "Add Action" |trans }}",
                    description: "{{ "Click to Add a new Action"|trans }}"
                }
            };

            var menuBoardTranslations = {
                maxNumElementsPerZone: "{{ "There can only be one category per zone!" |trans }}",
            };

            var effectsTranslations = {
                all: "{{ "All"|trans }}",
                showAll: "{{ "Show All"|trans }}",
                showPaged: "{{ "Show Paged"|trans }}",
                none: "{{ "None"|trans }}",
                noTransition: "{{ "No Transition"|trans }}",
                marqueeLeft: "{{ "Marquee Left"|trans }}",
                marqueeRight: "{{ "Marquee Right"|trans }}",
                marqueeUp: "{{ "Marquee Up"|trans }}",
                marqueeDown: "{{ "Marquee Down"|trans }}",
                fade: "{{ "Fade"|trans }}",
                fadeout: "{{ "Fade Out"|trans }}",
                scrollHorz: "{{ "Scroll Horizontal"|trans }}",
                scrollVert: "{{ "Scroll Vertical"|trans }}",
                flipHorz: "{{ "Flip Horizontal"|trans }}",
                flipVert: "{{ "Flip Vertical"|trans }}",
                shuffle: "{{ "Shuffle"|trans }}",
                tileSlide: "{{ "Tile Slide"|trans }}",
                tileBlind: "{{ "Tile Blind"|trans }}",
            };

            var playlistEditorTrans = {
                duration: toolbarTrans.duration,
                editPlaylistTitle: "{{ "Edit Playlist - %playlistName% - "|trans }}",
                widgetsCount: "{{ "Widgets count"|trans }}",
                zoomControls: {
                    in: "{{ "Zoom In"|trans }}",
                    out: "{{ "Zoom Out"|trans }}",
                    default: "{{ "Default zoom"|trans }}",
                    scaleMode: "{{ "Change scale mode"|trans }}",
                },
            };
        {% endautoescape %}
    </script>
{% endblock %}
