v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8060

E8060 error

Invalid locale key

area
stdlib (x8xxx)
fails the build
yes

A key in a locale file is not a valid locale key. Keys are made of upper-case letters, digits and _ only ([A-Z0-9_]+), so that each one is a field of L. Rename the key in every locale file and in the code that reads it.

The locale files are read only when the package imports wowlua:locale. A key that starts with a digit is allowed, but it is reachable only as L["1ST"].

Example

× failslocales/enUS.jsonjson
{ "welcome-text": "Welcome back!" }
src/main.wowluawowlua
import L from "wowlua:locale"print(L)
✓ compileslocales/enUS.jsonjson
{ "WELCOME_TEXT": "Welcome back!" }
src/main.wowluawowlua
import L from "wowlua:locale"print(L.WELCOME_TEXT)

The compiler reports it like this:

error[E8060]: `welcome-text` in `locales/enUS.json` is no locale key (`[A-Z0-9_]+`)
 = in locales/enUS.json
codemessage
E8061Locale file defines a key unknown to the base locale
E8115Locale file is not a JSON object of strings

Offline

terminal
$ wowlua explain E8060
E8060 (error): Invalid locale key

source on GitHub ↗