[SOLVED] NEWS - Translation not showing in Detail Template

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Locked
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

[SOLVED] NEWS - Translation not showing in Detail Template

Post by georgechr »

Hey everyone,

I am facing a strange problem.

I have set up a new "summary template" and a new "detail template" for my news list and currently i am using the default ones.

I have created my code like below:

Code: Select all

{news category="Greek*" number="5" sortby="news_date" summarytemplate="news" detailtemplate="news" lang="el_GR"}
The above code is displayed fine with its Greek translation in the summary template. Now though when i click on the title to view an article, the detail template ignores my language settings and show me items in Englishh (return link, category label etc).

I checked the lang file of el_GR and its fine. The translations are there, i compared with the en_US one. I tried making changes to it, and saw that the changes are applied when in summary template whereas ignored in detail template.

How can i fix this?

Thanks in advance
Last edited by georgechr on Mon May 21, 2012 11:42 am, edited 1 time in total.
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

Re: NEWS - Translation not showing in Detail Template

Post by georgechr »

can someone share any insight on this?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: NEWS - Translation not showing in Detail Template

Post by Dr.CSS »

Do you have front end language set to greek?...
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

Re: NEWS - Translation not showing in Detail Template

Post by georgechr »

no, but i don't want to set it, because if i do, my English news manager shows in Greek. I have a site with two languages.

In my understanding when entering the "lang" parameter in the tags its enough.
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

Re: NEWS - Translation not showing in Detail Template

Post by georgechr »

Anyone guys?
vilkis

Re: NEWS - Translation not showing in Detail Template

Post by vilkis »

Do you use pretty url?
vilkis
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

Re: NEWS - Translation not showing in Detail Template

Post by georgechr »

yes i do, does this play any role?
vilkis

Re: NEWS - Translation not showing in Detail Template

Post by vilkis »

Yes, because lang parameter is not passed to detail template in pretty url mode. You can use smarty replace. For return link:

Code: Select all

{$return_url|replace:'return':'RETURN_IN_GREEK'}
vilkis
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

Re: NEWS - Translation not showing in Detail Template

Post by georgechr »

Thanks for the help.

btw i tried to change

Code: Select all

{if $return_url != ""}
<div id="NewsPostDetailReturnLink">{$return_url}{if $category_name != ''} - {$category_link}{/if}</div>
{/if}
to

Code: Select all

{if $return_url != ""}
<div id="NewsPostDetailReturnLink">{$return_url|replace:'return':'Επιστροφή'}{if $category_name != ''} - {$category_link}{/if}</div>
{/if}
but it doenst work, still english.

I have the same problem with other fields. For example when showing category name in summary view is displayed fine, but when going to detail template it changes to English.

I am guessing the solution would be to change:

Code: Select all

{$category_label} {$entry->category}
to

Code: Select all

{$category_label|category:'category':'GREEK NAME'} {$entry->category}
?
Last edited by georgechr on Mon May 21, 2012 9:25 am, edited 2 times in total.
vilkis

Re: NEWS - Translation not showing in Detail Template

Post by vilkis »

georgechr wrote:Thanks for the help.

Code: Select all

{if $return_url != ""}
<div id="NewsPostDetailReturnLink">{$return_url|replace:'return':'Επιστροφή'}{if $category_name != ''} - {$category_link}{/if}</div>
{/if}
What is text in your return link?
Probably your return link is "Return" (first capital letter).

vilkis
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

Re: NEWS - Translation not showing in Detail Template

Post by georgechr »

Yes its "Return"
vilkis

Re: NEWS - Translation not showing in Detail Template

Post by vilkis »

So

Code: Select all

{$return_url|replace:'Return':'Επιστροφή'}
should work.
vilkis
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

Re: NEWS - Translation not showing in Detail Template

Post by georgechr »

sorry! did not see the capital letter remark. Thanks it works.

Can i do it for others as well like i mentioned above?
vilkis

Re: NEWS - Translation not showing in Detail Template

Post by vilkis »

Try and you'll see. :)
vilkis
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

[SOLVED] Re: NEWS - Translation not showing in Detail Templa

Post by georgechr »

Ok thanks, i am just unsure for the label part.

Anyhow, thanks for your great and prompt help. Cheers
Locked

Return to “The Lounge”