Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

40 presentation.bundle

Francois 'ftiff' Levaux-Tiffreau edited this page Aug 10, 2017 · 9 revisions

TL;DR

  • At a minimum, provide the English (default) HTML file in /Library/Application Support/SplashBuddy/presentation.bundle/Base.lproj/index.html
  • Each resource (<img>…) must reside in the .lproj folder corresponding to the localization (eg. /Library/Application Support/SplashBuddy/presentation.bundle/Base.lproj/)
  • Add a localization by creating folder with the right Locale ID. For example: /Library/Application Support/SplashBuddy/presentation.bundle/fr.lproj/index.html for French

More details

### Localization

When Localization support was added to SplashBuddy, we needed to find an elegant way to support different languages for the file, while making it optional. Fortunately, Apple has built in support for this.

In practice, SplashBuddy will look at the language preferences of the user (System Preferences > Language & Region) and will try to match the top on, then second etc.

SplashBuddy expects /Library/Application Support/SplashBuddy/presentation.bundle. Apple calls it a package, which is "any directory that the Finder presents to the user as if it were a single file". Examples of such packages are: .app, .bundle, .framework, .plugin, .kext. I chose to use .bundle as it already available and very close to our use.

The structure of the package is:

  • Base.lproj contains the default (or fallback) language. For SplashBuddy, it is English.
  • fr.lproj: French localization
  • de.lproj: German localization
  • nl.lproj: Dutch localization

ℹ️ Only /Library/Application Support/SplashBuddy/presentation.bundle/Base.lproj/index.html is required.

Inside each folder is index.html which will be displayed to the user. Any local resource used by index.html must be present in the localized folder. In other words. If the French localisation displays an image, it must exist in fr.lproj. It duplicates resources, but on the plus side it means you can have localized images too!

Luckily, I provide an example 🥇

SplashBuddy only support a few localisations today for the interface, but feel free to use any localisation for presentation.bundle. You can get a description of Locale IDs here. As an example, if you want to supply an index.html for Simplified Chinese used in Hong Kong, use zh-Hans_HK.lproj/index.html.

Dimensions