XF 2.3 How do I translate phrases that are embedded in js

Vollmond

Member
Licensed customer
How to translate phrases that are in the file fancybox.umd.js ?
Code:
l10n: { NEXT: "Next slide", PREV: "Previous slide", GOTO: "Go to slide #%d" },
*******************************
            l10n: Object.assign(Object.assign({}, y), {
                CLOSE: "Close",
                NEXT: "Next",
                PREV: "Previous",
                MODAL: "You can close this modal content with the ESC key",
                ERROR: "Something Went Wrong, Please Try Again Later",
                IMAGE_ERROR: "Image Not Found",
                ELEMENT_NOT_FOUND: "HTML Element Not Found",
                AJAX_NOT_FOUND: "Error Loading AJAX : Not Found",
                AJAX_FORBIDDEN: "Error Loading AJAX : Forbidden",
                IFRAME_ERROR: "Error Loading Page",
                TOGGLE_ZOOM: "Toggle zoom level",
                TOGGLE_THUMBS: "Toggle thumbnails",
                TOGGLE_SLIDESHOW: "Toggle slideshow",
                TOGGLE_FULLSCREEN: "Toggle full-screen mode",
                DOWNLOAD: "Download",
            }),
 
this is old (jquery) variant, but

might help
 
How to translate phrases that are in the file fancybox.umd.js ?
Code:
l10n: { NEXT: "Next slide", PREV: "Previous slide", GOTO: "Go to slide #%d" },
*******************************
            l10n: Object.assign(Object.assign({}, y), {
                CLOSE: "Close",
                NEXT: "Next",
                PREV: "Previous",
                MODAL: "You can close this modal content with the ESC key",
                ERROR: "Something Went Wrong, Please Try Again Later",
                IMAGE_ERROR: "Image Not Found",
                ELEMENT_NOT_FOUND: "HTML Element Not Found",
                AJAX_NOT_FOUND: "Error Loading AJAX : Not Found",
                AJAX_FORBIDDEN: "Error Loading AJAX : Forbidden",
                IFRAME_ERROR: "Error Loading Page",
                TOGGLE_ZOOM: "Toggle zoom level",
                TOGGLE_THUMBS: "Toggle thumbnails",
                TOGGLE_SLIDESHOW: "Toggle slideshow",
                TOGGLE_FULLSCREEN: "Toggle full-screen mode",
                DOWNLOAD: "Download",
            }),
Code:
XF.phrase(name, vars, fallback)

  - name — the phrase key string
  - vars — object of replacements (optional)
  - fallback — fallback string if phrase isn't found (optional); defaults to returning the phrase key name itself

  // Simple
  XF.phrase('save_changes')

  // With replacements
  XF.phrase('showing_x_of_y', { '{count}': 5, '{total}': 20 })

  // With fallback
  XF.phrase('some_phrase', null, 'Default text')
 
Back
Top Bottom