• Resolved Junaid Raza

    (@junaidraza)


    Hi,

    i am experiencing the following error during the check

    Found a translation function that is missing a text-domain. Function _n, with the arguments ‘themename’

    i am unable to locate the error please wondering if you could help locate the error will be very grateful thanks!

    https://wordpress.org/plugins/theme-check/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    You probably used variables instead of plain strings in an _n call.

    Thread Starter Junaid Raza

    (@junaidraza)

    Hi,

    i can send you the source file so that you could look into that what’s going on ? and what i need to change ?

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Just look at the various calls you make to _n(). It should be rather obvious.

    Thread Starter Junaid Raza

    (@junaidraza)

    Thanks for your fast response please let me send you the source file and i humbly request you to look into it and help me fix the problem will be very thankful!

    Thread Starter Junaid Raza

    (@junaidraza)

    <span class="widget-detail__info"><?php echo _n( 'Purchase', 'Purchases', edd_get_download_sales_stats( get_the_ID() ), 'mythemename' ); ?></span>

    <span class="widget-detail__info"><?php echo _n( 'Comment', 'Comments', get_comments_number(), 'mythemename' ); ?></a></span>

    <span class="widget-detail__info"><?php echo _n( edd_get_label_singular(), edd_get_label_plural(), $vendor->downloads_count(), 'mythemename' ); ?></span>

    <span class="widget-detail__info"><?php echo _n( 'Love', 'Loves', count( $loves ), 'mythemename' ); ?></span>

    i used _n in those above lines please let me know about the required changes thanks

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    This line is your problem:

    _n( edd_get_label_singular(), edd_get_label_plural(), $vendor->downloads_count(), 'mythemename' );

    That is invalid. The first and second parameters that you pass to _n must be plain strings. You cannot pass it the results of function calls, because those can not be translated.

    Thread Starter Junaid Raza

    (@junaidraza)

    Thank You sir issue has been resolved!!! Stay Blessed!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘text-domain error with arguments 'theme'’ is closed to new replies.