• Resolved Michael

    (@mitfi)


    Dear @timwhitlock,

    I am using your plugin since a while on a few domains and with my own plugins and I am really extremely happy with it!!

    So far, I always mentioned the text domain explicitly with all strings to be translated.

    Recently, I came up with the idea to define a text domain constant. However, Loco Translate will not recognize my strings anymore during .POT-sync as it obviously scans the very files and cannot identify the meaning of the constant.

    Is there a way to accomplish that approach?

    Thanks in advance for your support. And thanks again for this great and extremely helpful plugin!.

    Kind regards

    Michael

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Michael

    (@mitfi)

    … just re-read the WordPress plugin internationalization documentation with the hint “not to be too clever” :-).

    It will not work for reasons already laid out in my question.

    Nevertheless: thanks for your plugin!!

    Michael

    Plugin Author Tim W

    (@timwhitlock)

    That’s right, although there is a workaround if needed.

    As mentioned here, you can configure your bundle with the special * value for the text domain extraction. The caveat being that this will extract ALL localised strings from your source files into the same domain.

    I would still advise to follow WordPress convention and use string literals.

    Thread Starter Michael

    (@mitfi)

    Thanks a lot, Tim!

    Kind regards

    Michael

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Text Domain – defined as a constant?’ is closed to new replies.