[Enhancement] String localisation (#21)
This PR contains the work done to provide string localisation support for the
Core
library.To provide further details about the work done:
- implemented the
localisation(for:)
function for theBundle+LocalisationBundle
extension;- implemented the
localise(for: in: value: table:)
function for theString+Localisation
extension;- defined English as the default localisation language in the
Package.swift
file;- added the “vscode” target to the
Makefile
file.Co-authored-by: Javier Cicchelli javier@rock-n-code.com Reviewed-on: https://repo.rock-n-code.com/rock-n-code/swift-libs/pulls/21
SwiftLibs
This package contains the core building blocks that we, Röck+Cöde, usually use to build our libraries and application written in the Swift programming language.
Libraries
This package contains several libraries which can be imported, and these libraries are grouped by a certain concern, feature or purpose.
To provide further details about the libraries included in this package:
Communications
: protocols, enumerations and a ready-to-use mock url class to build remote API services;Coordination
: protocols to implement the Coordinator pattern and some ready-to-use platform-specific concrete routers;Core
: extensions we usually add to the base layer functionality and primitive types provided by the Swift standard library;Dependencies
: a ready-to-use, simple Dependency Injection mechanism that levers heavily on the dynamic property wrappers provided by the Swift programming language;Persistence
(available for Apple platforms only): protocols, extensions and a ready-to-use fetcher class to simplify the building of the CoreData persistence layer;Installation
It is possible to add this package to other libraries and applications by adding it as a dependency in a
Package.swift
file or in a Xcode project, through the Package dependencies interface.This package has minimum platform requirements that are important to take into account:
Package file
In the intended
Package.swift
file, it is required to add the following dependency:Then it is required to add the package to your target, like this:
Xcode
In an opened Xcode project, it is required to follow these steps to install the package:
https://github.com/rock-n-code/swift-libs.git
into the Search or Enter Package URL located in the upper right corner;Other considerations
This library is fully supported on Apple platforms: iOS, macOS, tvOS, and watchOS. In addition, basic support for Linux platform has been added as well, but it is rather limited for the time being. It is just a matter of time, though, as the Foundation framework is moving towards cross-platform support by moving away from its dependency on legacy Objective-C components.
⚠️ Please notice that this library only supports the Swift Package Manager, and that support for other dependency managers such as Cocoapods and Carthage has not been prioritised.