We investigate the localization of a Bose-Einstein condensate trapped in a two-leg ladder in the presence of an artificial magnetic field via Bose-Hubbard model and discuss its abundant localized phenomena using variational approximation and direct numerical simulation. A two-leg bosonic ladder provides an ideal platform to study the complex dynamics of Bose-Einstein condensates in an optical lattice subject to an artificial magnetic field. As a main result, the system displays rich interesting localized states including self-trapping, soliton and breather. The coupling of the repulsive atomic interaction, artificial magnetic field, the rung-to-leg coupling ratio of the ladder, and the initial population difference of atoms between the two legs of the ladder results in the transitions between the localized states. The critical conditions for the transitions between the localized states are given analytically and are intuitively demonstrated in the phase diagram. Particularly, when the rung-to-leg coupling radio of the ladder satisfies a critical condition, we have the localized states with no local atomic currents between the two legs, otherwise, we observe the localized states with local atomic currents between the two legs. Finally, the results obtained via variational method are confirmed by the numerical simulations of the full discrete nonlinear Schrödinger equation describing the system.