NeoIQ Localize SDK Documentation
The NeoIQ Localize SDK provides a simple and powerful way to integrate NeoIQ Localize's translation capabilities into your applications.
Installation
Quick Start
Authentication
The SDK requires an API key to authenticate requests. Your API key should start with org_. You can obtain an API key from your NeoIQ Localize dashboard.
Parameters:
The translate method accepts an object with the following properties:
projectId(string, required): The ID of your NeoIQ Localize projectsourceLocale(string, required): The locale code of the source texttargetLocale(string, required): The locale code to translate intosourceText(string, required): The text to translateformat(string, optional): The format of the source text. Defaults to "string"cache(boolean, optional): Whether to use cached translations. Defaults to true
Supported Formats:
string: Plain textjson: JSON filesyaml: YAML filesproperties: Java properties filesandroid: Android resource filesxcode-strings: iOS Strings filesxcode-stringsdict: iOS Stringsdict filesxcode-xcstrings: iOS XCStrings filesmd: Markdown filesmdx: MDX fileshtml: HTML filesjs: JavaScript filests: TypeScript filespo: Gettext PO filesxliff: XLIFF filescsv: CSV filesxml: XML filesarb: ARB (Application Resource Bundle) filesftl: Fluent FTL filesphp: PHP files
Best Practices
-
Cache Management: By default, translations are cached. You can disable caching for specific requests by setting
cache: falsein the translate parameters. -
Error Handling: Always implement proper error handling in your application to gracefully handle API errors.
-
API Key Security: Never expose your API key in client-side code. Always keep it secure on your server.
-
Format Selection: Choose the appropriate format for your content type to ensure accurate translations.
Examples
Translating JSON Content
Translating Markdown Content
How is this guide?
Last updated on