This is about getting all output to stderr and stdout localized. Nothing to do with redirecting output to a file (there already are some interesting threads about that issue on this forum).
What I intend to do is capturing all lines of text sent to the screen, compare them with an array of stored lines and replace the matching ones in the screen for their translated equivalents.
I'm aware of TEXTDOMAIN and alike, but unfortunately many scripts are not prepared for localization, so I want to try a different approach, tryng to translate everything carelessly if the script uses $"" or not for calling gettext.
I have been trying 2 ways:
1: Getting many commands that generate writen output intercepted. After editing etc/profile, ~/bashrc, setting aliases, expand_aliases and lots of things, I can get them catched only in interactive mode, but when running a script, no alias at all is keept (nor other settings). F.i., if I type "enable" in the shell, I see that echo has dissapeared (I replace it for my own). But running a script that contents the same command, echo is enabled again!. Should not expand_aliases have avoided this?
2: Some kind of daemon that could replace the standard output and give back the translated messages (or the original ones if not matched). Even it could be enough to append the translated lines to the already shown in english. I guess that I would have to redirect /dev/fd/? , /dev/tty? or something like that but i lack the knowledge to do it, if it can be done. Some tries done with no succes.
Could anybody point a solution, advise, whatever could help?
Thank you in advance.
T. Ram�rez
Ferrol (Spain)