On Tue, Jan 07, 2025 at 09:17:10PM +0000, Gavin Smith wrote: > On Tue, Jan 07, 2025 at 09:30:16PM +0100, Patrice Dumas wrote: > > As far as I can say, it is never possible to distinguish a lack of > > translation and some kind of error in the gettext framework. > > > > In that precise case, if "locales -a" did not output a message, I also > > think that we should not output a message either, as what could be seen > > from texi2any is that the locale is still C/POSIX and could not be > > switched, but we cannot know if it is an error, or if the user do not > > want to have locales installed and has wiped out all the > > texinfo_document translations files anyway. > > It could be that they don't have locales installed but haven't wiped > the texinfo_document directory. They are not making a choice to disable > Texinfo document translations.
Indeed, it could also be that situation, and it is actually probably more probable. But the situation where the users do not want locales nor translations is possible, for instance on minimal systems that still need texi2any. > If we can detect that the locale is stuck at C/POSIX and that therefore > translations are disabled, we could output a warning message. This could be done at the end of _switch_messages_locale. But do we want to do that unconditionally? > The fact that texi2any translations don't work if there are no locales > is an implementation detail of texi2any. In theory we could load .mo > files manually, or provide translations some other way that doesn't use > gettext at all. The fact that a user doesn't have locales installed has > nothing to do with the question of whether they want texi2any output > to contain translated strings or not. I agree, but it does not necessarily mean that the user want a message if the user doesn't have locales installed either. -- Pat