<p>Well... the answer was quite simple.</p>

<pre><code>'siteUrl' =&gt; array(
    'en_ca' =&gt; 'http://localhost/mysite',
    'fr_ca' =&gt; 'http://localhost/mysite/fr',
),
</code></pre>

<p>The _ca part was what was missing.  Now my site works amazingly.</p>

<p>Sorry for the run around and I hope this can help someone.</p>

CC BY-SA 3.0
2016-02-04T16:39:51.473Z
2016-02-04T16:39:51.473Z
Eric Chantigny
<p>I'm trying to setup a bilingual site and I'm having some issues with setting up the URI.  </p>

<pre><code>'siteUrl' =&gt; array(
    'en' =&gt; 'http://localhost/mysite',
    'fr' =&gt; 'http://localhost/mysite/fr',
),
'environmentVariables' =&gt; array(
    'baseUrl'  =&gt; 'http://localhost/mysite/',
)
</code></pre>

<p>In my single settings:
URI for french: {baseUrl}fr/nouvelles
URI for english: {baseUrl}news</p>

<p>Not sure how to set this up to have it setup the way I want it.  Removing the baseURL part just doesn't print the mysite subfolder.</p>

<p>Thanks!</p>

<p>EDIT:  Here's the real problematic after investigation.</p>

<p>The URI should not include anything more than the name so:
In my single settings:
URI for french: nouvelles (<a href="http://localhost/mysite/fr/nouvelles" rel="nofollow">http://localhost/mysite/fr/nouvelles</a>)
URI for english: news (<a href="http://localhost/mysite/news" rel="nofollow">http://localhost/mysite/news</a>)</p>

<p>Now, those 2 pages work like expected.</p>

<p>But, if I assign those pages to a Entries field, to create my menu, when I pull the url, it never inclues the /fr portion.  Even the default template doesn't render the correct link, dropping the /fr part in the url too:</p>

<pre><code>{% for entry in craft.entries.section('news').limit(5).find() %}
    &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-02-04T15:51:44.413Z
Have you added the physical subfolder (with index.php in it etc.) to your wwwroot for the secondary language? You do not need {baseUrl} in your Section slug settings.
naboovalley
CC BY-SA 3.0
2016-02-04T16:16:00.623Z
Yes! I should specify that everything works like it should when I visit the pages.  But, not when I try to access the page's url, or the other locale page's url.
http://localhost/cartovista/ is in english 
http://localhost/cartovista/fr is in french

I think I'm getting things confused in the URI part.  I don't think it requires the fr part.  I will dig a bit more but if someone understands my issue and has already setup a bilingual site, with language switch, I would appreciate some pointers.
Eric Chantigny
CC BY-SA 3.0
2016-02-04T16:28:27.493Z
Ok, I have now pinpointed my issue to url in the twig template.  Anytime a page url is called, the fr portion is never included, which renders the link useless.

link.page[0].url
link page, being a Entries field type.
Eric Chantigny
<localization><url><settings>
Bilingual site page URL issues
# Bilingual site page URL issues

(Asked by: username_0 on 2016-02-04)

I'm trying to setup a bilingual site and I'm having some issues with setting up the URI.  
'siteUrl' => array(
    'en' => 'http://localhost/mysite',
    'fr' => 'http://localhost/mysite/fr',
),
'environmentVariables' => array(
    'baseUrl'  => 'http://localhost/mysite/',
)

In my single settings:
URI for french: {baseUrl}fr/nouvelles
URI for english: {baseUrl}news
Not sure how to set this up to have it setup the way I want it.  Removing the baseURL part just doesn't print the mysite subfolder.
Thanks!
EDIT:  Here's the real problematic after investigation.
The URI should not include anything more than the name so:
In my single settings:
URI for french: nouvelles (http://localhost/mysite/fr/nouvelles)
URI for english: news (http://localhost/mysite/news)
Now, those 2 pages work like expected.
But, if I assign those pages to a Entries field, to create my menu, when I pull the url, it never inclues the /fr portion.  Even the default template doesn't render the correct link, dropping the /fr part in the url too:
{% for entry in craft.entries.section('news').limit(5).find() %}
    {{ entry.title }}
{% endfor %}

**Tags:** localization, url, settings

> **Comments:**
> **username_1**: Have you added the physical subfolder (with index.php in it etc.) to your wwwroot for the secondary language? You do not need {baseUrl} in your Section slug settings.  
> **username_0**: Yes! I should specify that everything works like it should when I visit the pages.  But, not when I try to access the page's url, or the other locale page's url. http://localhost/cartovista/ is in english  http://localhost/cartovista/fr is in french  I think I'm getting things confused in the URI part.  I don't think it requires the fr part.  I will dig a bit more but if someone understands my issue and has already setup a bilingual site, with language switch, I would appreciate some pointers.  
> **username_0**: Ok, I have now pinpointed my issue to url in the twig template.  Anytime a page url is called, the fr portion is never included, which renders the link useless.  link.page[0].url link page, being a Entries field type.  

---

## 1 answers

### Answer by username_0 on 2016-02-04. Score: 3 | Accepted answer

Well... the answer was quite simple.
'siteUrl' => array(
    'en_ca' => 'http://localhost/mysite',
    'fr_ca' => 'http://localhost/mysite/fr',
),

The _ca part was what was missing.  Now my site works amazingly.
Sorry for the run around and I hope this can help someone.


---

