We study the nonlinearity for the zigzag graphene nanoribbons (ZGNRs) with zigzag triangular holes (ZTHs). We show that in the presence of an external uniform magnetic field, a two-dimensional f-deformed Dirac oscillator can be used to describe the dynamics of the electrons in the ZGNRs with ZTHs. It is shown for the first time that the magnetic field direction has effect on the chirality of charge carriers in the ZGNRs punched with triangular holes. We also obtain the Landau-level spectrum in the weak and strong magnetic field regimes. Additionally, we compare Landau-level spectrum of this graphene-based device in the f-deformed scenario and original one. Our results provide a general viewpoint for the development of the zigzag graphene nanoribbons.