Platforms to show: All Mac Windows Linux Cross-Platform

Back to Application class.

Application.BundleLocalizedStringMBS(key as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the localized string for the given key from the default table.

A short version for BundleLocalizedString which uses the default table.

See also:

Application.BundleLocalizedStringMBS(key as string,fromtable as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the localized string for the given key and table.
Example
// You may make yourself a function to look up for the key and return
// This function was not tested in a real application. May contain a bug.

function Localize(key as string, default as string) as string
dim s as string

s=app.BundleLocalizedStringMBS(key)
if s="" then
s=default // For Mac OS Classic and Windows
elseif s=key then // returns key for not localized items
msgbox "For developer: the key """+key+""" was not localized for any language."
end if

return s
end sub

// use like this
FileOpen.text=Localize("FileOpenLabel", "Open...")

The table parameter is optional to specify which ".strings"-file to use.
without table or table="" the "Localizable.strings" file is used by Mac OS X.

Returns "" (empty string) on Mac OS Classic or Windows.

See also:

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...