Skip to main content

Localization

The lang property under config is used to customize the player's language. It has the following structure:

  • locale: A string that specifies the locale of the player, such as "en" for English or "es" for Spanish.
  • controls: An object that holds the labels for the player's controls.
  • settings: An object that holds the labels used inside the settings menu.
  • ads: An object that holds the labels used by the ad UI.
  • messages: An object that holds the localized strings for informational messages.
vpAudioPlayer("audio-localization").setup({
audio: {
file: "the_audio_file_path"
},
config: {
lang: {
locale: "en",
controls: {
play: "Play",
pause: "Pause",
next: "Next",
back: "Back",
replay: "Replay",
volumeText: "Volume",
mute: "Mute",
unmute: "Unmute",
settings: "Settings",
chromecast: "Chromecast",
playlist: "Playlist",
airplay: "Airplay",
podcast: "Podcast",
playlistTitle: "Continue Listening",
},
settings: {
quality: "Quality",
autoplay: "Autoplay",
playbackSpeed: "Playback speed",
auto: "Auto",
off: "Off",
on: "On",
normal: "Normal",
share: "Share Video",
},
ads: {
skipAd: "Skip Ad",
advertisement: "Advertisement",
},
messages: {
season: "Season",
episode: "Episode",
paywallRestrictedTitle: "This audio includes paid content",
paywallRestrictedDescription: "Please Subscribe to our site to unlock this content.",
},
},
}
});

Controls

PROPERTYDESCRIPTION
controls ObjectHolds the labels for the player controls.
play stringLabel for the play button.
pause stringLabel for the pause button.
next stringLabel for the next audio button.
back stringLabel for the previous audio button.
replay stringLabel for the replay button.
volumeText stringLabel for the volume control.
mute stringLabel for the mute button.
unmute stringLabel for the unmute button.
settings stringLabel for the settings button.
chromecast stringLabel for the Chromecast button.
playlist stringLabel for the playlist button.
airplay stringLabel for the AirPlay button.
podcast stringLabel for the podcast button.
playlistTitle stringTitle used at the top of the playlist panel.

Settings

PROPERTYDESCRIPTION
settings ObjectHolds the labels used inside the settings menu.
quality stringLabel for the quality option.
autoplay stringLabel for the autoplay option.
playbackSpeed stringLabel for the playback speed option.
auto stringLabel used for the "auto" value (e.g., Auto quality).
off stringLabel used for the "off" value.
on stringLabel used for the "on" value.
normal stringLabel used for the "normal" playback speed.
share stringLabel for the share option.

Ads

PROPERTYDESCRIPTION
ads ObjectHolds the labels used by the ad UI.
skipAd stringLabel for the skip-ad button.
advertisement stringLabel displayed during ad playback to indicate that an ad is currently playing.

Messages

PROPERTYDESCRIPTION
messages ObjectHolds the localized strings for informational messages.
season stringLabel used to prefix the season number (e.g., "Season", "Sezona").
episode stringLabel used to prefix the episode number (e.g., "Episode", "Episodi").
paywallRestrictedTitle stringTitle shown on the paywall overlay when audio locking blocks playback.
paywallRestrictedDescription stringDescription shown on the paywall overlay when audio locking blocks playback.