/// <reference path="Mediasite.Core.js"/>
/*global Mediasite*/
if (typeof Mediasite === "undefined" || !Mediasite) {
    var Mediasite = {};
}

 if (typeof Mediasite.namespace === "undefined" || !Mediasite.namespace) {
    Mediasite.namespace = function () {
        var a = arguments, o = null, i, j, d;
        for (i = 0; i < a.length; i = i + 1) {
            d = (a[i].toString()).split(".");
            o = Mediasite;

            for (j = (d[0] === "Mediasite") ? 1 : 0; j < d.length; j = j + 1) {
                o[d[j]] = o[d[j]] || {};
                o = o[d[j]];
            }
        }
        return o;
    };
}


Mediasite.namespace('Player.Localization');

Mediasite.Player.Localization.initialize = function () {

    Mediasite.Player.Localization.ClientDetection = {
        ErrorPageClientLoadError: Mediasite.babel('The Mediasite presentation cannot be played back.'),
        CompatiblePlugins: Mediasite.babel("The requested presentation content can be played using the following plugins:"),
        DetectedPlugins: Mediasite.babel("We have detected that your browser supports the following plugins:"),
        RequestedPlugins: Mediasite.babel("You are attempting to use the following plugins:"),
        RequestedCapabilities: Mediasite.babel("You are attempting to use the following functionality:"),
        UpgradeSilverlight: Mediasite.babel("Please install a newer version of Silverlight to watch this presentation. If you are unable to install a newer version of Silverlight, please request assistance from your system administrator or IT help desk."),
        Windows8: Mediasite.babel("If running Windows 8, you may need to switch to the desktop view."),
        NeedMultiView: Mediasite.babel("This presentation contains content that must be played with a MultiView-capable player.  Please contact your system adminstrator for help."),
        EnableFlashInChrome: Mediasite.babel("Adobe Flash Player was not detected. To unblock it, please go to chrome://settings/content"),
        EnableFlashInEdge: Mediasite.babel("Adobe Flash Player has been disabled. To re-enable it, please go to Settings, select Advanced Settings, and switch on Use Adobe Flash Player."),
        DownloadFlashText: Mediasite.babel("Download Adobe Flash Player"),

        ScreenReader: Mediasite.babel("ScreenReader"),

        WindowsMedia: Mediasite.babel("WindowsMedia"),
        Silverlight: Mediasite.babel("Silverlight"),
        Silverlight4: Mediasite.babel("Silverlight 4"),
        Flash: Mediasite.babel("Flash"),
        Html5: Mediasite.babel("Html5"),
        Html5Dash: Mediasite.babel("MPEG-DASH in MSE"),
        HLSjs: Mediasite.babel("HLS in MSE"),
        Port25: Mediasite.babel("Port25"),
        Hls: Mediasite.babel("Native HLS"),
        RampHls: Mediasite.babel("HLS Multicast"),
        NoPlugins: Mediasite.babel("None")
    };

    Mediasite.Player.Localization.PlayCover = {
        loading: Mediasite.babel("Loading..."),
        play: Mediasite.babel("Play"),
        waitingForLive: Mediasite.babel("Waiting for broadcast to begin."),
        liveIndicator: Mediasite.babel("Live"),
        liveBroadcastEnded: Mediasite.babel("Live broadcast has ended."),
        unavailable: Mediasite.babel("The presentation is currently unavailable."),
        tryAgain: Mediasite.babel("Please try again later."),
        timeUnknown: Mediasite.babel("--:--"),
        timeFormat_mmss: Mediasite.babel("%%mm%%:%%ss%%"),
        timeFormat_hhmmss: Mediasite.babel("%%hh%%:%%mm%%:%%ss%%")
    };

    Mediasite.Player.Localization.Common = {
        Slide: Mediasite.babel("Slide"),
        OK: Mediasite.babel("OK"),
        Of: Mediasite.babel("of"),
        Send: Mediasite.babel("Send"),
        Search: Mediasite.babel("Search"),
        PreviousSlide: Mediasite.babel("Previous Slide"),
        NextSlide: Mediasite.babel("Next Slide"),
        Language: Mediasite.babel("Language"),
        AudioTrack: Mediasite.babel("Audio Track"),
        Expand: Mediasite.babel("Expand"),
        Collapse: Mediasite.babel("Collapse"),
        SlideShow: Mediasite.babel("Slide Show"),
        SlideList: Mediasite.babel("Slide List"),
        Close: Mediasite.babel("Close"),
        Chapter: Mediasite.babel("Chapter"),
        Volume: Mediasite.babel("Volume"),
        Position: Mediasite.babel("Position"),
        PlaybackRate: Mediasite.babel("Playback Rate"),
        Hour: Mediasite.babel("Hour"),
        Hours: Mediasite.babel("Hours"),
        Minute: Mediasite.babel("Minute"),
        Minutes: Mediasite.babel("Minutes"),
        Second: Mediasite.babel("Second"),
        Seconds: Mediasite.babel("Seconds"),
        Duration: Mediasite.babel("Duration: %%0%%"),
        GeneralErrorTitle: Mediasite.babel("Mediasite Player Error"),
        GeneralErrorDetail: Mediasite.babel("An error occured while trying to load the presentation."),
        DeviceNotSupportedError: Mediasite.babel("This presentation cannot be played on your device. Try upgrading your browser, using another browser, or using a different device."),
        AsyncCommunicationError: Mediasite.babel("An error occurred communicating with the server"),
        ManifestLoadErrorTitle: Mediasite.babel("Manifest Load Error"),
        ManifestLoadErrorDetail: Mediasite.babel("The manifest for this presentation failed to load"),
        PopupsBlocked: Mediasite.babel("Your browser appears to be blocking pop-up windows. Please enable pop-ups and reload this page."),
        ChapterAriaLabel: Mediasite.babel("Chapter %%0%%.  %%1%%.  %%2%%"),
        TimeAriaLabel: Mediasite.babel("%%0%% hours, %%1%% minutes, %%2%% seconds"),
        SearchResultsAriaLabel: Mediasite.babel("Search result %%0%%.  %%1%%.  %%2%%"),
        RequiredField: Mediasite.babel("Required Field"),
        PrivacyPolicy: Mediasite.babel("Privacy Policy")
    };

    Mediasite.Player.Localization.Buttons = {
        ShowPolls: Mediasite.babel("Show Polls"),
        Ask: Mediasite.babel("Ask a Question"),
        Email: Mediasite.babel("Share Presentation"),
        Chapters: Mediasite.babel("Chapters"),
        Links: Mediasite.babel("Presentation Links"),
        PreviousSlide: Mediasite.babel("Previous Slide"),
        NextSlide: Mediasite.babel("Next Slide"),
        FirstSlide: Mediasite.babel("First Slide"),
        LastSlide: Mediasite.babel("Last Slide"),
        Close: Mediasite.babel("Close this Window"),
        FullScreen: Mediasite.babel("Full Screen"),
        Help: Mediasite.babel("Help"),
        MaxSlide: Mediasite.babel("Show Original Size Slideshow"),
        Polls: Mediasite.babel("View Polls"),
        Jumpback: Mediasite.babel("Jump Back"),
        Stop: Mediasite.babel("Stop"),
        Mute: Mediasite.babel("Mute"),
        UnMute: Mediasite.babel("Mute Off"),
        Play: Mediasite.babel("Play"),
        Pause: Mediasite.babel("Pause"),
        Replay: Mediasite.babel("Replay"),
        Skipback: Mediasite.babel("Skip Back"),
        CurrentSlide: Mediasite.babel("Slide Image"),
        Navigate: Mediasite.babel("Navigate"),
        PlayFaster: Mediasite.babel("Play Faster"),
        PlaySlower: Mediasite.babel("Play Slower"),
        PlaybackRate: Mediasite.babel("Adjust Playback Rate"),
        ShowCaptioning: Mediasite.babel("Show Captioning"),
        HideCaptioning: Mediasite.babel("Hide Captioning"),
        ShowCaptionSearch: Mediasite.babel("Search Slides and Closed Captioning"),
        HideCaptionSearch: Mediasite.babel("Hide Slides and Closed Caption Search"),
        Info: Mediasite.babel("Info"),
        PopOut: Mediasite.babel("Pop Out"),
        ShowSlideControls: Mediasite.babel("Zoom in on and navigate slides"),
        ScreenReaderPrompt: Mediasite.babel("To view this presentation using the screen reader-compatible player, please press ctrl + z."),
        JumpbackMore: Mediasite.babel("Jump Back More"),
        JumpForward: Mediasite.babel("Jump Forward"),
        JumpForwardMore: Mediasite.babel("Jump Forward More")
    };

    Mediasite.Player.Localization.CurrentSlide = {
        SlideImage: Mediasite.babel("Slide Image"),
        ShowFullSize: Mediasite.babel("Show Original Size Slide Show"),
        ShowSlideMagnifier: Mediasite.babel("Show Slide Magnifier"),
        HideSlideMagnifier: Mediasite.babel("Hide Slide Magnifier"),
        PresentationHasEnded: Mediasite.babel("This presentation has ended"),
        SlideNumber: Mediasite.babel("Slide %%0%%"),
        SlideNumberOfTotal: Mediasite.babel("Slide %%0%% of %%1%%")
    };

    Mediasite.Player.Localization.AskQuestion = {
        AskButton: Mediasite.babel("Ask Question"),
        Subject: Mediasite.babel("Subject:"),
        Question: Mediasite.babel("Question:"),
        Name: Mediasite.babel("Name:"),
        Email: Mediasite.babel("Email:"),
        Time: Mediasite.babel("Time:"),
        TimeFormat: Mediasite.babel("HH:MM:SS"),
        SendSuccessTitle: Mediasite.babel("Question Sent"),
        SendSuccessDetail: Mediasite.babel("Your question has been sent."),
        SendFailureTitle: Mediasite.babel("Send Error"),
        SendFailureDetail: Mediasite.babel("There was a problem sending your question.  Please try again."),
        EmailInvalid: Mediasite.babel("The email addresses you entered appears to be invalid"),
        ValidationError: Mediasite.babel("Please correct the following errors:"),
        NameRequired: Mediasite.babel("Enter your name"),
        QuestionRequired: Mediasite.babel("Enter a question for the presenter"),
        QuestionTimeError: Mediasite.babel("Enter a valid time in the presentation"),
        TimeFormatError: Mediasite.babel("Enter a start time in HH:MM:SS format"),
        SubjectRequired: Mediasite.babel("Enter a subject for your question")
    };

    Mediasite.Player.Localization.Search = {
        Header: Mediasite.babel("Search Slides and Closed Captions"),
        Search: Mediasite.babel("Search this presentation's slides and closed caption text"),
        SearchButton: Mediasite.babel("Search"),
        SearchTotal: Mediasite.babel("%%0%% results for %%1%%"),
        CurrentlySearching: Mediasite.babel("Searching for %%0%%"),
        SearchFailureTitle: Mediasite.babel("Search Error"),
        SearchFailureDetail: Mediasite.babel("There was a problem getting search results. Try refreshing the page and searching again."),
        CaptionResult: Mediasite.babel("Closed caption"),
        OcrTextResult: Mediasite.babel("Slide"),
        VoiceResult: Mediasite.babel("Voice Search"),
        SearchHitsInItem: Mediasite.babel("%%0%% results"),
        SlideSearchResult: Mediasite.babel("[Search result in slide text.]"),
        VoiceSearchResult: "[Search result in voice transcription.]"
    };

    Mediasite.Player.Localization.Email = {
        From: Mediasite.babel("From:"),
        To: Mediasite.babel("To:###ShareVideoModal###"),
        ToSeparator: Mediasite.babel("Separate addresses with a semi-colon."),
        Subject: Mediasite.babel("Subject:"),
        Message: Mediasite.babel("Message:"),
        ReturnTitle: Mediasite.babel("Share Presentation Message"),
        Time: Mediasite.babel("Start Time:"),
        TimeFormat: Mediasite.babel("HH:MM:SS"),
        UseClient: Mediasite.babel("Use Email Client"),
        ValidationError: Mediasite.babel("Please correct the following errors:"),
        SubjectRequired: Mediasite.babel("Enter a subject for your invite"),
        MessageRequired: Mediasite.babel("Enter a message for your invite"),
        SendErrorTitle: Mediasite.babel("Email Error"),
        SendSuccessTitle: Mediasite.babel("Email Sent"),
        InviteInvalid: Mediasite.babel("One of the email addresses you entered appears to be invalid.  Please check them and try again."),
        TimeInvalid: Mediasite.babel("Enter a valid time in the presentation"),
        TimeFormatError: Mediasite.babel("Enter a start time in HH:MM:SS forma")
    };

    Mediasite.Player.Localization.FullSize = {
        AutoRefresh: Mediasite.babel("AutoRefresh"),
        PlayFromSlide: Mediasite.babel("Play From This Slide"),
        RefreshNow: Mediasite.babel("Refresh Now"),
        ShowSlideCurrentlyPlaying: Mediasite.babel("Show Slide Currently Playing")
    };

    Mediasite.Player.Localization.LiveIndicator = {
        WaitingTooltip: Mediasite.babel("Waiting for Presentation to Begin"),
        LiveTooltip: Mediasite.babel("Live Broadcast"),
        EndedTooltip: Mediasite.babel("Broadcast has Ended"),
        OnDemandTooltip: Mediasite.babel("Previously Recorded"),
        PausedTooltip: Mediasite.babel("Recording is Paused")
    };

    Mediasite.Player.Localization.MediaPlayer = {
        ErrorTitle: Mediasite.babel("Media Error"),
        GeneralError: Mediasite.babel("An error occurred while attempting to play the media for this presentation."),
        FileNotFoundError: Mediasite.babel("The media file for this presentation could not be found."),
        NoCompatibleMediaError: Mediasite.babel("No compatible media was found for this presentation."),
        MulticastReceiverCommunicationError: Mediasite.babel("Unable to play multicast media. Communication with the multicast receiver failed."),
        MulticastProgressError: Mediasite.babel("Unable to play multicast media. Not enough multicast data was received."),
        ServerConnectionError: Mediasite.babel("Unable to connect to the media server. Reloading the presentation may resolve this problem."),
        ServerConnectionClosedError: Mediasite.babel("Unable to play the presentation because the connection to the server has been closed. Reloading the presentation may resolve this problem."),
        SilverlightLoadErrorNonAsciiPath: Mediasite.babel("The presentation could not be loaded because of non-Latin characters in the file or folder names. Loading the presentation in a different browser, such as Internet Explorer, may resolve this problem."),
        ServerNotAvailable: Mediasite.babel("Unable to play the presentation due to a media server error.  Reloading the presentation may resolve this problem."),
        SilverlightNetworkError: Mediasite.babel("Unable to play the presentation. The media server may not be available or the media stream format may not be supported."),
        SilverlightSetValueError: Mediasite.babel("Unable to set the following value for this presentation: "),
        SilverlightFullScreenPrompt: Mediasite.babel("Click for full-screen mode"),
        ClickToActivatePlugin: Mediasite.babel("Activate the plugin to enable the Mediasite Player"),
        ClipEnded: Mediasite.babel("(Clip Ended)"),

        AdaptiveStreamingNetworkError: Mediasite.babel("Some media for this presentation failed to download. Reloading the presentation may resolve the problem."),
        AdaptiveStreamingMediaError: Mediasite.babel("Some media for this presentation could not be played. Reloading the presentation may resolve the problem."),
        AdaptiveStreamingMuxError: Mediasite.babel("Some of the media data for this presentation could not be processed. Reloading the presentation may resolve the problem."),

        BitrateKbpsFormat: Mediasite.babel("%%0%% kbps"),
        BitrateMbpsFormat: Mediasite.babel("%%0%% Mbps"),
        ResolutionFormat: Mediasite.babel("%%0%%x%%1%%"),
        MediaFidelityToolTipFormat: Mediasite.babel("Video Quality (%%0%%)"), // %%0%% will contain the bitrate
        MediaFidelityToolTip: Mediasite.babel("Video Quality"),

        State: {
            Undefined: Mediasite.babel("Undefined State"),
            Stopped: Mediasite.babel("Stopped"),
            Paused: Mediasite.babel("Paused"),
            Playing: Mediasite.babel("Playing"),
            ScanForward: Mediasite.babel("Fast Forward"),
            ScanReverse: Mediasite.babel("Rewind"),
            Buffering: Mediasite.babel("Buffering"),
            Waiting: Mediasite.babel("Waiting"),
            MediaEnded: Mediasite.babel("Media Ended"),
            Transitioning: Mediasite.babel("Transitioning"),
            Ready: Mediasite.babel("Ready"),
            Reconnecting: Mediasite.babel("Reconnecting"),
            Closed: Mediasite.babel("Closed"),
            Error: Mediasite.babel("Error"),
            Opening: Mediasite.babel("Opening"),
            Unknown: Mediasite.babel("Unknown State")
        }
    };

    Mediasite.Player.Localization.PlayerLayout = {
        AudioOnly: Mediasite.babel("Audio-only Presentation"),
        NotStarted: Mediasite.babel("The presentation has not started")
    };


    Mediasite.Player.Localization.PresentationCard = {
        Presenters: Mediasite.babel("Presenters:"),
        Description: Mediasite.babel("Description:"),
        AirDate: Mediasite.babel("Date:"),
        AirTime: Mediasite.babel("Time:"),
        Duration: Mediasite.babel("Length:"),
        DefaultTitle: Mediasite.babel("Mediasite Presentation"),
        DefaultDescription: Mediasite.babel("Presentation Description"),
        More: Mediasite.babel("More...")
    };


    Mediasite.Player.Localization.Thumbnails = {
        SlideList: Mediasite.babel("Slide List"),
        SmallThumbnails: Mediasite.babel("Small Thumbnails"),
        StandardThumbnails: Mediasite.babel("Thumbnails"),
        LargeThumbnails: Mediasite.babel("Large Thumbnails"),
        Chapters: Mediasite.babel("Chapters"),
        PreviewSlide: Mediasite.babel("Preview this slide"),
        PreviewSlidePopout: Mediasite.babel("Preview this slide in another window"),
        PlayFromSlide: Mediasite.babel("Play from this slide"),
        ExpandSlides: Mediasite.babel("Click to Expand Slide Group"),
        CollapseSlides: Mediasite.babel("Click to Collapse Slide Group"),
        Page: Mediasite.babel("Page"),
        Of: Mediasite.babel("of"),
        Previous: Mediasite.babel("Previous"),
        Next: Mediasite.babel("Next")
    };


    Mediasite.Player.Localization.ScreenReader = {
        MediaControls: Mediasite.babel("Media Controls"),
        PlaybackRate: Mediasite.babel("Playback Rate"),
        VolumeIncrease: Mediasite.babel("Increase Volume"),
        VolumeDecrease: Mediasite.babel("Decrease Volume"),
        UseCurrentTime: Mediasite.babel("Use current time"),
        SendQuestion: Mediasite.babel("Send Question"),
        SendEmail: Mediasite.babel("Send Email"),
        ShareUsingEmailClient: Mediasite.babel("Share this presentation using your preferred email application"),
        StandardPlayerPrompt: Mediasite.babel("To view this presentation using the standard player, please press ctrl + z."),
        keyboardShortcutsMessagePrompt: Mediasite.babel("For a list of important keyboard shortcuts, please press ctrl + q."),
        KeyboardShortcutsPanelHeader: Mediasite.babel("Important Keyboard Shortcuts"),
        keyboardShortcutsMessage:
    '<div>' +
    Mediasite.babel("The following is a list of important keyboard shortcuts.  For more help, please follow this link: <a id=\"screenReaderHelpLink\" href=\"#\" target=\"_blank\">Mediasite Player Help</a>.") +
    '<ul>' +
    Mediasite.babel("<li>Press the space bar to play and pause the presentation.") +
    '</li>' +
    Mediasite.babel("<li>Press the left bracket key to Jump Back. ") +
    '</li>' +
    Mediasite.babel("<li>Press the right bracket key to Jump Forward. ") +
    '</li>' +
    Mediasite.babel("<li>Press shift plus the left bracket key to Jump Back More. ") +
    '</li>' +
    Mediasite.babel("<li>Press shift plus the right bracket key to Jump Forward More. ") +
    '</li>' +
    Mediasite.babel("<li>Press control plus the left bracket key to Jump Back 30 seconds. ") +
    '</li>' +
    Mediasite.babel("<li>Press control plus the right bracket key to Jump Forward 30 seconds. ") +
    '</li>' +
    Mediasite.babel("<li>Press shift plus the up arrow key to increase the volume of the presentation.") +
    '</li>' +
    Mediasite.babel("<li>Press shift plus the down arrow key decrease the volume of the presentation.") +
    '</li>' +
    Mediasite.babel("<li>Press the M key to mute the volume of the presentation.") +
    '</li>' +
    Mediasite.babel("<li>To repeat this list again please press ctrl + q.") +
    '</li>' +
    '</ul>' +
    '</div>'
    };

    Mediasite.Player.Localization.AriaMessages = {
        SlideHasText: Mediasite.babel("Slide has text"),
        ChapterChanged: Mediasite.babel("Entered Chapter: %%0%%.  %%1%% percent."),
        SeekedToChapter: Mediasite.babel("Seeked to Chapter: %%0%%.  %%1%% percent."),
        SeekedTo: Mediasite.babel("Seeked to %%0%% percent"),
        SurveyExtensionMessage: Mediasite.babel("Post presentation link: %%0%%.")
    };

    Mediasite.Player.Localization.MiniPlayer = {
        ShowVideo: Mediasite.babel("Show Video"),
        ShowSlide: Mediasite.babel("Show Slide")
    };

    Mediasite.Player.Localization.PipPlayer = {
        SwapMediaElements: Mediasite.babel("Swap Media Elements")
    };

    Mediasite.Player.Localization.NewStandardPlayer = {
        DefaultSlideTitleFormat: Mediasite.babel("Slide %%0%%"),
        SwapMediaElements: Mediasite.babel("Swap Media Elements"),
        PipLayout: Mediasite.babel("Picture in Picture"),
        SideBySideLayout: Mediasite.babel("Side by Side"),
        FullFrameLayout: Mediasite.babel("Full Frame")
    };

    Mediasite.Player.Localization.ContentOnlyPlayer = {
        DefaultSlideTitleFormat: Mediasite.babel("Slide %%0%%"),
        PresentationEndedMessage: Mediasite.babel("Presentation Ended"),
        WaitingToBeginMessage: Mediasite.babel("Waiting for live broadcast to begin...")
    };

    Mediasite.Player.Localization.SmartPlayer = {
        Links: Mediasite.babel("Links"),
        MoreButtons: Mediasite.babel("Show more"),
        NotStarted: Mediasite.babel("The following live presentation has not started."),
        ScheduledDate: Mediasite.babel("Scheduled Date: "),
        StartingIn: Mediasite.babel("Presentation will start in: "),
        Status: Mediasite.babel("Presentation status: "),
        CloseLightbox: Mediasite.babel("Close"),
        ClosePanel: Mediasite.babel("Close"),
        CycleLightboxContent: Mediasite.babel("Change viewed content"),
        PopOutStream: Mediasite.babel("Pop-out"),
        ShowStreamAsPrimary: Mediasite.babel("Show as primary content"),
        PlayStreamAsVideo: Mediasite.babel("Play as video"),
        CyclePrimaryContent: Mediasite.babel("Change primary content"),
        ToggleStageLightbox: Mediasite.babel("Toggle stage lightbox")
    };

    Mediasite.Player.Localization.ClassicPlayer = {
        CloseSlideZoom: Mediasite.babel("(close)")
    };

    Mediasite.Player.Localization.SlideNav = {
        ExpandStack: Mediasite.babel("Click to Expand Slide Group"),
        CollapseStack: Mediasite.babel("Click to Collapse Slide Group")
    };
};
