<p>It looks like I can do:</p>

<pre><code>{% set myGlobalSet = craft.globals.getSetByHandle( 'setName', 'zh' ) %}
{{ myGlobalSet.myGlobalVar }}
</code></pre>

<p>If anyone has a better way to do it, please let me know... my plan is just to put this into a base template so that all of the pages can access the localization easily.</p>

CC BY-SA 3.0
2014-09-23T14:12:21.827Z
2014-09-23T14:12:21.827Z
andrew.welch
<p>I have a site that is mixed English and Chinese.  I've properly set up the locale to include Chinese as a locale, and have put Chinese translations for my fields in place.  That all works.</p>

<p>However, the site isn't one where you'll pick Chinese or English, it's going to display both in many cases.</p>

<p>So is there a way to explicitly set the English or Chinese translation of a global (or any field for that matter)?</p>

<p>I tried:</p>

<p>{{ myGlobalSet.myGlobal.en }}</p>

<p>As well as:</p>

<p>{{ myGlobalSet.en.myGlobal }}</p>

<p>...but it didn't like either one of them.  Is there a way to retrieve the localization of a field without having to switch the locale of the entire site?</p>

<localization>
Fetching localized globals?
# Fetching localized globals?

(Asked by: username_0 on 2014-09-23)

I have a site that is mixed English and Chinese. I've properly set up the locale to include Chinese as a locale, and have put Chinese translations for my fields in place. That all works.

However, the site isn't one where you'll pick Chinese or English, it's going to display both in many cases.

So is there a way to explicitly set the English or Chinese translation of a global (or any field for that matter)?

I tried:

{{ myGlobalSet.myGlobal.en }}

As well as:

{{ myGlobalSet.en.myGlobal }}

...but it didn't like either one of them. Is there a way to retrieve the localization of a field without having to switch the locale of the entire site?

**Tags:** localization

---

## 1 answers

### Answer by username_0 on 2014-09-23. Score: 2

It looks like I can do:
{% set myGlobalSet = craft.globals.getSetByHandle( 'setName', 'zh' ) %}
{{ myGlobalSet.myGlobalVar }}

If anyone has a better way to do it, please let me know... my plan is just to put this into a base template so that all of the pages can access the localization easily.


---

