• Resolved PaulC53

    (@paulc53)


    I spent a great deal of time trying to debug an issue where a number of strings that I had registered were not appearing on the “Strings translation” page.

    I was retrieving a number of strings using get_option() to pass to pll_register_string(). Some of these did not yet have values, so, when get_option() returned FALSE, I passed an empty string (i.e. ”) to pll_register_string(). Since I had given the required parameters and no error was thrown, I assumed that the issue laid outside of the plugin.

    However, that was not the case. The strings would not appear on the “Strings translation” page until they had a non-empty value, despite having been registered with a name.

    This was a very frustrating bug to identify. May I recommend either allowing an empty string or updating the documentation to state that a non-empty string is required?

    Otherwise, I’m really liking this plugin. Keep up the great work!

    -Paul

    https://ww.wp.xz.cn/plugins/polylang/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    You can register empty strings. But Polylang does not display them in the list table because in my opinion, it does not make sense to translate them.

    Thread Starter PaulC53

    (@paulc53)

    Hi Chouby,

    The functionality makes sense, but if I register a string and then the name doesn’t appear on the registered strings table and there’s no reason given for it, there’s a gap.

    The registered strings in question are user-set strings, so not all them had string values to translate when I registered them, as filling in those strings was the next step. However, when they didn’t appear on the table at all, it appeared that they were not registered at all, when, in fact, they were.

    It would make sense to either provide the names of the registered, empty strings on the string translation page so that the user knows that the names were indeed registered, or make it clear in the documentation that they won’t appear if the string value is empty.

    Plugin Author Chouby

    (@chouby)

    It would make sense to either provide the names of the registered, empty strings on the string translation page so that the user knows that the names were indeed registered

    I prefer not to pollute the list table with empty strings.

    or make it clear in the documentation that they won’t appear if the string value is empty

    I will

    Thread Starter PaulC53

    (@paulc53)

    Thanks again for the awesome plugin!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Bug: Registering Empty Strings’ is closed to new replies.