v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8063

E8063 error

Locale string uses different placeholders than the base locale

area
stdlib (x8xxx)
fails the build
yes

A translation uses other placeholders than the base locale's string for the same key. A key with placeholders ({name}) becomes a function whose parameters are the base locale's placeholder names, so a translation must use exactly the same names. It may put them in any order and repeat them. {{ and }} are literal braces, not placeholders.

Example

× failslocales/enUS.jsonjson
{ "WELCOME": "Welcome back, {name}!" }
locales/deDE.jsonjson
{ "WELCOME": "Willkommen zurück, {spieler}!" }
src/main.wowluawowlua
import L from "wowlua:locale"print(L.WELCOME({ name = "Thrall" }))
✓ compileslocales/enUS.jsonjson
{ "WELCOME": "Welcome back, {name}!" }
locales/deDE.jsonjson
{ "WELCOME": "Willkommen zurück, {name}!" }
src/main.wowluawowlua
import L from "wowlua:locale"print(L.WELCOME({ name = "Thrall" }))

The compiler reports it like this:

error[E8063]: `WELCOME` in `locales/deDE.json` uses the placeholders [{spieler}], the base locale [{name}]
 = in locales/deDE.json
codemessage
E8061Locale file defines a key unknown to the base locale

Offline

terminal
$ wowlua explain E8063
E8063 (error): Locale string uses different placeholders than the base locale

source on GitHub ↗