Closed seananderson closed 4 years ago
So to avoid having Biomass (kg) Biomass (t) etc. in the dictionary file, yes?
Maybe it could separately translate the main term and the units, where the units are in parentheses?
Some of the herring (and probably others) axes have complex units with math. It would be nice to accommodate these too:
y=expression(paste("Spawn index (t"%*%10^3, ")", sep=""))
for "Spawn index (t x 10^3)".
The simplest way would be to just use:
paste(en2fr("Spawn index") (t"%*%10^3, ")", sep="")
or something along those lines (that might need to be tweaked to work with expression) rather than complicating things on the backend. I.e., more generally, paste(en2fr("Label to translate"), "(my units)")
Also, in the original example, paste0()
would be a bit shorter.
Would be pasted after the main label and surrounded by parentheses if the argument was present. Could be taken from a separate dictionary file to keep things organized and the lookup tables smaller. Or could be part of the same lookup.