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 |
Seriously, 🛑 stop 🛑 here and go to the new docs!
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:
- Images
- App icons
- Localization
- Fonts
- Colors
- Raw
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
Configure your Respressofile as explained by the next section, then type
$ respresso update
to import all requested resources into your project.
- Include the project token received during initialization of your project in the Respresso web interface. This is done in the same manner as the host with the keyword ‘project_token’ and your token inside single quotation marks
- Specify the required resources in the next line using the following format: resource ‘[resource_name]’, ‘[version_number]’
The currently accepted resource names are:
- image
- appIcon
- color
- localization
- font
- raw
Accepted version formats are:
- [major].[minor].[patch] eg. 1.2.0
- [major].[minor].[patch]+ eg. 1.2.0+ (not available in strict mode)
- [major].[minor]+ eg. 1.2+ (not available in strict mode)
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' framework. It's automatically added to your project.
- Enable the live mode.
import RespressoLive
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
RespressoLocalizationLiveEdit.shared.liveLocalizationEnabled = true
return true
}
}
- Use 'RespressoStrings' for localization
- Observe for 'RespressoDidUpdateLocalization' notification.
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
}
}
- Check above instructions
- Go to respresso(https://app.respresso.io) sign in and choose a project
- Select localization in the left panel and click the same version that you synced into your project
- Get your phone and shake it
- Switch on 'Localization / Connection' in the popup window
Now your modifications are going to appearance when you click the 'Save' button on the web
- For using Live Edit Module* shake your phone again and switch on 'Localization / Live Editor' in the popup window
- On web click on the 'Live Editor' button on the top right area
- Scan the QR Code with your phone which visible in your web browser's top right section
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.