Peptides can be cleaved to form a set of smaller peptides, or termination read-through can result in a different peptide. Membrane bound ribosomes synthesize proteins for the membrane, for the organelle inside the membrane, or for extracellular stuff. Basically messages are directed by use of a zip-code that tells them where to go. Ribosomes then in the appropriate place synthesize the peptide and assist in binding to the membrane or transporting through the membrane. So the protein folds up.
Some folding is assisted by molecular chaperones.
A triplet or codon then is made up of three bases. A known sequence was synthesized and the peptide formed observed.