• I had problems with href’s defined within my theme’s special items (cyberchims iFeature). I could resolve this via jQuery – perhaps it’s of any use for future releases:

    jQuery(document).ready(function ($) {
      $('a[href^="/"]').each(
        function() {
          $(this).attr('href',
            function(index, value) {
              if (value.substr(0,1) == "/") {
                var a = value.split("/");
                if (a.length > 1 && a[1].length != 2)
                {
                  var b = location.pathname.split("/");
                  if (b.length > 1 && b[1].length == 2)
                  {
                    value = '/' + b[1] + value;
                  }
                }
              }
              return value;
            }
          )
        })
    });

    I searches for relative links and checks whether they are already prefixed with a language code like ‘/de/’ – if the current page has one (e.g. ‘/en/’) it adds the missing one…
    http://wordpress.org/extend/plugins/transposh-translation-filter-for-wordpress/

Viewing 1 replies (of 1 total)
  • Small correction – as the translation of images and so on should NOT be performed:

    function(index, value) {
              if (value.toUpperCase().match (".JPG$") || value.toUpperCase().match (".PNG$")) {
                 return value;
              }
              if (value.substr(0,1) == "/") {
Viewing 1 replies (of 1 total)
  • The topic ‘Traslation of URLs’ is closed to new replies.