aucor/polylang-translate-existing-media 问题修复 & 功能扩展

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

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

aucor/polylang-translate-existing-media

Composer 安装命令:

composer require aucor/polylang-translate-existing-media

包简介

Bulk translate and replace all existing media in content, featured image and meta fields when you enable translations in media with Polylang.

README 文档

README

Contributors: Teemu Suoranta

Tags: polylang, media, attachments, translations

License: GPLv2 or later

screen shot 2017-01-23 at 17 02 03

Description

Polylang Translate existing media is an add-on for the multilingual WordPress plugin Polylang. This add-on let's you bulk translate and replace all existing media in content, featured image and meta fields you enable translations in media. This plugin is based on my other Polylang plugin polylang-copy-content.

When to use:

  • When turning existing site to multi-lingual
  • When enabling media translations when you already have media uploaded and added to content

Basic feature list:

  • Translate all media (images and galleries) that are inside content, meta fields and featured image
  • Takes care all post types (that are not 'attachment', 'revision', 'acf-field', 'acf-field-group', 'nav_menu_item', 'polylang_mo')
  • Image translations are linked automatically
  • You can add your own custom fields that have image IDs
  • Uses Polylang's functions, no messing around

This is open source and I cannot give you any guarantees, though it has worked for me in many projects. Please, report issues and contribute!

Installation

How-to use (takes around 5 minutes):

  • Take a backup of your database
  • Download plugin and activate (you will need Polylang active)
  • Enable Media translations in Polylang Settings
  • Set all content without language to default language from "Languages" admin page
  • Click "1. Translate the whole media library" from the admin notice
  • Click through steps (50 posts at a time). Each step will take some time.
  • Click "2. Translate existing images in content" from the admin notice
  • Click through steps (50 posts at a time). Each step will take some time.
  • Deactivate and delete plugin when you have gone through all the steps

Composer:

$ composer aucor/polylang-translate-existing-media

With composer.json:

{
  "require": {
    "aucor/polylang-translate-existing-media": "*"
  },
  "extra": {
    "installer-paths": {
      "htdocs/wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
    }
  }
}

Filters

Add your own custom fields that have images saved as IDs:

function prefix_custom_fields_to_translate($custom_fields) {
	// return keys of your custom fields with image id
  return array(
    'my_custom_image_field',
    'other_custom_image_field'
  );
}
add_filter( 'polylang-translate-existing-media-custom-fields-with-image-id', 'prefix_custom_fields_to_translate' );

Issues and feature whishlist

Issues:

(No known issues, yet)

To-do:

  • Include terms and their custom fields
  • Replacing count might be off, make it more informative

Changelog

0.2.2

  • PHP 7.2. compatibility

0.2

  • New Feature: Translate whole media library
  • New Feature: API for custom_fields that save the image as ID
  • New Feature: Add filter to excluded post types polylang-translate-existing-media-skip-post-types
  • Improvement: Include all post_status
  • Bugfix: Don't copy featured image, just translate the existing one

aucor/polylang-translate-existing-media 适用场景与选型建议

aucor/polylang-translate-existing-media 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.53k 次下载、GitHub Stars 达 29, 最近一次更新时间为 2016 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 aucor/polylang-translate-existing-media 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 29
  • Watchers: 6
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2016-09-30