• Hi,
    there is a problem with the plugins.
    I’ve installed qTranslate, which makes my site bilingual — everything is OK.
    Then I’ve installed sIFR plugin — as a result sIFR doesn’t show text for secondary language.

    In short about what is happening inside:
    It is possible to choose a primary language (en) and a secondary (ru) for a blog. When user enters site the address bar looks like this “http://blog.com”. And when user switches language address bar changes look and now it is “http://blog.com/ru”. In this case sIFR doesn’t show swf-files.
    The problem is here, because when i change primary language in the qTranslate Configuration, for examle, making Russian (ru) as primary language, then sIFR shows Russian text, but fails to show English titles.

    In short, i know where the problem is, but i dont’t know what to do to get rid of it, ’cause I never worked with WordPress before and doesn’t know PHP or Javascript.

    Please help. Where should I go to and what file should I edit to correct the problem?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Just check this out, this might give you an idea of what to do. Haven’t encountered this.
    1) edit qtranslate_hooks.php and add this

    Code: Select all
    add_filter(‘get_bookmarks’, ‘qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage’,0);

    2) Use [:de] etc. quicktags to build your link name.

    Liza

    Thread Starter punk-t-34

    (@punk-t-34)

    That didn’t help.

    But!
    There is a little bit clarity in the problem.
    I’ve found that when the language switched on to the secondary, sIFR tries to search SWF-files with fonts in the folder “http://blog.com/en/wp-content/themes/template_name/fonts/”. Obviously, there is no such folder ob the server, ’cause qTranslate generates string en/ dynamically.

    In general, everything that i need is only to define the absolute path to the folder with my SWF-files somewhere in the sIFR source files. But, I don’t know which file and in which line should I edit.

    P.S. In the file “fonts.php” i’ve found these strings:

    $plugin_dir = ABSPATH.'wp-content'.'/plugins'.'/wp-sifr/fonts/';
    $template_dir = ABSPATH.'wp-content'. str_replace(get_bloginfo('wpurl').'/wp-content', '', get_bloginfo('template_directory').'/fonts/');

    I think that this is what I need. Evidently, here ABSPATH — this is a string that contains everything that goes before “wp-content” in address bar. So this colud be for example “http://blog.com/” or “http://blog.com/en”, depending on situation. But when I tried to replace ABSPATH with constant string (http://blog.com/) I failed.
    As a result, both languages stopped displaying and link to the SWF-file transformed to “http://blog.com/en/wp-contentwp-content/themes/template_name/fonts/”, — where as you can see the string “wp-content” duplicates.

    Thread Starter punk-t-34

    (@punk-t-34)

    Really, does anybody know the solution?

    Hi there,

    I would suggest using bloginfo to link to your files. You can reach various parts of the folder structure, such as root, template directory and so on. Using something like this in your header.php should work:

    <script src="<?php echo bloginfo('template_url'); ?>/js/your-sifr-file.js" type="text/javascript"></script>

    Give that a go and see how you get on.

    The above would give you:

    <script src="http://www.your-site.com/wp-content/themes/your-theme/js/your-sifr-file.js" type="text/javascript"></script>

    Hey thanks for the help karl! it worked perfectly
    cheers

    not so perfectly, it only worked in the index page of every language but not in my other pages 🙁

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problems using sIFR with qTranslate.’ is closed to new replies.