• Resolved pibyk

    (@pibyk)


    I tried to add translation to link descriptions but after adding one both seem to show at the same time. My site is more or less bi-lingual (Polish and English). I had link description in Polish, added English and both show up.

    Example:
    Indywidualny Serwis Motocyklowy – Solidna i godna zaufania firma. Potrafi? zrobi? wszystko przy Twoim motocyklu, a przy tym robi? to solidnie, terminowo, w rozs?dnych cenach i faktycznie podchodz? do klienta indywidualnie. Zdecydowanie polecam.XXXXXXXXXXX

    See here

    The XXXXXXXXXXX comes from English translation.

    I use Simple links

    Any idea what is wrong ? It might be as well the fault of Simple links.

    regards, Piotr

    https://www.ads-software.com/plugins/qtranslate-x/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author John Clause

    (@johnclause)

    Yes this is “unfinished” code in Simple Links. They need to pass the relevant strings through translation function __().

    I found a couple places, where the translation is missed, for example in file simple-links/includes/SimpleLinksTheLink.php, modify the piece

    //Main link output
    		$link_output = sprintf( '<a href="%s" target="%s" title="%s" %s>%s%s</a>',
    			esc_attr( $this->getData( 'web_address' ) ),
    			esc_attr( $this->getData( 'target' ) ),
    			esc_attr( strip_tags( $this->getData( 'description' ) ) ),
    			esc_attr( empty( $this->meta_data[ 'link_target_nofollow' ][ 0 ] ) ? '' : 'rel="nofollow"' ),
    			$image,
    			$this->link->post_title
    		);

    like this:

    //Main link output
    		$link_output = sprintf( '<a href="%s" target="%s" title="%s" %s>%s%s</a>',
    			esc_attr( $this->getData( 'web_address' )) ),
    			esc_attr( $this->getData( 'target' ) ),
    			esc_attr( strip_tags( __($this->getData( 'description' )) ) ),
    			esc_attr( empty( $this->meta_data[ 'link_target_nofollow' ][ 0 ] ) ? '' : 'rel="nofollow"' ),
    			$image,
    			__($this->link->post_title)
    		);

    which will get $this->link->post_title and $this->getData( 'description' ) translated. It maybe all you need to do, or maybe there is a couple more places – you can see what still needs to be translated on your output pages.

    After you found all those places, report it to Simple Links, and I believe they will happily make those modifications permanent, since it would not hurt anyone, but some people like you will benefit.

    Until they make it permanent, you would have to re-apply those changes after each update of Simple Links.

    I hope this helps. Please, let me know if you have further questions.

    Thread Starter pibyk

    (@pibyk)

    Thanks for the effort. I will report this issue to the Simple links guys.

    Tried your modification but got blank pages all over the site so I will work around this issue by creating parallel and separate link categories for same link types (one in English and one in Polish) and display them on respective language versions of the Links page. This is not the most elegant and efficient way but it would be immune to any future plugin modifications.

    regards, Piotr

    Plugin Author John Clause

    (@johnclause)

    Hi, @pibyk, sorry about your trouble. Most likely, you probably did a typo. Change like that cannot possibly make pages blank, but typo would. Since it is just a couple of places, you may eyeball the typos, or look in /wp-admin/error_log or /error_log for an error message, which may point you to the line with the typo.

    … and most likely you forgot or misplaced closing ) for __(.

    Plugin Author John Clause

    (@johnclause)

    Thread Starter pibyk

    (@pibyk)

    Well I just copy pasted the code in the right place – to be honest I have almost no clue about coding so I would not spot a typo even if it was the size of an elephant ??

    Plugin Author John Clause

    (@johnclause)

    Then you probably pasted it incorrectly or code got broken, when I pasted it into message. Would you be able to replace the file safely if I send the whole file to you via dropbox or so?

    Plugin Author John Clause

    (@johnclause)

    Here is the link to download file:
    https://www.dropbox.com/s/9dgblxqzo0moyzg/SimpleLinksTheLink.php
    Please, keep a copy of the original file to be able to restore.

    Plugin Author John Clause

    (@johnclause)

    When you contact Simple Links, just give a link to this thread, to simplify your explanations:
    https://www.ads-software.com/support/topic/simple-links-and-qtranslatex?replies=7#post-6368847
    Thanks a lot.

    Thread Starter pibyk

    (@pibyk)

    Thanks a lot ??

    I have posted this on Simple Links support forum:

    Simple links and qTranslate (language selection does not work properly)

    regards, Piotr

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Simple links and qTranslateX’ is closed to new replies.