承接 itmar/add_lazy_pot_file 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

itmar/add_lazy_pot_file

Composer 安装命令:

composer require itmar/add_lazy_pot_file

包简介

This is a command to add information corresponding to lazy loading to the POT file for functioning the translation function provided by WordPress.

README 文档

README

Provides a function that adds the path information of the calling file of lazy loading to the translation template file (POT file) corresponding to the translation function.

Quick links: Using | Installing | Notes | Support

When to use

When using a module that is not always used, delaying loading it until it is time to use it is called lazy loading, and React provides a function called React.lazy. When you use this, the transpiled js file is divided into 1) a file that is loaded with a delay, and 2) a file that calls it. When the part using the translation function is stored in ①, wp i18n make-pot, the WP-CLI command for creating a POT file, outputs only the path information of ① to the POT file, and the path of ② No information is output. ② If you create a Javascript translation file based on a POT file that does not have file path information, you will not be able to render the translated result. Therefore, the path information in ② must be recorded in the POT file. This WP-CLI command provides the ability to add ② file path information to the file generated with wp i18n make-pot.

Using

wp add_source_path [text domain]

Among the plugins installed in WordPress, select the js file that uses the React.lazy function from the build folder of the plugin that has the text domain information [text domain] as the plugin information, and select the js file that uses the React.lazy function. Based on the lazy loading information read from , write the path information of the selected js file to the POT file and overwrite it.

Installing

This package is provided as a Composer project, so install it using the Composer installation procedure.

  1. Clone GitHub repository: Navigate to the folder where WordPress is installed, open a command prompt or terminal, and clone the repository using Git commands as follows:
git clone https://github.com/itmaroon/add_lazy_pot_file.git
  1. Installing Composer dependencies Change to the directory of the cloned repository.
cd ./add_lazy_pot_file

Install dependencies.

composer install

Notes

  1. This WP-CLI command assumes support for the translation system of the plugin that provides the Gutenberg block component.
  2. Text Domain: must be set in the plugin information (comment at the beginning of the PHP file that is the entry point of the plugin).
  3. A POT file must be created in advance using wp i18n make-pot. This file name is [text domain].pot and must be located in one of the folders within the plugin's root folder.

Support

If you have any questions, please contact us at the following email address. master@itmaroon.net

itmar/add_lazy_pot_file 适用场景与选型建议

itmar/add_lazy_pot_file 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 11 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 itmar/add_lazy_pot_file 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 itmar/add_lazy_pot_file 我们能提供哪些服务?
定制开发 / 二次开发

基于 itmar/add_lazy_pot_file 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-19