Shorten an exact lookup
04Lookup returns one result. It tries an exact requested label, then shorter ranges from the right. Unlike filtering, it does not return a label that is more specific than the current request.
Try zh-Hant. That item exists, so return it and stop before zh or the default. No content is translated.
Key idea: Lookup tries exact labels and shorter fallbacks; filtering keeps matching extensions.
Terms
- Lookup
- Select one exact label, trying less-specific requested ranges before a defined default.
- Fallback
- Try a less-specific request when the current attempt has no match.
Rules & examples
Lookup tries exact labels and shorter fallbacks; filtering keeps matching extensions.
- RFC4647§3.4 says a request de-CH can return de-CH or de, but never de-CH-1996. Do not reuse the basic-filter prefix test as the lookup equality test.
- The RFC example tries zh-Hant-CN-x-private1-private2, then zh-Hant-CN-x-private1, zh-Hant-CN, zh-Hant, zh, then default.
- A single-letter or digit subtag is removed together with its closest trailing subtag during truncation. Removing private1 also removes the now-trailing x.
- Available content here is zh-Hant and en. The search stops at the exact zh-Hant label; returned content keeps its label. The private-use sequence illustrates truncation, not standardized meaning.
- This bounded helper accepts basic ranges only. Applications accepting extended ranges MUST define which item to return when multiple items match; §3.4 permits such application policies.
The long truncation pattern is from §3.4. Redundant or private-use subtags can interfere with selection; users SHOULD avoid unnecessary distinctions (§4.1). No extension stripping or full language-tag validation is implemented.
Sources
New to this? Start hereA quick picture + helpful background
Requested languages and available labels
Imagine a catalog of labeled documents. A filter keeps all labels that fit a pattern; a lookup tries preferences and returns one exact label or a defined default. Neither operation translates the document or guarantees understanding.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.