This documentation is not updated anymore. All documentation of Respresso moved to https://respresso.io/docs.
Content | Link |
---|---|
Add Respresso to new or exiting iOS project | https://respresso.io/docs/guides/ios-project-setup |
Get started with Respresso CLI (auto-sync) | https://respresso.io/docs/get-started-with-respresso-sync |
Migrate from legacy CLI to the new CLI | https://respresso.io/docs/docs/guides/migrate-from-legacy-ios-cli-and-objective-c-classes |
Content | Link |
---|---|
All about Respresso CLI setup in Xcode build | https://respresso.io/docs/ios-xcode-resource-sync |
Respresso CLI reference (auto-sync) | https://respresso.io/docs/respresso-cli-reference |
Respresso CLI config reference (auto-sync) | https://respresso.io/docs/respresso-cli-config-reference |
Import existing resources from iOS project | Localization, Image (raster or pdf), Color |
Localization format - .strings | https://respresso.io/docs/localization/apple-ios-strings-format |
Localization format - Swift helpers | https://respresso.io/docs/localization/ios-swift-classes-format |
Localization format - Objective-C helpers | https://respresso.io/docs/localization/ios-objective-c-classes-format |
Localization variables in Respresso | https://respresso.io/docs/localization/variables |
Localization variable formatting | https://respresso.io/docs/localization/variable-formatting |
Localization variable placeholders | https://respresso.io/docs/localization/custom-variable-placeholders |
Respresso is a centralized resource manager for shared Android, iOS and Web frontend projects. It allows you to simply import the latest assets into your workspace. You may store several versions of the same resource in the cloud and pick the ones you need to import. Respresso currently supports six types of resources:
Using Respresso should be intuitive to anyone who has used Cocoapods before. Configurations are stored in the respressofile, while your current assets’ metadata are stored in respressofile.lock. Navigate to your project folder in Terminal, and type
$ respresso init
to initialize a new Respressofile.
host 'https://app.respresso.io'
project_token 'YOUR-PROJECT-TOKEN'
resource 'localization', '1.0+'
resource 'image', '1.0+'
resource 'font', '1.0+'
resource 'color', '1.0+'
resource 'appIcon', '1.0+'
resource 'raw', '1.0+'
Respressofile with custom host requesting four ot ouf five resource categories
⚠️ Before performing the next step, be sure to close your Xcode project.
Configure your Respressofile as explained by the next section, then type
$ respresso update
to import all requested resources into your project.
The currently accepted resource names are:
Accepted version formats are:
Specify the host of your assets in the first line by writing ‘host’ and your URL in single quotation marks separated by a space. By omitting this argument Respresso will use its default host URL for syncing.
Open terminal and navigate to your project folder. Use any of the commands below by typing
$ respresso [command]
Initializes a new Respressofile with an empty project token and a resource line commented out.
Executes a Clean and an Update command sequentially.
Downloads resources specified in your Respressofile from the server. Your current assets described in your Respressofile.lock are checked against the server’s state. If ran for the first time, a new project with your assets and a new workspace containing both projects are created.
Removes your lock file and all assets associated with Respresso.
strict-mode
Enabling strict mode will guarantee you get the same results each time you sync your assets. If set to true, you may only specify exact version numbers in your Respressofile. This option is set to false by default. Usage example:
$ respresso update -strict-mode
Real-time preview how the translations will look like in your mobile app or web. No need to wait for the next deployment.
import RespressoLive
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
RespressoLocalizationLiveEdit.shared.liveLocalizationEnabled = true
return true
}
}
import Respresso
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.updateTexts()
NotificationCenter.default.addObserver(forName: NSNotification.Name.RespressoDidUpdateLocalization, object: nil, queue: nil) { [weak self] (notification) in
self?.updateTexts()
}
}
func updateTexts() {
label.text = RespressoStrings.hello
}
}
Now your modifications are going to appearance when you click the 'Save' button on the web
Let see what happened after 7th option. You activated a visible items filter and your list have less elements than before and don't have to use Save button to get updated texts. Be careful, this modification stored just in your phone's memory and you can lose it. Use the Save button to store your modifications.
* Live Edit Module: shows real-time preview how the translations will look like in your mobile app. Check the translations’ accuracy, length and the UI experience in real-time.