Integrating LocaleHub
Real-time Localization-as-a-Service for Unity. Pushing translation updates without resubmitting to the App Store.
Installation
1. Dependencies
LocaleHub requires Newtonsoft.Json. Install via Unity Package Manager (UPM):
com.unity.nuget.newtonsoft-json
2. Get the SDK Package
Download the latest .unitypackage and import it into your project.
SDK Architecture
LocaleHub/ ├── Runtime/ │ ├── cache/ // Local persistent JSON fallbacks │ │ ├── en.json, es.json... │ │ └── LocaleHubCache.cs │ ├── Components/ // UI drop-ins │ │ ├── LocaleHubLanguageSwitcher.cs │ │ └── LocaleHubTextUniversal.cs │ ├── Core/ // Engine Logic │ │ ├── LocaleHubAPI.cs │ │ └── LocaleHubManager.cs │ └── Utils/ // Debugging & Serializers └── Editor/ // Inspector extensions
Video Walkthrough
Integration Code
using LocaleHub; using UnityEngine; public class LocaleHubController : MonoBehaviour { void Start() { // Sync language with Britoken dashboard LocaleHubManager.Instance.SetLanguage("en"); // Access translations string welcome = LocaleHubManager.Instance.GetText("welcome_text"); } }
UI Components
LocaleHubTextUniversal
Support for both Legacy UI Text and TextMeshPro in a single component.
Auto-Refresh enabledLocaleHubLanguageSwitcher
Instantly build language menus that trigger the SDK's internal language swap.
Dropdown & Button supportOTA & Caching
Automatic OTA
The SDK stays synchronized with the Britoken Dashboard. Updates reflect instantly without restarts.
Offline Persistence
Managed via LocaleHubCache.cs. Translations are cached locally. If internet is lost, the SDK falls back to the last update.
API Reference
| Member | Summary |
|---|---|
| SetLanguage(string) | Updates active locale and triggers a background sync. |
| GetText(string) | Returns the translated string for a specific key. |
| IsUsingCache | Boolean indicating if the SDK is currently in offline fallback mode. |
REST API (Standalone)
Fetch your translations directly via standard HTTPS POST requests. Use this for web integrations, custom backends, or any non-Unity environment.