✅
PWA Bundle
1.1.x
1.1.x
  • PHPWA Bundle
  • How To Create A PWA?
  • How To Install/Remove A PWA?
  • Bundle Installation
  • Deployment
  • The Manifest
    • Application Information
      • Scope
      • ID
      • Direction and Language
      • Orientation
      • Description
      • IARC Rating ID
      • Categories
    • Icons
    • Screenshots
    • Shortcuts
    • Protocol Handlers
    • File Handlers
    • Share Target
    • Complete Example
  • The Service Worker
    • Configuration
    • Content Security Policy
    • Custom Service Worker Rule
    • Workbox
      • Site Manifest Cache
      • Asset Caching
      • Resource Caching
      • Image Caching
      • Font Caching
      • Offline Fallbacks
      • BackgoundSync
      • CDN and Versions
      • Cache Cleaning
      • Custom Cache Strategy
    • Push Notifications
    • Complete Example
  • Symfony UX
    • Connection Status
    • Prefetch on demand
    • Sync Broadcast
    • BackgroundSync Form
  • Image Management
    • Icons
    • Screenshots
  • Experimental Features
    • Non-Standard Parameters
      • Launch Handler
      • Display Override
      • Related Applications
      • EDGE Side Panel
    • Translations
    • Widgets (Win10+)
Powered by GitBook
On this page
  • The dir Parameter
  • The lang Parameter
  • Configuration

Was this helpful?

Edit on GitHub
Export as PDF
  1. The Manifest
  2. Application Information

Direction and Language

The PWA dir and lang parameters.

Progressive Web Apps (PWAs) can be tailored for different languages and writing directions through the use of the dir and lang parameters in the HTML tag.

By properly setting the dir and lang parameters, you ensure better user experience, accessibility, and potentially improved SEO for your PWA.

Please note that those values should be in accordance with the ones set as <html> tag attributes.

<html dir="ltr" lang="en">
</html>

The dir Parameter

The dir parameter specifies the text directionality of the content in your PWA. It can have one of three values:

  • ltr: Left-to-right, which is used for languages that are read from the left to the right (like English).

  • rtl: Right-to-left, for languages read from the right to the left (like Arabic or Hebrew).

  • auto: Automatically determines the direction based on the content.

Example usage in HTML:

The lang Parameter

The lang parameter declares the default language of the text in the page. This is important for accessibility tools and search engines.

Configuration

/config/packages/pwa.yaml
pwa:
    manifest:
        enabled: true
        dir: "ltr"
        lang: "en"
PreviousIDNextOrientation

Was this helpful?