• Resolved VERYA Inc.

    (@veryaca)


    Hi!

    Would anyone know why this line of code (from WPForms) is not being picked up properly?

    _n( 'Click or drag a file to this area to upload.', 'Click or drag files to this area to upload.', (int) $max_file_number, 'wpforms' );

    When I have 1 file, I see the translation but when I have 2 or more, I see the original text (not translated).

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tim W

    (@timwhitlock)

    Post the PO file containing the singular translation which you say is working.

    Thread Starter VERYA Inc.

    (@veryaca)

    Plugin Author Tim W

    (@timwhitlock)

    The file shows that the strings were originally extracted from two separate strings, and not from the pluralized _n function that your code shows.

    Loco Translate would have synced strings from the plugin’s POT file, or from the code if such a file is missing. As this is a “pro” version of the plugin, I can’t verify its POT file or its PHP code.

    Thread Starter VERYA Inc.

    (@veryaca)

    Here is the .pot file and the 2 PHP files where the string can be found: https://file.io/KPspn4uo6Ohk.

    From what I understand in your reply, the same string can’t be use in different contexts?

    Plugin Author Tim W

    (@timwhitlock)

    That’s right. The code author is trying to use the same unique key for the standalone singular form, and also the combined plural form.

    This cannot work unless the author adds msgctxt to disambiguate one of the instances.

    I’m marking this as resolved as really this is not an issue relating to my plugin.

    Thread Starter VERYA Inc.

    (@veryaca)

    Awesome. Thanks for your time.

    I will raise the issue with WPForms.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘_n() not being picked up properly?!’ is closed to new replies.