Skip to main content

Documentation Index

Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt

Use this file to discover all available pages before exploring further.

Nayax Core serves your extension to users in multiple languages. To participate in this system, your app calls the Nayax translation API at startup, retrieves the translated strings for the current user’s language, and uses them throughout your UI. You do not manage language files: Nayax manages translations for all registered apps centrally.

Prerequisites

  • Your Core Extension is registered with Nayax and has a model name (for example, Apps/YourAppName)
  • Your app is served through the Nayax Core reverse proxy (required for the translation API to be reachable; see Reverse proxy requirement)
1

Call the translation API at startup

When your app loads, fetch translations from the Nayax Core translation endpoint:
GET /core/apps/translate?model=Apps/YourAppName
The endpoint returns a JSON object mapping original English strings to their translations in the user’s language:
{
  "Welcome": "ברוכים הבאים",
  "Save": "שמור",
  "Cancel": "ביטול",
  "No data available": "אין נתונים זמינים"
}
If no translation exists for a string, the key is omitted. Your app falls back to the original string in that case.Here is an example implementation that fetches and stores translations at startup:
async function loadTranslations(model: string): Promise<Record<string, string>> {
  const response = await fetch(`/core/apps/translate?model=${model}`);
  const data: Record<string, string> = await response.json();

  const normalized: Record<string, string> = {};
  for (const key of Object.keys(data)) {
    normalized[key.toLowerCase()] = data[key];
  }
  return normalized;
}
The Nayax backend stores translation keys in lowercase, even if your original strings are mixed case. Always normalize stored keys and lookups to lowercase, or translations will not match.
2

Implement a translation function

Create a function that looks up a string in the loaded translations and falls back to the original if no translation is found:
let translations: Record<string, string> = {};

function t(text: string): string {
  return translations[text.toLowerCase()] ?? text;
}
Call loadTranslations at app startup and store the result so t can use it:
translations = await loadTranslations("Apps/YourAppName");
3

Wrap your UI strings

Every user-visible string in your UI must go through t(). This includes labels, buttons, table headers, placeholders, empty states, and error messages.
t('Welcome')
t('No data available')
t('Save')
t('Cancel')
t('Search...')
Wrap:
  • Labels and headings: t('Welcome'), t('No data available')
  • Button text: t('Save'), t('Cancel')
  • Placeholders, empty states, and error messages: t('Search...')
Do not wrap:
  • Status values used in code comparisons: if (status === 'completed')
  • CSS class names: className="bg-green-500"
  • Console or debug messages: console.log('Debug info')
  • Template literals with variables: t(\Machine $`)` — dynamic keys cannot be matched reliably
4

Use your model name consistently

The model name in your API call must exactly match the model registered with Nayax. If it does not match, the API still returns HTTP 200 but with an empty object — no error, no translations, and no indication of what went wrong.
await loadTranslations("Apps/YourAppName");
Common mistakes:
WrongCorrect
App/MyAppApps/MyApp
apps/myappApps/MyApp
MyAppApps/MyApp
If your app loads but all text shows in English, verify that your model name matches the one Nayax registered exactly, including capitalization.
5

Provide your strings to Nayax

Nayax needs a list of all translatable strings from your app in order to add translations for each supported language. Provide this list to Nayax when you register your app or when you add new strings.

Reverse proxy requirement

The translation endpoint uses an absolute path that resolves against your app’s origin. Your app must be served through the Nayax Core reverse proxy for this to work.
How your app is accessedOriginTranslation API resolves toWorks
Through Nayax Core reverse proxydev.nayax.comdev.nayax.com/core/apps/translateYes
Directly via your own domainyour-app.example.comyour-app.example.com/core/apps/translateNo, 404
If the translation endpoint returns 404, the most likely cause is that your app is being accessed directly rather than through the Nayax Core reverse proxy. Contact Nayax to verify your reverse proxy configuration.

Troubleshooting

If translations are not working as expected, use the table below to identify the cause:
SymptomLikely causeFix
API returns 404App not served through reverse proxyAccess your app through Nayax Core, not directly
API returns empty object ({})Model name mismatchVerify model name matches Nayax registration exactly
Translations loaded but UI shows original languageKey case mismatchNormalize keys and lookups to lowercase
Some strings not translatingStrings not wrapped in t()Audit your UI for hardcoded text
Template literal strings not translatingDynamic keys cannot be statically matchedUse static string arguments in t()

What’s next

Role-Based Visibility

Declare which UI elements admins can show or hide by role.

Authentication

Understand how your app receives the JWT token from Nayax.