Complex sentence: The Spanish "alférez" and Portuguese "alferes" is a junior officer rank below lieutenant associated with carrying the flag, and so is often translated as "ensign", although unlike the rank in other languages, its etymology has nothing to do with flags.
Split into simpler sentences: The Spanish "alférez" and Portuguese "alferes" is a junior officer rank below lieutenant associated with carrying the flag, and so is often translated as "ensign". Unlike the rank in other languages, its etymology has nothing to do with flags.