Changed TranslateFlags to actually translate flags instead of using switch