Age | Commit message (Collapse) | Author | Lines | |
---|---|---|---|---|
2025-02-21 | bind_textdomain_codeset: fix return value | Rich Felker | -2/+4 | |
this function is documented as returning a null pointer on failure and the current textdomain encoding, which is always UTF-8 in our implementation, on success. there was some confusion over whether it's expected to also return a null pointer in the case where it's using the locale's encoding by default, rather than an explicitly bound one, but it does not seem like that behavior would match applications' expectations, and it would require gratuitously storing a meaningless 1-bit state for the textdomain. | ||||
2014-07-27 | implement gettext message translation functions | Rich Felker | -0/+11 | |
this commit replaces the stub implementations with working message translation functions. translation units are factored so as to prevent pulling in the legacy, non-library-safe functions which use a global textdomain in modern code which is using the versions with an explicit domain argument. bind_textdomain_codeset is also placed in its own file since it should not be needed by most programs. this implementation is still missing some features: the LANGUAGE environment variable (for multiple fallback languages) is not honored, and non-default plural-form rules are not supported. these issues will be addressed in a later commit. one notable difference from the GNU implementation is that there is no default path for loading translation files. in principle one could be added, but since the documented correct usage is to call the bindtextdomain function, a default path is probably unnecessary. |