<p>The closest thing I can think of is to pull the data from the 'territories' part of a <code>craft/app/framework/i18n/data</code> file.</p>

<p>For 'en_us', that would be something like this:</p>

<pre><code>{% set localeData = craft.i18n.getLocaleData('en_us') %}
{% set allTerritories = localeData.getAllTerritories() %}
</code></pre>

CC BY-SA 3.0
2014-10-16T14:08:46.133Z
How do I know which variable names to use for the "allTerritories" variable from localData.getAllTerritories? A twig {{ dump() }} didn't work. Thanks.
naboovalley
CC BY-SA 3.0
2014-10-16T16:18:13.747Z
Disrecard my last comment. Turning on devMode made the "dump" function available.
naboovalley
CC BY-SA 3.0
2014-10-15T23:03:40.043Z
2014-10-15T23:03:40.043Z
Brad Bell
<p>I'm wondering if there's a build in craft function for displaying countries (countryCode and/or name)?</p>

<p>Just like it is for displaying locales:</p>

<pre><code>craft.i18n.getAllLocales()
</code></pre>

<localization>
Does craft have any build in function for countries like locales?
# Does craft have any build in function for countries like locales?

(Asked by: username_0 on 2014-10-15)

I'm wondering if there's a build in craft function for displaying countries (countryCode and/or name)?
Just like it is for displaying locales:
craft.i18n.getAllLocales()

**Tags:** localization


---

## 1 answers

### Answer by username_1 on 2014-10-15. Score: 1

The closest thing I can think of is to pull the data from the 'territories' part of a craft/app/framework/i18n/data file.
For 'en_us', that would be something like this:
{% set localeData = craft.i18n.getLocaleData('en_us') %}
{% set allTerritories = localeData.getAllTerritories() %}

> **Comments:**
> **username_0**: How do I know which variable names to use for the "allTerritories" variable from localData.getAllTerritories? A twig {{ dump() }} didn't work. Thanks.  
> **username_0**: Disrecard my last comment. Turning on devMode made the "dump" function available.  

---

