Community Translation / Text Quality Feedback
Overview
SDK 1.4.0+ introduces the Community Translation feature, allowing end-users (players) to submit translation suggestions for in-app text. Since 1.5.0 it has been extended into Text Quality Feedback: players can rate the current translation 1–5 stars and/or submit a suggested translation. Unlike AI Agent review (developer-side), this flow targets the end-user.
Two integration modes are available, both hitting the same backend pipeline (rating-only feedback is auto-approved into the per-string average; entries with a suggested translation go through AI scoring → human review):
- Built-in UI — call
suggestTranslation(stringIds[, imageBytes])and the SDK renders its own rating card. Lowest integration cost. - Headless (no SDK UI, 1.6.0+) — call
submitTranslationSuggestions(...)and submit ratings/suggestions you collected in your own UI. The SDK does not open any page.
The built-in UI flow is documented under Option 1/2; the headless flow is covered in Option 3.
Prerequisites
Before using the community translation feature, the following conditions must be met:
- SDK has been initialized
userIdhas been set viaupdateUserInfo()(to identify the player submitting suggestions)
UserConfig userConfig = new UserConfig.Builder()
.setUserId("player_001")
.setUserTags("beta,community")
.build();
LoxilyLocalize.updateUserInfo(userConfig);Option 1: Auto Screenshot
The SDK automatically captures the current screen and submits it with the suggestion:
String[] stringIds = {"dialog.npc_greeting", "dialog.player_choice_1"};
LoxilyLocalize.suggestTranslation(stringIds);Option 2: External Screenshot (recommended for game engines)
For Unity, Cocos2dx, and other game engines where the game captures its own screenshot:
byte[] screenshotBytes = ...; // From RenderTexture
String[] stringIds = {"dialog.npc_greeting", "dialog.player_choice_1"};
LoxilyLocalize.suggestTranslation(stringIds, screenshotBytes);Note: When
imageBytesisnull, the SDK will automatically capture the current screen.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| stringIds | String[] | Yes | Array of string_ids used on the current page, must not be empty |
| imageBytes | byte[] | No | PNG/JPEG screenshot data; pass null for auto-capture |
Option 3: Headless submit (no SDK UI, 1.6.0+)
If you want to keep your own UI style (e.g. an existing feedback dialog), use submitTranslationSuggestions(...) to submit ratings/suggestions you collected yourself. The SDK renders no page at all.
// 1) Build the items collected from your own UI
List<TranslationSuggestion> items = new ArrayList<>();
items.add(TranslationSuggestion.builder("HOME_TITLE")
.rating(4)
.build());
items.add(TranslationSuggestion.builder("BTN_OK")
.rating(2)
.suggestedTranslation("OK")
.build());
// 2) Optional screenshot; pass null and nothing is attached
// (unlike Option 1/2, the SDK does NOT auto-capture here)
byte[] screenshot = captureGameScreenBeforeOpeningDialog();
// 3) Submit; callback fires on the main thread
LoxilyLocalize.submitTranslationSuggestions(items, screenshot,
new SuggestSubmitCallback() {
@Override
public void onSuccess(int ratingCount, int suggestionCount) {
showToast("Thanks: " + (ratingCount + suggestionCount) + " entries submitted");
dismissDialog();
}
@Override
public void onFailure(String errorMsg) {
showToast("Submit failed: " + errorMsg);
}
});Single-entry overload:
LoxilyLocalize.submitTranslationSuggestions(
TranslationSuggestion.builder("BTN_OK").rating(5).build(),
/* imageBytes */ null,
callback);TranslationSuggestion
Built with a fluent builder:
| Field | Type | Required | Description |
|---|---|---|---|
stringId | String | Yes | The string id (typically obtained from your getPageString call site) |
rating | int | No | 1–5; 0 or unset means "no rating" |
suggestedTranslation | String | No | Player-written suggestion; empty/null means "no suggestion" |
currentTranslation | String | No | The translation currently displayed. If omitted, the SDK auto-fills it by stringId — usually you can skip this. |
Each item must satisfy either rating > 0 or a non-empty suggestedTranslation, otherwise it is silently filtered out.
SuggestSubmitCallback
public interface SuggestSubmitCallback {
void onSuccess(int ratingCount, int suggestionCount);
void onFailure(String errorMsg);
}ratingCount— number of rating-only entries accepted by the serversuggestionCount— number of suggestion entries accepted (including those that also carry a rating)onFailure— fires on SDK validation failure, network errors, or HTTP non-2xx
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| suggestions | List<TranslationSuggestion> / TranslationSuggestion | Yes | At least one item |
| imageBytes | byte[] | No | PNG/JPEG screenshot. Passing null attaches no image — the SDK does NOT auto-capture in this mode. |
| callback | SuggestSubmitCallback | No | Result callback, fires on the main thread |
Notes
submitTranslationSuggestionsdoes not auto-capture a screenshot. If you want one, capture it before opening your own dialog, otherwise you'd capture the dialog itself.- Wire format and server-side dedup/anti-abuse are identical to
suggestTranslation; only the entry point differs. - The same prerequisites apply (SDK initialized +
userIdset).
Migrating from the legacy API
| Legacy API | Replacement | Notes |
|---|---|---|
evaluateString(code, content) | suggestTranslation(new String[]{code}) or submitTranslationSuggestions(...) | Signature preserved but @Deprecated; internally forwards to suggestTranslation. The content argument is ignored (the new platform always looks up the live translation). |
evaluateAllStrings() | — | @Deprecated, no-op (the "rate the whole release" dimension is not in the new platform). |
enableEvaluateFunction(boolean) | — | @Deprecated, no-op. |
Existing integrations keep compiling, but please migrate to the APIs described on this page.
Built-in UI workflow
- Call method → Pass the string_id array for the current page
- Display cards → SDK opens the co-creation UI, showing the current translation, a 1–5 star rating and an optional suggestion input for each string_id
- Player feedback → Player gives a rating, a suggestion, or both (empty rows are skipped)
- Submit → Ratings are accepted immediately into the per-string average; suggestions enter the AI + human review queue; points are awarded per the project's configuration
- Close → On success the SDK toasts and dismisses itself
Comparison with reviewCurrentScreen
| Aspect | reviewCurrentScreen | suggestTranslation | submitTranslationSuggestions |
|---|---|---|---|
| Target users | Development/translation team | End-users (players) | End-users (players) |
| Interaction | AI Agent dialogue | SDK-rendered rating card | Your own UI (SDK is headless) |
| Features | AI analysis + one-click optimization + version publishing | Player rates / suggests translation | Same, but UI is owned by the integrator |
| userId | Not required | Required | Required |
| Screenshot | Always attached | Auto-captured if suggestion present (not attached for rating-only) | Never auto-captured; integrator decides |
| Available since | SDK 1.2.8+ | SDK 1.4.0+ | SDK 1.6.0+ |