Publisher is EE6 compatible, but it does not support the Fluid field. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Language features all effed up.

Status Resolved
Add-on / Version Publisher
Severity Critical
EE Version 24

Brett Wagner

Dec 29, 2012

Possibly a cascading issue.

Issue #1 (which may not be an issue):
I have two languages defined: English and French. English is the default.
I have defined a template in default/home which I would like to use as a homepage (I’m adding a login in front of it), however I can’t just browse to siteurl/home .. I have to go to /en/home to see a page.  My feeling is that if the language prefix is missing it should do a redirect.

This is a minor problem though.

Issue #2:
I added the following chunk of code to my header:
{exp:publisher:languages}
{long_name} 
{/exp:publisher:languages}

This should create two links, one for english and one for french.  Instead it only returns french and marks it as enabled EVEN IF im at /en/home

Issue #3:
I have the following links like the following in my main navigation:
{root_url}home

I would assue this would translate to site.com/en/home if I’m currently set to english and site.com/fr-ca/home if i’m currently set to french.  However it does not right now they are translating to site.com/home regardless of which language I’m set for which dumps me back into my default/index template

#1

Brett Wagner

Dec 29, 2012

Issue #2 Update:
For grins I went ahead and changed {exp:publisher:languages} to…
{exp:publisher:languages show=“1|2”}

No change, still only showing 1 language. I have confirmed that both languages are in the exp_publisher_languages table and that I have their IDs correct.

#2

Brett Wagner

Dec 29, 2012

update:
To continue working I’ve had to change all the {root_url} references to {site_url}en/

#3

Brett Wagner

Dec 29, 2012

It looks like I may have been confused about the relationship between {site_url} and {root_url}. I seem to be seeing that {site_url} gets the language segment appended correctly, while {root_url} is the bare server.

I can see both sides of the argument here.

#4

BoldMinded (Brian)

Dec 30, 2012

Hi Brett. For #1, wouldn’t it be more straight forward to not link to /home? Generally the home template is just accessible at site.com, not site.com/home.

#2 - Can you try the new 0.97.3 version I emailed you? I added an {is_active} variable that can be used to check if the language is active so you can highlight it. The code you mentioned will not automatically link those languages. That tag pair does not create any HTML for you… its meant so you can build your own language switcher or use it for some other purposes such as a form select field.

#3 - You are correct, site_url needs the prefix, it is used in all path, permalink, etc variables in EE. root_url is a reference to the url prior to the prefix that is best used for linking assets like css or js files.

#5

Brett Wagner

Dec 30, 2012

#2: Sorry the ticket i sent in ate the code, it’s standard make link stuff inside that tagpair. I’ll try this build shortly.

#6

Brett Wagner

Dec 30, 2012

I have installed this build, there is no change in issue 2.  Home is not / for a reason.

#7

BoldMinded (Brian)

Jan 01, 2013

Brett, it doesn’t look like the CP login you provided works.

#8

BoldMinded (Brian)

Jan 01, 2013

I also can’t edit the Publisher files to debug.

FWIW I can’t replicate the redirection you are seeing locally. If I go to /home it loads my template properly. It does not do a redirect to /en/home the first time when requesting a URL b/c search engines don’t like the 302 redirect… so /home and /en/home should both work.

#9

BoldMinded (Brian)

Jan 01, 2013

Can you tell me the name of the template that has the code you are talking about for issue #2?

#10

BoldMinded (Brian)

Jan 01, 2013

For issue #2 I think this is what you’re looking for:

{exp:publisher:languages}
    <a href="http://{switch_language_url}" class="{if is_active}active{/if}">{long_name}</a> 
{/exp:publisher:languages}
#11

Brett Wagner

Jan 02, 2013

email me for ee login.

the code is in parts/navigation:

{exp:publisher:languages show=“1|2”}
    <a href=”{switch_language_url}” class=”{if is_enabled==“y”}selected{/if}”>\>{long_name}</a> 
    {/exp:publisher:languages}

Issue 2 is really my main point of contention at this time.

#12

BoldMinded (Brian)

Jan 02, 2013

If you only have 2 languages you don’t need the show parameter.

#13

Brett Wagner

Jan 03, 2013

I added the show parameter to try to force it to show english… it didn’t work without it or with it.

#14

BoldMinded (Brian)

Jan 03, 2013

Brett, I can’t make modifications to the mod file to debug this. Can you fix the permissions so I can look into it?

#15

Brett Wagner

Jan 03, 2013

try now.

#16

Brett Wagner

Jan 04, 2013

Ok I resolved the ‘both languages’ not showing up thing by entering phrases for each. A global alert inside the publisher module might help other people alleviate this problem. That or you could just put in some default phrases. I don’t see this anywhere in the documentation for the tags.

#17

Brett Wagner

Jan 04, 2013

Another problem, now that the links are being rendered.

English creates the following link:
http://xxx.com/?ACT=40&site_id=1&lang_id=1

and French creates the following link:
http://xxx.com/?ACT=40&site_id=1&lang_id=2

Makes sense.

I click on the french link, it switches to /fr-ca (great)
I click on the english link and it does not switch back to /en (not awesome)

#18

BoldMinded (Brian)

Jan 10, 2013

Brett, I’ll give this another look tonight. I did fix the phrase issue on install though, so that won’t happen for anyone else.

#19

BoldMinded (Brian)

Jan 10, 2013

Brett, give it a shot now, I made a fix and it seems to be switching fine

#20

Brett Wagner

Jan 10, 2013

I concur, it seems to be working.

#21

Brian Litzinger

Jan 11, 2013

Cool. Going to close this then.

Login to reply