On Fri, Aug 07, 2026 at 10:42:34AM +0100, Gavin Smith wrote: > So maybe a better question than asking where translated manuals should > be installed is what an ideal user experience of accessing translated manuals > would be?
That is not the only question, here, the other question is about what would be the ideal user experience for the selection of dir(s) for the different languages. One dir with everything seems to me to not to be the best option, a selection of dir based on the same criteria as the selection of languages the user is interested in for the manuals seems to me to be better. > With the "man" command, "man -L de cups" works better than "LANG=de man cups" > to access the "cups(1)" page in German. This is with man-db. (A side > point, but Info can display man pages as well, but doesn't handle getting > translated man pages.) > > So one possibility is to have a command line option to Info that tries > to get a translated manual. We could also have a command inside Info > that looks for translated versions of the manual currently being displayed, > e.g. if the user is reading "help2man" then the command would display a menu > allowing the user to select among: > > help2man-de.info.gz > help2man-es.info.gz > help2man-fr.info.gz > help2man.info.gz > help2man-pl.info.gz > help2man-pt_BR.info.gz > help2man-ro.info.gz > help2man-sr.info.gz > help2man-sv.info.gz > help2man-uk.info.gz > help2man-zh_CN.info.gz > > (they are the translations of help2man that are installed on my system). Indeed, I think that this is a must, and something I already proposed (maybe not clearly), as the possibility to have a virtual menu with all the translations of a manual. > The rule would be something like, append a hyphen to the current base manual > name, so from "help2man.info.gz" the base name is "help2man", and then look > for Info files starting with that prefix. If the manual already has a hyphen > in the name, then we remove the part of the string after the last hyphen in > the name, check if the removed part up to the file extension is in a valid > format, and if so use the rest of the manual name as the prefix. Otherwise > the part after the hyphen is kept. If the language is available in the Info file with the Info-* variables, it is even possible to make it more robust, but then it requires two things * that the delimiter (an hyphen for example) is used for all the translated manuals * that the language tag suffixed is set according to the same rules that the Info readers use to determine a language tag based on the Info-* variables. We could have a warning by texi2any if it is not the case. > Then we could also support looking for translated manuals in other places, > such as under subdirectories of the infodir. However, one concern is > excessive disk access on slow file systems. There will never be lots of directories, as this is limited by the number of languages. Conversly theree can be a lot of files in the directory or directories, but this is the same independentely of the choice of one directory or one directory per language. > just have one directory, or a few directories, all that is required is > to load each directory listing from disk, and then scan each directory > listing for a file matching the pattern. If there are language directories > potentially many more directories need to be loaded: for example, if there > are three infodirs each of which has 15 subdirectories, the number of > directories to be loaded increases from 3 to 48 (3 * (15 + 1)) - that could > impact the user's experience negatively due to an increase in control latency. It is very unlikely to have 15 subdirectories in all the infodirs, in practice there would be one with many language directories (/usr/share/info typically), there would be little reason for other infodirs to have many languages subdirectories. -- Pat
