Translations

By default, only English translations are included in the player's user interface (UI). However, all text strings in the player UI can be translated to adapt Wowza Flowplayer to non-English speaking audiences. You can also configure the player to add translations for specific languages or all available languages.

Install translations

This section describes two methods of installing the translations package so you can customize the player UI with available languages.

The easiest way to install translations for the player UI is to use the player code hosted on the Wowza Flowplayer CDN. However, if you use Node Package Manager (npm) to embed the player in your site, you also have to use npm to add the Wowza Flowplayer translation files.

Using Wowza Flowplayer CDN

If using the Flowplayer CDN, you can include translation files for your preferred languages with the following:

Copy
Copied
<!-- Include the Finnish translations -->
<script src="//cdn.flowplayer.com/releases/native/translations/flowplayer.lang.fi.js"></script>

<!-- Include all languages for translations -->
<script src="//cdn.flowplayer.com/releases/native/translations/flowplayer.lang.all.js"></script>

The localization changes the language display for various player UI elements as shown in these images:

Localized Elements

Here's another screenshot example from a German setup with subtitles:

Localized Player

Using npm

The @flowplayer/translations package is available for download via npm. If you added the standalone player to your site with npm and you plan to incorporate different languages, you must also install the translations package via npm.

Copy
Copied
npm install @flowplayer/translations

The npm package provides IDE support for autocompletion of all available language options. To add a language to your project, import the @flowplayer/translations npm package and assign the language to the i18n object:

Copy
Copied
import flowplayer from "@flowplayer/player"
import Hls from "@flowplayer/player/plugins/hls"
import Qsel from "@flowplayer/player/plugins/qsel"
import {fr} from "@flowplayer/translations"

flowplayer(Hls, Qsel)
Object.assign(flowplayer.i18n, {fr})

flowplayer("#player", {
    src: "https://link.to.a.video.file",
    autoplay: false,
    lang: "fr",
    token: "[your-token]",
  }
)

You can load all available languages or a set of selected languages at once. When you omit the lang configuration property, the language is selected based on the browser's preferred language settings. To learn more, see Configure translations.

Import all languages Import selected languages
Copy
Copied
                    
    // Import all available languages
    import flowplayer from "@flowplayer/player"
    import Hls from "@flowplayer/player/plugins/hls"
    import Qsel from "@flowplayer/player/plugins/qsel"
    import * as languages from "@flowplayer/translations"
    
flowplayer(Hls, Qsel) Object.assign(flowplayer.i18n, languages)
flowplayer("#player", { src: "https://link.to.a.video.file", autoplay: false, token: "[your-token]", } )
Copy
Copied
                    
    // Import French, German, and Greek only
    import flowplayer from "@flowplayer/player"
    import Hls from "@flowplayer/player/plugins/hls"
    import Qsel from "@flowplayer/player/plugins/qsel"
    import {fr, de, gr} from "@flowplayer/translations"
    
flowplayer(Hls, Qsel) Object.assign(flowplayer.i18n, {fr, de, gr})
flowplayer("#player", { src: "https://link.to.a.video.file", autoplay: false, token: "[your-token]", } )

Configure translations

The default language for the player UI is English. If you load a script for any other language, we suggest you set the top-level lang property to force the translation set:

Copy
Copied
flowplayer("#player", {
  src: "https://link.to.a.video.file",
  token: "[your-token]",
  lang: "fi" // Finnish language [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
})

When you load another language and don't set the lang property, the player checks the browser's preferred languages and selects a language based on those settings. It steps through all languages in the order they're set until a matching option is found. If no option is found, English serves as the baseline.

You can also script selection buttons if you want to offer a choice of languages to your audience. For more, see our demo.

See available languages

Available language options for the player are included in the following table. Each language is identified by the two-letter ISO 639-1 code in the URL, which has this format: https://cdn.flowplayer.com/releases/native/translations/flowplayer.lang.[iso code].js

Available languages
Chinese (simplified) Norwegian Bokmål
Czech Norwegian Nynorsk
English Occitan
Finnish Polish
French Portuguese
German Slovak
Greek Spanish
Hebrew Swedish
Netherlands Turkish

Contribute a translation

If your language is not available and you'd like to contribute a translation, use these steps.

  1. Clone the English translation set .
  2. Rename the set with the ISO code of your language.
  3. Declare and export the language constant using the appropriate ISO code.
  4. Complete all relevant keys for your language.
  5. Create a pull request in the translations repo .

See a demo

When you view this CodePen demo, you can click one of the non-English buttons, click the play button, then select the HD menu to see it display in the language you selected.