edit homepage
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
# HTBD: A Free and Open-Source WordPress Multilingual Plugin Powered by the Baidu Translate API
|
||||
|
||||
[](https://github.com/hanyixuanten/HTBD)
|
||||
|
||||
HTBD is a multilingual translation plugin for WordPress. It uses the Baidu Translate API to translate posts, pages, and other website content into different languages, with a dedicated URL for each translated version.
|
||||
|
||||
Translations are stored on the server in `{$wpdb->prefix}hyx_bd_translations`. Unless a user explicitly refreshes a translation, the same content is translated only once for each target language. Existing `{$wpdb->prefix}btranslate_translations` data is migrated when the renamed plugin is activated. This avoids calling the translation API on every page visit, reducing API usage and improving page load performance.
|
||||
|
||||
## Project Links
|
||||
|
||||
- Plugin homepage: [https://www.vblg.top/index.php/archives/147](https://www.vblg.top/index.php/archives/147)
|
||||
- GitHub repository: [https://github.com/hanyixuanten/HTBD](https://github.com/hanyixuanten/HTBD)
|
||||
- WordPress plugin page: [https://wordpress.org/plugins/hyx-translator-for-baidu-translate/](https://wordpress.org/plugins/hyx-translator-for-baidu-translate/)
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
# HTBD:基于百度翻译 API 的免费开源 Wordpress 多语言插件
|
||||
|
||||
[](https://github.com/hanyixuanten/HTBD)
|
||||
|
||||
HTBD 是一款 WordPress 多语言翻译插件,通过百度翻译开放平台 API,将网站中的文章、页面及其他内容翻译为不同语言,并为译文生成独立的语言访问地址。
|
||||
|
||||
插件会将翻译结果保存在服务器的 `{$wpdb->prefix}hyx_bd_translations` 表中。除非用户主动刷新翻译,否则同一内容在同一目标语言下只需翻译一次。启用改名后的插件时,已有 `{$wpdb->prefix}btranslate_translations` 数据会自动迁移,无需在每次访问页面时重复调用翻译 API,有助于减少 API 请求量并提高页面加载速度。
|
||||
|
||||
## 项目地址
|
||||
|
||||
- 插件主页:[https://www.vblg.top/index.php/archives/147](https://www.vblg.top/index.php/archives/147)
|
||||
- GitHub 仓库:[https://github.com/hanyixuanten/HTBD](https://github.com/hanyixuanten/HTBD)
|
||||
- WordPress 插件主页:[https://wordpress.org/plugins/hyx-translator-for-baidu-translate/](https://wordpress.org/plugins/hyx-translator-for-baidu-translate/)
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: HTBD - hyx Translator powered by Baidu Translate
|
||||
* Plugin URI: https://github.com/hanyixuanten/HTBD
|
||||
* Plugin URI: https://www.vblg.top/index.php/archives/147
|
||||
* Description: Persistent multilingual WordPress translations powered by Baidu Translate.
|
||||
* Version: 0.2.3
|
||||
* Requires at least: 6.4
|
||||
* Requires PHP: 8.1
|
||||
* Author: hanyixuanten
|
||||
* Author URI: https://www.vblg.top
|
||||
* License: GPL-3.0-only
|
||||
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
* Text Domain: hyx-translator-for-baidu-translate
|
||||
@@ -41,5 +42,18 @@ function htbd_load_textdomain() {
|
||||
load_plugin_textdomain( 'hyx-translator-for-baidu-translate', false, dirname( plugin_basename( HTBD_FILE ) ) . '/languages' );
|
||||
}
|
||||
|
||||
function htbd_add_plugin_row_meta( $plugin_meta, $plugin_file ) {
|
||||
if ( plugin_basename( HTBD_FILE ) === $plugin_file ) {
|
||||
$plugin_meta[] = sprintf(
|
||||
'<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a>',
|
||||
esc_url( 'https://github.com/hanyixuanten/HTBD' ),
|
||||
esc_html__( 'GitHub Repository', 'hyx-translator-for-baidu-translate' )
|
||||
);
|
||||
}
|
||||
|
||||
return $plugin_meta;
|
||||
}
|
||||
|
||||
add_action( 'plugins_loaded', 'htbd_load_textdomain', 5 );
|
||||
add_action( 'plugins_loaded', array( 'HTBD_Plugin', 'instance' ) );
|
||||
add_action( 'plugins_loaded', array( 'HTBD_Plugin', 'instance' ) );
|
||||
add_filter( 'plugin_row_meta', 'htbd_add_plugin_row_meta', 10, 2 );
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
=== HTBD - hyx Translator powered by Baidu Translate ===
|
||||
Contributors: hanyixuanten
|
||||
Homepage: https://github.com/hanyixuanten/HTBD
|
||||
Homepage: https://www.vblg.top/index.php/archives/147
|
||||
Requires at least: 6.4
|
||||
Tested up to: 7.0
|
||||
Requires PHP: 8.1
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
=== HTBD - hyx Translator powered by Baidu Translate ===
|
||||
Contributors: hanyixuanten
|
||||
Homepage: https://github.com/hanyixuanten/HTBD
|
||||
Homepage: https://www.vblg.top/index.php/archives/147
|
||||
Requires at least: 6.4
|
||||
Tested up to: 7.0
|
||||
Requires PHP: 8.1
|
||||
|
||||
Reference in New Issue
Block a user