From ccb1bff65429b34a92b5701e80b60857e3bf0480 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Sun, 27 Sep 2026 23:29:06 -0700 Subject: [PATCH] docs: correct header casing claim in README The "all keys are lowercase" line has been inaccurate since #52's fix (Feb 2020): only the ~10 standard gettext headers are normalized, to their canonical Title-Case form via a case-insensitive lookup (lib/shared.js's HEADERS map), specifically so a translation tool's own custom headers (e.g. Poedit's X-Poedit-*) are preserved verbatim rather than mangled by a blanket case transform. The docs were never updated to match. Found while consuming this library directly in apache/superset -- a naive reading of the README led to looking up a parsed header with a lowercased key, silently returning undefined for every standard header. Co-Authored-By: Evan Rusackas Co-Authored-By: Claude Sonnet 5 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f27f91..907028a 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,9 @@ to a *mo* or *po* file. ### Headers -Headers can be found from the `headers` object, all keys are lowercase and the value for a key is a string. This value will also be used when compiling. +Headers can be found from the `headers` object and the value for a key is a string. This value will also be used when compiling. + +Key casing isn't lowercased: the ~10 standard gettext headers (`Language`, `Plural-Forms`, `Content-Type`, ...) are recognized case-insensitively and normalized to their canonical name, while any other header (e.g. a tool-specific `X-Poedit-*` header) keeps whatever casing the source file used, unchanged (see #52). ### Translations