# Custom language variables

**URL:** <https://forum.getkirby.com/t/custom-language-variables/7509>\
**Category:** Questions\
**Tags:** v2\
**Created:** [May 17, 2017, 9:43am UTC](https://forum.getkirby.com/t/custom-language-variables/7509 "2017-05-17T09:43:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![11bits](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/11bits/32/860_2.png) [@11bits](https://forum.getkirby.com/u/11bits)\
**Post date:** [May 17, 2017, 9:43am UTC](https://forum.getkirby.com/t/custom-language-variables/7509/1 "2017-05-17T09:43:41Z")

</div>

Hi,

I’m using languages support for the first time.

I need to use language variables to make some strings translatable in the templates (ex: ‘Skip to content’).

I noticed that it only works if multi-language support is activated. And then the new text files include the language code.

But I don’t need multi-language content just translatable strings in case somebody use the theme in other language.

It this possible to do?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [May 17, 2017, 9:51am UTC](https://forum.getkirby.com/t/custom-language-variables/7509/2 "2017-05-17T09:51:23Z")

</div>

You can only use the language variables, if you have set at least one language in the config.php file.

If you don’t want to enable multi-language support, you can define strings in your config file, using `c::set()` and `c::get()` instead of `l::set()` and `l::get()`.

---

<div class="post-metadata">

**Author:** ![11bits](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/11bits/32/860_2.png) [@11bits](https://forum.getkirby.com/u/11bits)\
**Post date:** [May 17, 2017, 10:09am UTC](https://forum.getkirby.com/t/custom-language-variables/7509/3 "2017-05-17T10:09:12Z")

</div>

I see, but in that way I can’t specify different strings for different languages.

I mean something similar to .pot file in WordPres, where you can add a translation for every language.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [May 17, 2017, 10:18am UTC](https://forum.getkirby.com/t/custom-language-variables/7509/4 "2017-05-17T10:18:24Z")

</div>

As an alternative, you could write a plugin with a [translation function](https://github.com/texnixe/kirby-logger/blob/master/lib/helpers.php) or class…

---

<div class="post-metadata">

**Author:** ![11bits](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/11bits/32/860_2.png) [@11bits](https://forum.getkirby.com/u/11bits)\
**Post date:** [May 17, 2017, 10:30am UTC](https://forum.getkirby.com/t/custom-language-variables/7509/5 "2017-05-17T10:30:09Z")

</div>

Ok, I just wanted confirm if Kirby core supports theme translation without multi-language content.

Thanks

---

<div class="post-metadata">

**Author:** ![anon77445132](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@anon77445132](https://forum.getkirby.com/u/anon77445132)\
**Post date:** [May 17, 2017, 5:10pm UTC](https://forum.getkirby.com/t/custom-language-variables/7509/6 "2017-05-17T17:10:00Z")

</div>

@11bits:

> [@11bits](#):
>
> I see, but in that way I can’t specify different strings for different languages.

I would add the needed strings as a field (`type: text`) for every string in the corresponding blueprint, may be of the parent page to avoid the same field on many pages.  
Or add these fields on `/site/blueprints/site.yml` or a hidden admin-page.

Good luck!

---

<div class="post-metadata">

**Author:** ![11bits](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/11bits/32/860_2.png) [@11bits](https://forum.getkirby.com/u/11bits)\
**Post date:** [May 17, 2017, 5:59pm UTC](https://forum.getkirby.com/t/custom-language-variables/7509/7 "2017-05-17T17:59:02Z")

</div>

That could be the simplest solution.

I like it, but the theme would not be ready for multi-language in case you want to add more languages in the future.

Thank you

---

<div class="post-metadata">

**Author:** ![anon77445132](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@anon77445132](https://forum.getkirby.com/u/anon77445132)\
**Post date:** [May 17, 2017, 7:59pm UTC](https://forum.getkirby.com/t/custom-language-variables/7509/8 "2017-05-17T19:59:25Z")

</div>

If you want that, you can offer two versions of your theme: a one language and a multi language theme.

---

<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, 4:49pm UTC](https://forum.getkirby.com/t/custom-language-variables/7509/9 "2025-02-06T16:49:58Z")

</div>

Archived on February 6, 2025, 4:49pm UTC


