Localize on iOS

The instream SDK provides a convenient way to add languages or change the strings used by the ad player on supported languages.

  1. Supported languages
  2. Adding / changing localization
  3. Strings keys

Supported languages

By default, the SDK is shipped with the following languages:

  • English
  • French
  • German
  • Spanish
  • Italian
  • Turkish
  • Polish
  • Russian
  • Portuguese
  • Chinese

Adding / changing localization

  • Create a SVSVideoKit.strings file in your application project.

    Or just copy one from the SVSVideoKit.framework localized folders, for example in en.lproj.

  • Add this new file to your app's target.

    This will add your string file to your application main bundle.

  • Use Xcode utilities panel to add the localizations you want.
  • Edit the strings you want to change.

    You can refer to the string keys table for description and identifier of each supported string.
    Note that {0} can be used as a placeholder for time values.

  • Tell the SDK about your string file.

    You can pass your prefered string bundle to the SVSConfiguration shared instance.
    By default, the SVSVideoKit.framework bundle will be used, but if you specify another bundle, the SDK will look into this bundle to find the strings and fallback on its own bundle if nothing is found in yours.

    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    	// ...
    
    	// Indicates to the SDK in which bundle to look first for the SVSVideoKit.strings file.
    	// If the requested key for a string is not found in specified bundle,
    	// the SDK will fallback on its own bundle.
        [[SVSConfiguration sharedInstance] setStringsBundle:[NSBundle mainBundle]];
    
        // ...
    }
    

Localized strings

Here is the exhaustive list of the keys used to localized strings in the SVSVideoKit.strings resource file.

Please refer to SVSVideoKit.strings file shipped with the framework for more detailed documentation about placeholders and time formats that you can use for each string.


Key Description
svsvideokit.strings.ui.adbreak.preroll.countdown_message Countdown message displayed until the end of the Preroll Ad Break.
svsvideokit.strings.ui.adbreak.midroll.countdown_message Countdown message displayed until the end of the Midroll Ad Break.
svsvideokit.strings.ui.adbreak.postroll.countdown_message Countdown message displayed until the end of the Postroll Ad Break.
svsvideokit.strings.ui.skip.countdown_message Countdown message displayed before the skip button is clickable.
svsvideokit.strings.ui.skip.button_text Text displayed on the skip button when active.
svsvideokit.strings.ui.clickthrough.button_text Text displayed on the clickthrough button if enabled.
Check Publisher Options in Player Configuration documentation for more information.