It could work either based on some regex rules to guess word suffixes, but it wouldn’t be precise. Other way is to rely on the dictionary to provide meta information on word - and a specially crafted dictionary at that, a one that will have enough information. Anyway, the colouring was supposed to be a help in translating, not a 100% precise information.
Having even better Pali English dictionary will be great, but currently the one that is on SC + printed Cone’s dictionary do the job for me. What I will need eventually though, is a Pali - Polish dictionary. None exist as far as I know, which is why I need software that will help me easily build one, and that is the motivation behind my plans. I don’t want to invest >24 years as M. Cone did
As for the Pootle stuff, I would have to try it myself to see what it can do.