Giter Club home page Giter Club logo

translate-custom-variables's Introduction

Translate Custom Variables Magento 2

This is the official Translate Custom Variables Magento 2 extension. With this module it is possible to use custom variables in translatable strings in CMS elements.

How does it work?

  1. For example, you have a custom variable with code free_shipping_cost, and you want to place it in a translatable string in a CMS Block or CMS Page
  2. To do this, the prefix "customVar_" must be placed before the custom variable code in the translation string
  3. As: {{trans "Free Shipping from %free_shipping" free_shipping=customVar_free_shipping_cost}}

The %free_shipping will be replaced by the value from the custom variable free_shipping_cost.

Installation

Installation using composer (recommended)

To install the extension login to your environment using SSH. Then navigate to the Magento 2 root directory and run the following commands in the same order as described:

Enable maintenance mode:

php bin/magento maintenance:enable
  1. Install the extension:
composer require triveon/translate-custom-variables
  1. Enable the Translate Custom Variables Magento 2 plugin
php bin/magento module:enable Triveon_TransCustomVars
  1. Update the Magento 2 environment:
php bin/magento setup:upgrade

When your Magento environment is running in production mode, you also need to run the following comands:

  1. Compile DI:
php bin/magento setup:di:compile
  1. Deploy static content:
php bin/magento setup:static-content:deploy
  1. Disable maintenance mode:
php bin/magento maintenance:disable

Installation manually

  1. Download the extension directly from github by clicking on Code and then Download ZIP.
  2. Create the directory app/code/Triveon/TransCustomVars (Case-sensitive)
  3. Extract the zip and upload the code into app/code/Triveon/TransCustomVars
  4. Enable the Translate Custom Vars Magento 2 plugin
php bin/magento module:enable Triveon_TransCustomVars
  1. Update the Magento 2 environment:
php bin/magento setup:upgrade

Update

To update the Translate Custom Variables Extension run the following commands:

composer update triveon/translate-custom-variables
php bin/magento setup:upgrade

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.