On Tue, 18 Aug 2020 at 18:33, andy pugh <[email protected]> wrote:

> I have been thinking about this, and have the beginnings of an idea:
> https://paste.ubuntu.com/p/622bPmPVBQ/

And I have now made some progress with the idea.
https://github.com/LinuxCNC/linuxcnc/tree/andypugh/multilingual_comp

It certainly isn't all there yet, and I suspect that the parsing of
the strings in to languages should be done in some cunning way in the
yapps parser.

But: halcompile --show-doc=es src/hal/components/abs.comp will display
a Spanish manpage, and --show-doc=fr will show a French one.

The current version tries to use a "languages" entry in the .comp, but
that doesn't look like it will work because of when that gets parsed.
A better plan is to see what other languages might exist in the file
when doing the default language. I know how to do that, but it's late
here.

It might be worth re-thinking the format too, possibly this would
parse more robustly.

pin out float out """Analog output value, always positive
              <_fr> Valeur de sortie analogique, toujours positive</_fr>
              <_es> Valor de salida analógica, siempre positivo</_es>""";

Or a more asciidoc-like

pin out float out """Analog output value, always positive"
              :lang: fr Valeur de sortie analogique, toujours positive
              :lang: es Valor de salida analógica, siempre positivo""";
-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to