# Multi language Error

**URL:** <https://forum.getkirby.com/t/multi-language-error/727>\
**Category:** Questions\
**Tags:** v2\
**Created:** [April 7, 2015, 3:56pm UTC](https://forum.getkirby.com/t/multi-language-error/727 "2015-04-07T15:56:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fenixkim](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/fenixkim/32/163_2.png) [@fenixkim](https://forum.getkirby.com/u/fenixkim)\
**Post date:** [April 7, 2015, 3:56pm UTC](https://forum.getkirby.com/t/multi-language-error/727/1 "2015-04-07T15:56:54Z")

</div>

Hello, I just added the setup for multi language support which is described on this page ([http://getkirby.com/docs/languages/setup](http://getkirby.com/docs/languages/setup)) and immediately I’m got the following error:

```
Fatal error: Cannot redeclare class Pages in /Developer/Project/kirby/branches/multilang.php on line 6

```

How can I fix it?

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [April 7, 2015, 4:15pm UTC](https://forum.getkirby.com/t/multi-language-error/727/2 "2015-04-07T16:15:50Z")

</div>

Could you share your language setup from `/site/config/config.php`?

---

<div class="post-metadata">

**Author:** ![fenixkim](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/fenixkim/32/163_2.png) [@fenixkim](https://forum.getkirby.com/u/fenixkim)\
**Post date:** [April 7, 2015, 4:19pm UTC](https://forum.getkirby.com/t/multi-language-error/727/3 "2015-04-07T16:19:43Z")

</div>

This is my language setup:

```
c::set('language.detect', true);

c::set('languages', array(
  array(
    'code' => 'en',
    'name' => 'English',
    'default' => true,
    'locale' => 'en_US',
    'url' => '/',
  ),
  array(
    'code' => 'es',
    'name' => 'Spanish',
    'locale' => 'es_ES',
    'url' => '/es',
  ),
));
```

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [April 7, 2015, 4:25pm UTC](https://forum.getkirby.com/t/multi-language-error/727/4 "2015-04-07T16:25:26Z")

</div>

That looks alright. What PHP version are you on and what version of Kirby are you using?  
And are you using any additional plugins, fields, field methods?

---

<div class="post-metadata">

**Author:** ![fenixkim](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/fenixkim/32/163_2.png) [@fenixkim](https://forum.getkirby.com/u/fenixkim)\
**Post date:** [April 7, 2015, 5:04pm UTC](https://forum.getkirby.com/t/multi-language-error/727/5 "2015-04-07T17:04:20Z")

</div>

Thanks for your time, I’ve fixed the problem.

In my `config.php` file, before the language setup. I did a custom configuration

```
c::set('site.api.url', site()->url() . "/api");

```

So I put the language code before this line and it works perfectly.

I think that the function `site()` declares automatically the `Page` and `Pages` clases causing the issue.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:04pm UTC](https://forum.getkirby.com/t/multi-language-error/727/6 "2025-02-06T17:04:32Z")

</div>


