Enable localization (iOS)
Enable, customize, and improve player accessibility for your iOS or tvOS app.
The iOS or tvOS SDK selects the appropriate string from one of the available string tables. The SDK searches the string tables in the following order:
- Main bundle string tables in the app.
- String tables in the
JWPlayerKit
(iOS SDK) orJWPlayerTVKit
(tvOS SDK) - English string tables in the iOS SDK or tvOS SDK.
By creating a string table for a language, you can customize the displayed string for menus, title bars, and strings in many other interfaces. Your language-specific string table will override the string tables in the iOS SDK or tvOS SDK.
You can create string tables for any language, allowing you to customize the video experience for your global users.
There are a handful of classes created by our builders which take a string as an argument. These values are not localized by the SDK. Instead, you should provide a localized string to these structures, or override their default in your string tables using our string keys.
For example, in
JWAdInterfaceStyleBuilder
there are string properties forskipText
,countdownText
, andskipDelayText
. These strings will be displayed as provided. Thus, if you set one to βSkip Aheadβ the text displayed is βSkip Aheadβ and is not looked up from the string table.
Requirements
- JWPlayerKit 4.3.0+ (iOS)
- JWPlayerTVKit 1.0.0+ (tvOS)
Enable localization
General
Use the following steps to enable localization:
- Create language-specific string tables for the app. Refer to the String Table to see the list of customizable strings in the player.
- In the info.plist of the app, add the
CGBundleAllowMixedLocalizations
key and set the value toYES
. When added to info.plist, the key appears as Localized resources can be mixed.
<key>CGBundleAllowMixedLocalizations</key>
<string>YES</string>
Google IMA
By default, Google IMA uses the language specified in the userβs default settings.
Use the following steps to override the default settings:
- Use
JWImaSettingsBuilder()
to create aJWImaSettings object
. - Define
locale
with the two-letter language code.
let imaSettings = try! JWImaSettingsBuilder()
.locale("en") // Set to English
.build()
// adConfigBuilder is a JWImaAdvertisingConfigBuilder
adConfigBuilder.imaSettings(imaSettings)
JWImaSettings *imaSettings = [[[[JWImaSettingsBuilder alloc] init] locale:@"en"] build];
// adConfigBuilder is a JWImaAdvertisingConfigBuilder
[adConfigBuilder imaSettings:imaSettings];
Localization Reference
Default Supported Languages
Both SDKs support localization for the languages in the following table.
Arabic (ar) | Chinese (zh) | Danish (da) | Dutch (nl) |
English (en) | Finnish (fi) | French (fr) | German (de) |
Greek (el) | Hebrew (he) | Indonesian (id) | Italian (it) |
Japanese (ja) | Korean (ko) | Norwegian Bokmal (no) | Occitan (oc) |
Polish (pl) | Portuguese (pt) | Romanian (ro) | Russian (ru) |
Spanish (es) | Swedish (sv) | Thai (th) | Turkish (tr) |
Vietnamese (vi) |
String Table
The following table lists all strings that can be customized for a language-specific string table. The default English string is listed for each string.
String | Description |
---|---|
jwplayer_ad_countdown | Prefix for the ad countdown English: Ad in NOTE: The number of seconds until the ad begins is appended on the end of the string. |
jwplayer_advertisement | Displayed in the control center when an advertisement is playing while the application is backgrounded English: Advertisement |
jwplayer_advertising_remaining_time | Countdown text that displays during ad playback English: This ad will end in xx NOTE: The letters, xx, are replaced with a number of seconds. |
jwplayer_advertising_skip_message_tvos | Displayed on a JW VAST ad when there is no option to skip English: Video will play after ad |
jwplayer_advertising_skip_message | Skip countdown message during VAST ad playback English: Skip ad in xx NOTE: The letters, xx, are replaced with a number of seconds. |
jwplayer_advertising_skip_text | Button text that appears when an ad is skippable English: Skip |
jwplayer_airplay | Accessibility label for Airplay button English: AirPlay |
jwplayer_am | Suffix on a time in the day before noon. English: AM |
jwplayer_audio | Menu header for language settings English: Audio |
jwplayer_audio_and_subtitles | Menu header for subtitles and audio in the same menu English: Audio & Subtitles |
jwplayer_audio_tracks | Header above a selection of audio tracks in the Audio & Subtitles menu English: Audio Tracks |
jwplayer_auto | Label text for the default quality selection option that allows the player to automatically select the appropriate quality level for the viewer English: Auto |
jwplayer_back | Text displayed and used for a back button in a menu English: Back |
jwplayer_cancel | Menu option for cancelling out of a menu English: Cancel |
jwplayer_cast_connect_to_a_device | Menu header for casting menu displaying devices English: Connect to a device |
jwplayer_cast_disconnect | Menu option to disconnect from a casting or linked device English: Disconnect |
jwplayer_cast_playing_on | Title on the casting information button while it is casting English: Playing on device NOTE: __device__ is replaced by the device name. |
jwplayer_cast_scanning | Informational text when scanning for casting devices English: Scanning for devices... |
jwplayer_cast_use_same_wifi | Menu subtext for casting, informing the user to be on the same WiFi network as the device they are searching for and wish to connect to English: Make sure your device is connected to the same WiFi network. |
jwplayer_casting_info_button_title | Title displayed on the blue button when casting English: Casting Info |
jwplayer_chapter | Singular word: chapter English: Chapter |
jwplayer_chapters | Plural word: chapters English: Chapters |
jwplayer_chromecast | Accessibility label for ChromeCast button English: Chromecast |
jwplayer_close | Text on a close button used to close a menu or overlay English: Close |
jwplayer_close_menu | Accessibility label for closing the menu English: close menu |
jwplayer_done | Button on menus labeled: done English: Done |
jwplayer_errors_bad_connection | Error message text displayed when a connection issue prevents playback English: This video cannot be played because of a problem with your internet connection. |
jwplayer_errors_cant_load_player | Error message text displayed when a player fails to set up for a non-network reason, like incorrect JSON or license keys English: Sorry, the video player failed to load. |
jwplayer_errors_cant_play_video | Error message text displayed when a media item fails to load and the reason is because of the media file itself English: This video file cannot be played. |
jwplayer_errors_error_code | Label text for a numeric error code, for example, Error code: 50244402 English: Error Code |
jwplayer_errors_live_stream_down | Error message text displayed when a live stream down or has ended English: The live stream is either down or has ended. |
jwplayer_errors_protected_content | Error message text displayed when DRM or protected content fails English: There was a problem providing access to protected content. |
jwplayer_errors_technical_error | Generic error message text for all cases that do not fit in another situation English: This video cannot be played because of a technical error. |
jwplayer_exit_fullscreen | Text in the control bar to exit fullscreen English: Exit Fullscreen |
jwplayer_forward_15_seconds | Accessibility label for fast forwarding English: fast forward 15 seconds |
jwplayer_from_beginning | Displayed in the information panel, on the restart button English: From beginning |
jwplayer_fullscreen | Accessibility label for the full screen button English: Fullscreen |
jwplayer_go_to_live | Text for the βgo to liveβ button English: Go to live |
jwplayer_hours_abbr | Abbreviation for hours English: hrs |
jwplayer_learn_more | Tap-through button on the VAST ad UI English: Learn more |
jwplayer_live_broadcast | Label text for live streams, displayed in the control bar English: Live |
jwplayer_menu | Accessibility label for opening the settings menu English: menu |
jwplayer_minutes_abbr | Abbreviation for minutes English: mins |
jwplayer_more_videos | Button text and overlay heading for recommended video interfaces English: More Videos |
jwplayer_next | Accessibility label for the right arrow in paginated overlays English: Next |
jwplayer_next_up | Title of an overlay that displays the next item to automatically play English: Next Up |
jwplayer_next_up_countdown | Countdown message text until the next item automatically plays English: Next up in xx NOTE: The letters, xx, will be programmatically replaced by a number of seconds. |
jwplayer_next_up_countdown_tvos | Countdown message text until the next item automatically plays English: Up next in xx... NOTE: The letters, xx, will be programmatically replaced by a number of seconds. |
jwplayer_normal | Word for 1x playback speed English: Normal |
jwplayer_not_specified | Menu option for video quality is not being specified by the user English: Not specified |
jwplayer_off | Menu option text for turning an option off, such as closed captions English: Off |
jwplayer_okay | Okay, as displayed on a button for the affirmative English: Okay |
jwplayer_pause | Accessibility label for the pause button English: Pause |
jwplayer_picture_in_picture | Accessibility label for picture in picture button English: Picture in Picture |
jwplayer_play | Accessibility label for the play button English: Play |
jwplayer_playback_rates | Header text for the playback rate controls menu English: Playback Rates |
jwplayer_player | Accessibility label for the player English: Video Player |
jwplayer_playlist | Playlist menu header English: Playlist |
jwplayer_pm | Suffix on a time in the day after noon English: PM |
jwplayer_previous | Accessibility label for the previous playlist item button English: Previous |
jwplayer_quality | Header text for the video quality controls menu English: Quality |
jwplayer_recommendations | Recommendations menu header English: Recommendations |
jwplayer_replay | Accessibility label for the replay button English: Replay |
jwplayer_resume | Text for a button used to resume playback English: Resume |
jwplayer_seconds_abbr | Abbreviation for seconds English: secs |
jwplayer_subtitles | Menu header for subtitles menu English: Subtitles |
jwplayer_unavailable | Single-word text for describing when a menu or option is unavailable English: Unavailable |
Updated almost 2 years ago