ReadyMage Help
  • ReadyMage
  • USER PORTAL
    • User Portal Access
    • Change Password
    • Two-Factor Authentication
  • Project Management
    • Project List
    • Project Settings
      • General Info
      • Git Management
      • Environments
      • Members and roles
      • Security
        • Deletion Protection
        • TFA Enforcement
      • Delete Project
  • Application Management
    • Magento Details
    • Domain Management
    • Logs & Monitoring
    • Backups
      • Backup process
      • Disaster recovery process
    • Deployments
      • Deploy without build cache
      • Queue Tab (Launching soon)
      • Settings Tab (Launching soon)
        • Automatic Deployments
        • ReadyMage Maintenance Page
          • Website Access During Maintenance
      • Notifications Tab (Launching soon)
        • Managing email notifications
        • Managing Slack notifications
      • Pipeline Deployments
      • Pipeline Configuration file
        • Migration guide from 0.x.x to 1.0.0
    • SSH Access
      • SSH Usage
      • Database Access using Graphical Interface
      • Troubleshooting
    • IP Whitelist
    • Password Authentication
    • Database & Media
    • Search Engine Bots Discovery
  • Service Management
    • Server-Side Rendering
    • SFTP
    • NewRelic
    • Packagist Modules
    • Cloudflare
  • Infrastructure Management
    • Autoscale
    • Sleep Mode
    • Manage Services
    • Historical Resource Usage
  • PROJECT DEVELOPMENT
    • Node.js version
    • Store access
    • Creating a Production Environment
    • Additional Environments
    • ScandiPWA, PWA Studio, Hyva, or Luma
    • Project Migration to ReadyMage
    • SSH Access for Magento CLI, database and media
    • Code customization and local setup
    • Extension installation
    • Add translations (switch locale)
    • Existing ScandiPWA Project Code Migration
    • Database and media migration
    • Redirect setup
    • Connect CDN and WebP optimization
    • Email setup
    • Changing the Domain & Multi-Store Set up
    • Internal service addresses
    • Kibana filters and useful CLI commands
    • Persistent directories
  • FAQ
    • General
    • Autoscaling
    • Billing
    • User Portal Options
    • Services connected to ReadyMage
    • Hosting, managing resources and autoscaling
    • Source Code Management
    • ScandiPWA and Magento Versions, Commerce Edition and Upgrades
    • Supported software versions
Powered by GitBook
On this page

Was this helpful?

  1. PROJECT DEVELOPMENT

Add translations (switch locale)

PreviousExtension installationNextExisting ScandiPWA Project Code Migration

Last updated 1 year ago

Was this helpful?

Step-by-step guide

Local setup is required to add translations.

  1. Ensure that you are running "@scandipwa/scandipwa": "x.x.x". You can check within scandipwa/package.json file.

  2. Set up the project locally by following these .

  3. Navigate to scandipwa folder within your source code folder.

  4. Run command from the terminal npm i @scandipwa/webpack-i18n-runtime

  5. Remove hardcoded locale from app/etc/config.php file by deleting the following lines of code: 'general' => [

    'locale' => [

    'code' => 'en_US'

    ]

    ],

  6. Open scandipwa/package.json file.

  7. Add the locales you wish to have and @scandipwa/webpack-i18n-runtime extension, for example: "scandipwa": {

    "type": "theme",

    "locales": {

    "en_US": true,

    "fr_FR": true

    },

    "parentTheme": "@scandipwa/scandipwa",

    "extensions": {

    "@scandipwa/webpack-i18n-runtime": true

    }

    },

  8. Navigate to scandipwa folder and build your ScandiPWA theme to create added translation files by running the following command: BUILD_MODE=magento npm run start

  9. Add your translations within generated locale file which is located in scandipwa/i18n folder.

  10. Navigate to the repository root folder and run: npm run start

  11. In Magento admin go to Stores > Configuration > General > General > Locale Options.

  12. Switch to your store's scope and change the Locale to the one you created.

  13. Clear cache by going to System > Tools > Cache Management and pressing Flush Cache Storage and Flush Magento Cache.

  14. Open Frontend to ensure that translations are active.

  15. Push all the changes to your repository.

  16. Once the changes are deployed, enable access instance using SSH following these .

  17. Run the following command to enable developer mode: magento deploy:mode:set developer

  18. Change the locale for the store view through your instance admin panel.

  19. Clear cache by going to System > Tools > Cache Management and pressing Flush Cache Storage and Flush Magento Cache.

  20. Run the following commands from your SSH: magento in:rei magento c:c magento deploy:mode:set production

Code customization and local setup
instructions
instructions