Magnetic field effects on the localization of electromagnetic waves in random 1D systems which are almost periodic