import WorkspaceConfiguration .product(name: "WorkspaceConfiguration", package: "Workspace")
Instance Property


The localizations supported by the project.


var localizations: [LocalizationIdentifier] { get set }


The default contains no localizations, but some tasks may throw errors if they require localizations to be specified.

Localizing Documentation

When documenting with more than one localization active, each documentation comment must be marked according to its localization.

// @localization(🇫🇷FR) /// Vérifie l’inégalit // @localization(🇨🇦EN) @localization(🇬🇧EN) /// Checks for inequality. infix operator

Localized versions of a symbol can be cross‐referenced with each other so that they will be treated as the same symbol. In the following example, doSomething() will only appear in the English documentation and faireQuelqueChose() will only appear in the French documentation. Switching the language while looking at one of them will display the opposite function.

// @localization(🇨🇦EN) @localization(🇬🇧EN) @crossReference(doSomething) /// Does something. public func doSomething() {} // @localization(🇫🇷FR) @crossReference(doSomething) /// Fait quelque chose. public func faireQuelqueChose() {}

A set of cross references can opt out of a particular localization. This can be useful when providing aliases for something that pre‐exists in only some of the localizations.

// @localization(🇫🇷FR) @notLocalized(🇨🇦EN) /// Une chaîne de caractère public typealias ChaîneDeCaractères = String
macOS Linux