iOS OTA Localization
Update .strings without App Store review.
Traditional iOS localization bakes .strings files into your binary. Any translation change — even a typo fix — requires a new build, a new App Store submission, and up to 3 days of review. TranslationsHub delivers string updates Over-The-Air so users see corrections the next time they open the app.
Start for free.package(
url: "https://github.com/translate-hub/ios_sdk",
from: "1.0.0"
)
TranslateHub.shared.initialize(
config: TranslateHubConfig(apiKey: "YOUR_KEY")
) {
// ready — refresh your UI here
}
// In any View:
Text("greeting".translate ?? "Hello!")
How it works
Add via Swift Package Manager
Paste the repo URL in Xcode → File › Add Package Dependencies. No CocoaPods or Carthage needed.
Manage keys in the dashboard
Add languages and strings at translate-io.com. No .strings files to commit or merge.
Strings update automatically
The SDK refreshes once every 24 hours in the background. No App Store submission needed.
Complete integration example
Drop-in replacement for NSLocalizedString.
// MyApp.swift
import SwiftUI
import TranslateHubSDK
@main
struct MyApp: App {
init() {
TranslateHub.shared.initialize(
config: TranslateHubConfig(
apiKey: "YOUR_API_KEY", // from translate-io.com
fallbackFile: "translations" // bundled JSON asset
)
) { /* called on main thread when ready */ }
}
var body: some Scene {
WindowGroup { ContentView() }
}
}
// ContentView.swift
struct ContentView: View {
@State private var refreshID = UUID()
var body: some View {
VStack {
Text("welcome".translate ?? "Welcome back")
Text("continue".translate ?? "Continue")
}
.id(refreshID)
}
}
// Switch language:
TranslateHub.shared.pickLanguage(code: "he")
// RTL: use THLanguageItem.direction == "rtl"
Frequently asked questions
What replaces NSLocalizedString?
The .translate extension on String. It looks up the key in the current language's dictionary from the cached JSON. Returns nil when the key is missing so you can supply a Swift fallback: "key".translate ?? "Default text".
Does it work with SwiftUI and UIKit?
Yes — the SDK is pure Swift with no UI dependencies. In SwiftUI use @State + UUID to trigger a view refresh after pickLanguage. In UIKit call setNeedsDisplay or reload your data source.
What if the user is offline on first launch?
The SDK falls back to the bundled translations.json in your app bundle. Once the user goes online the cache refreshes automatically within 24 hours.
Does it support RTL languages?
Yes. Each language in the JSON includes a direction field. Check THLanguageItem.direction == "rtl" and set your view's semanticContentAttribute or environment layoutDirection accordingly.
Is the API key safe to include in the binary?
The key identifies your project but cannot access your translations bucket directly. A Cloud Function validates it and issues a short-lived signed URL for each sync. The bucket itself is private.
Fix translation bugs without waiting for App Review.
Start with a free account — no credit card required.
Create free account