Extension:ContentTranslation

From mediawiki.org
This page is a translated version of the page Extension:ContentTranslation and the translation is 97% complete.
MediaWiki 拡張機能マニュアル
ContentTranslation
リリースの状態: 安定
実装 ユーザー インターフェイス, ページの操作
説明 編集者が機械翻訳などの翻訳補助機能を利用して、記事をある言語から別の言語に翻訳するためのツール。
作者 言語チーム
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki 1.37+
PHP 7.2+
データベースの変更 はい
Composer mediawiki/content-translation
テーブル cx_translations
cx_translators
cx_lists
cx_suggestions
cx_corpora
cx_notification_log
cx_significant_edits
cx_section_translations
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
ヘルプ Help:Extension:ContentTranslation/ja
  • $wgContentTranslationEnableSuggestions
  • $wgContentTranslationTargetNamespace
  • $wgContentTranslationContentImportForSectionTranslation
  • $wgContentTranslationDomainCodeMapping
  • $wgContentTranslationCXServerAuth
  • $wgContentTranslationEnableAnonSectionTranslation
  • $wgContentTranslationExcludedNamespaces
  • $wgContentTranslationCluster
  • $wgContentTranslationAsBetaFeature
  • $wgContentTranslationTranslateInTarget
  • $wgContentTranslationDevMode
  • $wgRecommendToolAPIURL
  • $wgDraftMaxAge
  • $wgContentTranslationEnableUnifiedDashboard
  • $wgContentTranslationEnableMT
  • $wgSectionTranslationTargetLanguages
  • $wgContentTranslationEnableSectionTranslation
  • $wgContentTranslationSiteTemplates
  • $wgContentTranslationUnmodifiedMTThresholdForPublish
  • $wgContentTranslationVersion
  • $wgContentTranslationPublishRequirements
  • $wgContentTranslationCampaigns
  • $wgContentTranslationDatabase
Quarterly downloads 27 (Ranked 115th)
translatewiki.net で翻訳を利用できる場合は、ContentTranslation 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

ContentTranslation拡張機能は、機械翻訳とその他の翻訳補助機能を用いて、編集者が記事をある言語から別の言語に翻訳することを可能にするツールです。なぜこのツールがあるかなど、詳細な情報はコンテンツ翻訳 をご覧ください。この拡張機能はウィキメディアの言語チームが開発しました。

インストール

This extension requires a Content Translation server to be setup first. Morover it has three extension dependencies.
  • ダウンロードして、ファイルをextensions/フォルダー内のContentTranslationという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContentTranslation
  • Gitでのインストールの場合のみ、PHPの依存関係をインストールするためComposerを実行します。 (合併症の可能性についてはタスク T173141を参照。)
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'ContentTranslation' );
    
  • 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。


Vagrantでのインストール:

  • Vagrant を使用している場合は、vagrant roles enable contenttranslation --provisionでインストールしてください。

Content Translation server

この拡張機能には、翻訳サーバー (別名: CX サーバー) が稼働している必要があります。 コンテンツ翻訳サーバーの設定方法は Content_translation/Setup をご覧ください。 コンテンツ翻訳機能をローカルで走らせるには、以下の文字列をLocalSettings.phpに追加して翻訳生成 CX サーバーを利用します。

$wgContentTranslationSiteTemplates['cx'] = 'https://cxserver.wikimedia.org/v1';

翻訳データベース

この拡張機能にはダッシュボード機能というオプションがあり、翻訳者はすべての言語にの訳文を参照できます。 この拡張機能を多言語でインストールした場合、例えばウィキメディアのウィキ群でダッシュボード機能を提供するには、中央管理データベースを作成する必要があります。 そのデータベースのテーブル定義は拡張機能のソースコードの sql ディレクトリ内にあります。Content translation/Product Definition/Database に詳細があります。 データベースの作成が済んだら、グローバル構成変数 $wgContentTranslationDatabase にデータベース名を設定します:

$wgContentTranslationDatabase = 'db_name';

拡張機能の依存関係

ContentTranslation は以下の拡張機能に依存しています:

UniversalLanguageSelector 必須
VisualEditor 必須 エディタの構成要素として必要不可欠
Cite 必須 翻訳しながら参考文献の出典も作業するには必要
GuidedTour 省略可能 インストール後、利用者空間からページを移動する手順を表示するために使われます。
Echo 省略可能 インストール後、翻訳マイルストーンを達成した「おめでとう」通知の表示に使われます。
ウィキベース 省略可能 インストール後にウィキペディアに似た設定にすると、言語間リンクを(サイト間リンクとして)自動的に追加するため使われます。
EventLogging 省略可能 インストール後、印刷、エラーその他のイベントのログ記録に使われます。
BetaFeatures 省略可能 インストール後、コンテンツ翻訳は個人設定にベータ版機能として表示されます。

設定の変数

For the full list and defaults, see extension.json in the source repository.

ContentTranslationDomainCodeMapping
Used to map between non-standard language codes and actual domains. The default is the same as in Wikipedia codes and domains.
ContentTranslationRESTBase
Configuration of RESTBase URL and connection parameters. The defaults are for Wikipedia.
ContentTranslationDatabase
The name of the database in which the common tables for managing translations across wikis are stored. The default is null, which means that the default database is used.
ContentTranslationCluster
In a Wikipedia-like database configuration, the name of the cluster on which the database is hosted. The default is null, which means that the default cluster is used.
ContentTranslationEventLogging
Whether EventLogging is enabled. The default is false.
ContentTranslationHighMTCategory
A category to which pages that have a high level of machine translation are added upon publishing. The default is null.
ContentTranslationSiteTemplates
Templates for essential URLs. The defaults assume Wikipedia, so this variable must be configured differently for other sites. Where relevant, $1 is replaced by the language code, and $2 is replaced by the page title.
ContentTranslationTranslateInTarget
Whether to open Special:ContentTranslation in the target wiki when clicking the button in the entry point. The domain will be based on $wgContentTranslationSiteTemplates. The default is to open Special:ContentTranslation on the same wiki. (For Wikipedia this is set to true.)
ContentTranslationAsBetaFeature
Whether ContentTranslation is a beta feature.
ContentTranslationTargetNamespace
The default target namespace for published articles. The default is Main.
ContentTranslationCampaigns
Campaigns that are available in the URL as valid values for the campaign parameter in the URL. This allows automatic enabling of the beta feature and event logging.
ContentTranslationCXServerAuth
CXServer connection configuration.
ContentTranslationEnableSuggestions
Whether to use the suggestions tab and automatic suggestions. This needs the GapFinder API. This is false by default, but true in Wikipedia.
RecommendToolAPIURL
The URL for the GapFinder API, needed if ContentTranslationEnableSuggestions is true.

URLパラメータ

コンテンツ翻訳機能は主に特別ページの Special:ContentTranslation で実行します。URL のパラメータは右のとおり。

  • page: 原文の題名
  • targettitle: 訳文の題名
  • from: 原文の言語
  • to: 訳文の言語
  • campaign: キャンペーンの名称
    • ウィキメディアのウィキでは、個人設定でコンテンツ翻訳を有効にしていない場合にはあらかじめ設定されたキャンペーンの名称のみ選べます。キャンペーンの設定はInitialiseSettings.phpwmgContentTranslationCampaigns 変数で決まります。

関連項目