triveon/translate-custom-variables 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

triveon/translate-custom-variables

最新稳定版本:1.1.1

Composer 安装命令:

composer require triveon/translate-custom-variables

包简介

A module to use custom variables in translatable CMS strings

README 文档

README

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

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2023-12-23