Skip to main content
Glama
country.md3.13 kB
# Country A country supported by the store's localization options. To learn how to use the `country` object for localization in your theme, refer to [Support multiple currencies and languages](https://shopify.dev/themes/internationalization/multiple-currencies-languages). ## Properties ### available_languages - **Type:** array of [shop_locale](https://shopify.dev/docs/api/liquid/objects/shop_locale) - **Description:** "The languages that have been added to the market that this country belongs to." ### continent - **Type:** [string](https://shopify.dev/docs/api/liquid/basics#string) - **Description:** "The continent that the country is in." - **Possible values:** Africa, Asia, Central America, Europe, North America, Oceania, South America ### currency - **Type:** [currency](https://shopify.dev/docs/api/liquid/objects/currency) - **Description:** "The currency used in the country." ### iso_code - **Type:** [string](https://shopify.dev/docs/api/liquid/basics#string) - **Description:** "The ISO code of the country in [ISO 3166-1 (alpha 2) format](https://www.iso.org/glossary-for-iso-3166.html)." ### market - **Type:** [market](https://shopify.dev/docs/api/liquid/objects/market) - **Description:** "The market that includes this country." ### name - **Type:** [string](https://shopify.dev/docs/api/liquid/basics#string) - **Description:** "The name of the country." ### popular? - **Type:** [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) - **Description:** "Returns `true` if the country is popular for this shop. Otherwise, returns `false`. This can be useful for sorting countries in a country selector." ### unit_system - **Type:** [string](https://shopify.dev/docs/api/liquid/basics#string) - **Description:** "The unit system of the country." - **Possible values:** imperial, metric ## Example ```json { "available_languages": [], "continent": "North America", "currency": {}, "iso_code": "CA", "market": {}, "name": "Canada", "popular?": false, "unit_system": "metric" } ``` ## Referencing the country object directly When referenced directly, the `country` object returns `country.name`. **Code:** ```liquid {% for country in localization.available_countries -%} {{ country }} {%- endfor %} ``` **Output:** ``` Afghanistan, Australia, Austria, Belgium, Canada, Czechia, Denmark, Finland, France, Germany, Hong Kong SAR, Ireland, Israel, Italy, Japan, Malaysia, Netherlands, New Zealand, Norway, Poland, Portugal, Singapore, South Korea, Spain, Sweden, Switzerland, United Arab Emirates, United Kingdom, United States ``` ## Rendering a flag image When passed to the [`image_url`](https://shopify.dev/docs/api/liquid/filters#image_url) filter, the country object returns a CDN URL for that country's flag. "All country's flags are SVGs, normalized to an aspect ratio of 4:3." **Code:** ```liquid {{ localization.country | image_url: width: 32 | image_tag }} ``` **Output:** ```html <img src="//cdn.shopify.com/static/images/flags/ca.svg?width=32" alt="Canada" srcset="//cdn.shopify.com/static/images/flags/ca.svg?width=32 32w" width="32" height="24"> ```

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/florinel-chis/shopify-liquid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server