You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`init(...)` returns `false` for null tables, zero table count, missing default language, missing explicit fallback language, invalid table storage, duplicate language tables, duplicate keys within the same language, or null text pointers.
118
+
-`makeSortedLangTable(...)` requires entries to already be sorted by ascending key; `init(...)` rejects unsorted or duplicate keys in sorted tables.
116
119
-`translate(key)` checks the selected language first, then the fallback language if it differs, then returns the configured missing text.
117
120
-`translateFrom(language, key)` only searches the requested language.
118
121
-`missingText` defaults to `"?"` when omitted or reset with `setMissingText(nullptr)`.
122
+
- Language-table resolution remains linear even when individual tables use sorted-key lookup.
119
123
120
124
## Gotchas
121
125
-`translateFrom(...)` does not use fallback lookup.
126
+
-`format(...)` treats the resolved translation text as a `vsnprintf` format string. Placeholder mistakes in translation data, or mismatched argument types at the call site, become runtime formatting bugs.
122
127
-`format(...)` returns `false` when the formatted output does not fully fit, even though the buffer may still contain truncated output.
123
128
-`useDefaultFallback = true` resolves the effective fallback language to `defaultLanguage`.
124
129
- Duplicate keys are only invalid within the same language table; reusing the same key across different languages is expected.
130
+
- Sorted-key lookup is opt-in per table. The library never sorts caller data for you.
125
131
126
132
## Restrictions
127
133
- Packaged as an ESP32 / Arduino-targeted library for ESPToolKit.
128
134
- C++17 is required.
129
135
- Translation tables and strings are caller-owned and must remain valid for the lifetime of the `ESPLang` instance.
0 commit comments