• Hi,
    thanks for such a good plugin. Lightweight and functional. Everything I like about it.

    would it be possible to internationalize the template, so WPML-like plugins can detect the strings?
    I have to update manually the “notification-bar-template” every time to replace this portion:

    <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <div class="wpfront-message">
                            <?php echo $this->options->message(); ?>
                        </div>
                        <div>
                            <?php if ($this->options->display_button()) { ?>
                                <?php if ($this->options->button_action() == 1) { ?>
                                    <a class="wpfront-button" href="<?php echo $this->options->button_action_url(); ?>"  target="<?php echo $this->options->button_action_new_tab() ? '_blank' : '_self'; ?>"><?php echo $this->options->button_text(); ?></a>
                                <?php } ?>
                                <?php if ($this->options->button_action() == 2) { ?>
                                    <a class="wpfront-button" onclick="javascript:wpfront_notification_bar_button_action_script();"><?php echo $this->options->button_text(); ?></a>
                                <?php } ?>
                            <?php } ?>
                        </div>
                    </td>
                </tr>
            </table>

    with:

    <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <div class="wpfront-message">
                            <?php _e($this->options->message(), 'my-domain'); ?>
                        </div>
                        <div>
                            <?php if ($this->options->display_button()) { ?>
                                <?php if ($this->options->button_action() == 1) { ?>
                                    <a class="wpfront-button" href="<?php _e($this->options->button_action_url(), 'my-domain'); ?>"  target="<?php echo $this->options->button_action_new_tab() ? '_blank' : '_self'; ?>"><?php echo $this->options->button_text(); ?></a>
                                <?php } ?>
                                <?php if ($this->options->button_action() == 2) { ?>
                                    <a class="wpfront-button" onclick="javascript:wpfront_notification_bar_button_action_script();"><?php _e($this->options->button_text(), 'my-domain'); ?></a>
                                <?php } ?>
                            <?php } ?>
                        </div>
                    </td>
                </tr>
            </table>

    That would be really useful.
    Thanks ??

    https://www.ads-software.com/plugins/wpfront-notification-bar/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Syam Mohan

    (@syammohanm)

    Thanks, I’ll add it to my next version. Once you have this where will you store the text? Do you need a separate plugin for that?

    Syam

    Thread Starter Raz

    (@razique)

    Hi Syam,
    sorry, I didn’t see you reply.

    As I was doing some reading on ITL, once you “gettex” your strings,
    https://codex.www.ads-software.com/I18n_for_WordPress_Developers

    Any system that manage multilingual will be able to “extract” your strings for translation in any system that manage multilingual sites. The system will extract your “domain” and all strings that can be translated for it.

    Hope that makes sense! ??

    Here’s another workaround that doesn’t require hacking the code, but it requires a little bit of HTML tagging in the message. You basically add a separate class for each language in a span tag and then hide with CSS. This example is for US-English and German. I think it’s OK for limited number of languages until the plugin is updated to support multi-language setups.

    Enter your message like this:
    <span class="de-bar">German text</span><span class="en-bar">English text</span>

    In your CSS-file, add this:

    :lang(en-US) span.de-bar, :lang(de-DE) span.en-bar {
      display: none;
    }

    -mallard66

    Thread Starter Raz

    (@razique)

    Ha this is a smart one ??
    thanks for sharing.

    Thread Starter Raz

    (@razique)

    Hi Syam,
    did you have a chance to look at gettex?
    thanks ??

    Hi guys, I’m looking to get translations displayed on my site. I have 2 languages, and I need notification bar for each language with different text.

    Can somebody help me?

    Thread Starter Raz

    (@razique)

    Howdy Vadim, are you using a multilingual plugin to accomplish that? If now, how do you manage the two languages right now?

    Yes, I’m using WPML, but I could not find Notification Bar domain in WPML string translations

    Thread Starter Raz

    (@razique)

    Check my original post -the second snippet.

    Thread Starter Raz

    (@razique)

    Notice that every update of the plugin will remove the manual changes; until the plugin developper updates it ??

    I’ve tried it. There are 3 files with same name – .css, .js, .php and neither of them contains similar snippet.

    Also, I’ve tried to add this snippet to .php file, then scan plugin for strings, but it didn’t work either

    Thread Starter Raz

    (@razique)

    templates/notification-bar-template.php (Line 95 to 121)

    Thank you! I found it on ftp. And before I was looking in Plugins > Editor.

    But I still couldn’t find WP Notification Bar in domains in WPML string translations

    Thread Starter Raz

    (@razique)

    Okay
    This update will allow you to see the entries in your plugin ??
    BTW – not related to this issue, how many pages/ articles do you have on your website, and does WPML affect the performance? I’m curious because I’m using Polylang.
    Feel free to reach me via message
    Cheers

    Do you mean here – https://dl.dropboxusercontent.com/u/2547869/trans.JPG?

    I dont see any language fields. I feel we are somewhere very close, but I can’t figure this out ??

    WPML doesnt slow the site at all, at least I dont notice, when I’m using the site

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Internationalize the message URL’ is closed to new replies.