Support » Plugin: NextGEN Facebook » Feature request: pass output fields via WP translation function

  • mrboats

    (@wpseiskaadmin)


    I’m testing the plugin for a multilingual site with qtranslate-X as the translation plugin. The plugin works nicely with the exception of multilingual description strings. Would it be possible to pass the strings via the WP translation functions __() or _e()? This would automatically translate the strings when qtranslate is present but not cause issues in other cases?

    Here is an example of the All in 1 SEO handling of the description vs the your plugin:

    
    <!-- All in One SEO Pack Pro 2.4.12.1 by Michael Torbert of Semper Fi Web Design[1504,1546] -->
    <meta name="description"  content="Charter a sailboat in Finland and sail on the sheltered Finnish lakes, in the unique Finnish archipelago or venture beyond the home shores." /> 
    
    <!-- ngfb meta tags begin -->
    <meta name="ngfb:mark:begin" content="ngfb meta tags begin"/>
    <!-- generator:1 --><meta name="generator" content="NGFB 8.40.9-1/G"/>
    <meta property="og:description" content="[:fi]Vuokraa purjevene ja purjehdi Suomen suojaisilla j&auml;rvill&auml;, saaristossa tai uskaltaudu pidemm&auml;lle matkalle merten yli.[:en]Charter a sailboat in Finland and sail on the sheltered Finnish lakes, in the unique Finnish archipelago or venture beyond the home shores.[:]"/>
    
    
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author JS Morisset

    (@jsmoriss)

    Sure, no problem, although filtering at the output would not be optimal for performance. πŸ˜‰ I guess we’re talking about the title, content, and excerpt? Where is your example coming from – the excerpt?

    I’ll setup a test environment tomorrow morning, and should have a new version for you to try by tomorrow afternoon. πŸ˜‰

    js.

    Thread Starter mrboats

    (@wpseiskaadmin)

    Hi,

    On my testsetup I have an issue only with the description which in this case is picked up from the product category description. I would assume that excerpt would be the same. Here is an example, I’ve prefixed those that are OK with an OK, the example is from a Woocommerce Product category.

    `<!– ngfb meta tags begin –>
    <meta name=”ngfb:mark:begin” content=”ngfb meta tags begin”/>
    <!– generator:1 –><meta name=”generator” content=”NGFB 8.40.9-1/G”/>
    ok<link rel=”shortlink” href=”https://dokkcopy.demo.site/en/yacht-charter/sailboat/”/&gt;
    ok<meta property=”og:url” content=”https://dokkcopy.demo.site/en/yacht-charter/sailboat/”/&gt;
    ok<meta property=”og:type” content=”website”/>
    ok<meta property=”og:locale” content=”en_GB”/>
    ok<meta property=”og:site_name” content=”Dokk”/>
    ok<meta property=”og:title” content=”Sailboat”/>
    not OK<meta property=”og:description” content=”[:fi]Vuokraa purjevene ja purjehdi Suomen suojaisilla järvillä, saaristossa tai uskaltaudu pidemmälle matkalle merten yli.[:en]Charter a sailboat in Finland and sail on the sheltered Finnish lakes, in the unique Finnish archipelago or venture beyond the home shores.[:]”/>
    OK <meta name=”twitter:domain” content=”dokkcopy.demo.site”/>
    where is the picked up from?<meta name=”twitter:title” content=”Sailboat”/>
    not OK<meta name=”twitter:description” content=”[:fi]Vuokraa purjevene ja purjehdi Suomen suojaisilla järvillä, saaristossa tai uskaltaudu pidemmälle matkalle merten yli.[:en]Charter a sailboat in Finland and sail on the sheltered Finnish…”/>
    OK<meta name=”twitter:card” content=”summary”/>
    OK<meta itemprop=”url” content=”https://dokkcopy.demo.site/en/yacht-charter/sailboat/”/&gt;
    OK but again wondering where it comes from?<meta itemprop=”name” content=”Sailboat”/>
    Not OK<meta itemprop=”description” content=”[:fi]Vuokraa purjevene ja purjehdi Suomen suojaisilla järvillä, saaristossa tai uskaltaudu pidemmälle matkalle merten yli.[:en]Charter a sailboat in Finland and sail on the sheltered Finnish lakes, in the unique Finnish archipelago or venture…”/>
    Not OK<meta name=”description” content=”[:fi]Vuokraa purjevene ja purjehdi Suomen suojaisilla järvillä, saaristossa tai uskaltaudu pidemmälle matkalle merten yli.[:en]Charter a sailboat in…”/>
    <meta name=”ngfb:mark:end” content=”ngfb meta tags end”/>
    <!– added on 2017-04-02T15:05:51+00:00 in 0.022316 secs –>
    <!– ngfb meta tags end –>

    Thread Starter mrboats

    (@wpseiskaadmin)

    Actually I have to correct myself on this one, for some reason the title shows OK on the english version but not on the default (Finnish) version. So yes, please add title also.

    <meta property="og:url" content="https://dokkcopy.demo.site/vuokraa-vene/purjevene/"/>
    <meta property="og:type" content="website"/>
    <meta property="og:locale" content="fi_FI"/>
    <meta property="og:site_name" content="Dokk"/>
    <meta property="og:title" content="[:fi]Purjevene[:en]Sailboat[:]"/>
    Plugin Author JS Morisset

    (@jsmoriss)

    qTranslate-X is an odd one – it doesn’t use custom post types, doesn’t set the locale in the back-end, and doesn’t reload the page when switching languages – it makes it all very difficult to do anything with it. πŸ™‚ I ran some tests using __(), but that doesn’t work. What *does* work is applying the WP text filters (title, excerpt, and content), but the Free version of NGFB does *not* apply these filters because they can be problematic (and thus create a need for support). The problem with applying them is that some developers don’t know that filters must return their data, not echo it (filters return, actions echo). If it wasn’t for all the badly coded themes and plugins out there, these filters could be enabled by default, but as it is, they must be disabled to avoid support issues. The solution would be to get the Pro version and enable all three filters in the Advanced settings page.

    js.

    Thread Starter mrboats

    (@wpseiskaadmin)

    Fair enough, thanks for the update. The only problem is that qtranslate is so very convenient for editors when it actually works ;-).

    So for the pro version, if I would run into some issues with specifically qtranslate, I might expect some support?

    Plugin Author JS Morisset

    (@jsmoriss)

    Of course. I provide support for both the Free and Pro versions – the difference being that Pro support is usually same-day, where-as Free version support can take a few days between replies (depends how much free time I have). πŸ˜‰

    Had I found a solution I could include in the Free version, I would have done so, but the solution turned out to be a feature of the Pro version. It’s not that applying the filters is complicated (although there’s some code wrapping them to manage errors, etc.), but that applying filters can require some support – mostly it’s a matter of identifying the badly coded plugin. πŸ˜‰

    js.

    Plugin Author JS Morisset

    (@jsmoriss)

    BTW, you might want to look at using WPSSO instead of NGFB – it’s a newer fork and there are several extension plugins available for it. πŸ˜‰

    js.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Feature request: pass output fields via WP translation function’ is closed to new replies.