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
{ "welcome-text": "Welcome back!" }import L from "wowlua:locale"print(L){ "WELCOME_TEXT": "Welcome back!" }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
Related codes
| code | message |
|---|---|
| E8061 | Locale file defines a key unknown to the base locale |
| E8115 | Locale file is not a JSON object of strings |
Offline
$ wowlua explain E8060 E8060 (error): Invalid locale key