• Resolved clickharder

    (@clickharder)


    We are using different phone numbers with different languages. We have found that if we add text like “Call 123-555-4567” it shows up as a translatable string. However, if we just have the phone number “123-555-4567” it isn’t a translatable string. Is there a way to format phone numbers so that they appear as text? We don’t want to add a keyword if at all possible.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Dragos

    (@dragosvrejiu)

    Hello,

    You could display content based on the chosen language using our Conditional Shortcode:https://translatepress.com/docs/translation-shortcode/

    Let me know if this approach suits your needs.

    With the best regards,

    Thread Starter clickharder

    (@clickharder)

    It is true, we could make that work using a conditional shortcode but it isn’t an ideal solution for a couple of reasons.
    1) We are using a wysiwyg editor (Elementor) and we would have to hide the entire element using a roundabout process.
    2) Related to #1, it makes is harder for our client to manage the content when it isn’t straightforward. It just isn’t a clean solution.

    Is there a reason why the plugin doesn’t pickup phone numbers as strings? Is it designed to only look for alpha characters? Is there a way around that? Maybe a action or filter that would allow us to tell it to look for strings starting with numbers or “(” symbols?

    Thanks!

    Dragos

    (@dragosvrejiu)

    Hello,

    This is due to the way our plugin works,it is not designed to pick up numbers.

    Another work around would be adding a white space character to the numerical string.

    Please let me know if this works for you.

    With the best regards,

    Thread Starter clickharder

    (@clickharder)

    I tried spacebar and I tried adding a non-breaking space and neither worked. Is there a specific whitespace character I should be using?

    Dragos

    (@dragosvrejiu)

    Hi,

    Copy a white space character from the list that I’ve sent you in my previous message and add it to the string.

    With the best regards,

    Thread Starter clickharder

    (@clickharder)

    Which would you suggest? I tried adding a non-breaking space and that didn’t work. This is also going into an editor field so certain characters may be escaped.

    Dragos

    (@dragosvrejiu)

    Hello,

    On my instance, any whitespace character from the list did the trick.

    Try different characters until you find one that works for you.

    In the eventuality that none will work, the Conditional Shortcode is the only option left.

    Let me know how this goes!

    With the best regards,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Translating Phone Numbers’ is closed to new replies.