Advanced Views Docs
Live PlaygroundDownload PluginGet PRO
  • 💡Help Centre
  • ⚡Getting Started
    • Introduction
      • Key Aspects
      • Creating Your First View
      • Creating Your First Card
      • Plugin Terms
      • Plugin Interface
        • Field Options
    • Installation
      • Advanced Views Lite
      • Advanced Views Pro
      • Comparison Table
      • Upgrading from Lite to Pro
    • Supported data vendors
    • Starter theme
  • 🌟Display Content
    • WordPress
      • Post
      • Taxonomy terms
      • User
      • Comments
      • Menus
    • WooCommerce Product
    • Meta fields
      • Basic fields
        • Number
      • Content fields
        • Image
        • File
        • WYSIWYG
        • oEmbed
        • Gallery
      • Choice fields
        • Select/checkbox/radio
        • True / False
      • Relationship fields
        • Link
        • Post_object
        • Page Link
        • Relationship
        • Taxonomy
        • User
      • Advanced fields
        • Google Map
        • Google Map Multiple Markers
        • ACF OpenStreetMap Field
        • Date/time picker
      • Layout fields
        • Group (Pro)
        • Repeater (Pro)
        • Flexible (Pro)
    • Object fields
    • Custom Data (Pro)
    • Custom Gutenberg Blocks (Pro)
    • Mount Points (Pro)
    • Front-end assets management (Pro)
  • 🦸‍♂️Query Content
    • Basic Filters
    • Meta Filters (Pro)
      • Current Post
      • Comparison
      • Dynamic Injection
    • Taxonomy Filters (Pro)
    • Pagination (Pro)
    • Custom Data (Pro)
  • 🏆Shortcode Attributes
    • Common Arguments
    • View Shortcode
    • Card Shortcode
  • 🧙‍♂️Templates
    • Customizing the Template
    • Template engines
      • Twig
      • Blade
    • CSS & JS
      • BEM Methodology
      • WordPress Interactivity API
    • File system storage
    • Pre-built components
    • Reusable components library (Pro)
    • Live reload
    • Multilingual
    • Custom Ajax & Rest API (Pro)
  • ☕Guides
    • Display Custom Post Type (CPT) on another post
    • Display Employees (CPT) of a Company (CPT)
    • Display Nested Repeater Fields
    • Map Marker from ACF Image
    • Display all CPT items on a single map
  • 🛠️Tools
    • Export/Import
    • Demo Import
    • Settings
    • Preview
  • 🏹Troubleshooting
    • Compatibility
    • Report a bug
    • Payment Issues
    • Lite Support (Forum)
    • Pro Support
  • ⚙️Customization
    • Filters and Hooks
      • View
      • Card
    • Suggest a feature
    • Performance
Powered by GitBook
On this page
  • 1. Theme "Text Domain" requirement
  • 2. Single View and Card for different languages
  • 3. Automatic strings detection (in your translation tool)
  • 4. Translate labels within templates
  • 4.1) Blade
  • 4.2) Twig (Pro)

Was this helpful?

  1. Templates

Multilingual

PreviousLive reloadNextCustom Ajax & Rest API (Pro)

Last updated 1 month ago

Was this helpful?

1. Theme "Text Domain" requirement

Advanced Views utilizes WordPress's built-in multilingual capabilities, and in order to translate strings within Views and Cards, your theme must define the "Text Domain" in the .

If you are using a pre-built theme, no action is required on your part. However, if you are using a custom theme or a custom child theme, open the style.css file in the root folder and ensure that the "Text Domain" is defined in the header. If it is missing, add it in the format "Text Domain: x," where x can be your own name (with dashes as delimiters) or the same value as your parent theme.

2. Single View and Card for different languages

Advanced Views uses the built-in WordPress translation function __('field label', 'yourThemeTextDomain') for all View and Card labels. This allows you to translate labels seamlessly using your preferred multilingual plugin, eliminating the need for creating a separate View or Card for every language.

'yourThemeTextDomain' will be picked up automatically, based on the Text Domain defined in the heading of the style.css file of your current theme.

While the multilingual string translation works out-of-the-box, by default, there is no 'labels list' in your theme, and your translation tool will require 'registering/entering' each string manually. See the next chapter to enable automatic strings detection.

3. Automatic strings detection (in your translation tool)

While the multilingual string translation works out-of-the-box, by default, there is no 'labels list' in your theme, and your translation tool will require 'registering/entering' each string manually.

To streamline this process, you can active the . When enabled, during View and Card saving process, the Advanced Views Framework will automatically deposit the labels into special files. It enables the use of the 'scan' feature in your translation tool, automatically loading all labels for efficient translation.

4. Translate labels within templates

Multilingual capabilities extend to the Twig and Blade templates as well.

4.1) Blade

{{ __("my-string", "yourThemeTextDomain") }}

4.2) Twig (Pro)

Upon saving a View or Card, the Advanced Views will scan of all these translation calls and interact with them in the same manner, like with the labels from the UI, described above.

Blade allows you to call any PHP functions, so you can translate any string by calling the , as you would do it usually:

To translate labels within your Twig template, employ our or filter.

🧙‍♂️
theme's style.css file
File system storage
WordPress translate (__) function
translation function