Jump to content

Mở rộng: Nội dung dịch

From mediawiki.org
This page is a translated version of the page Extension:ContentTranslation and the translation is 85% complete.
Hướng dẫn tiện ích mở rộng MediaWiki
ContentTranslation
Trạng thái phát hành: ổn định
Triển khai Giao diện người dùng, Tác vụ trang
Mô tả Công cụ cho phép các biên tập viên dịch bài từ một ngôn ngữ sang ngôn ngữ khác với sự hỗ trợ của máy dịch và các tiện ích dịch khác.
Tác giả Language team
Chính sách tương thích Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.37+
PHP 7.2+
Database changes Có
Composer mediawiki/content-translation
Virtual domain virtual-cx
  • $wgContentTranslationVersion
  • $wgContentTranslationContentImportForSectionTranslation
  • $wgContentTranslationDomainCodeMapping
  • $wgContentTranslationCXServerAuth
  • $wgContentTranslationCxServerHost
  • $wgContentTranslationEnableAnonSectionTranslation
  • $wgContentTranslationFeaturedCollectionLink
  • $wgContentTranslationAsBetaFeature
  • $wgContentTranslationTranslateInTarget
  • $wgContentTranslationDevMode
  • $wgRecommendToolAPIURL
  • $wgDraftMaxAge
  • $wgContentTranslationFeaturedCollectionDescription
  • $wgContentTranslationEnableMT
  • $wgContentTranslationFeaturedCollection
  • $wgAutomaticTranslationLanguageSearcherEntrypointEnabledLanguages
  • $wgContentTranslationSiteTemplates
  • $wgContentTranslationUnmodifiedMTThresholdForPublish
  • $wgContentTranslationTargetNamespace
  • $wgContentTranslationPublishRequirements
  • $wgContentTranslationCampaigns
  • $wgSectionTranslationTargetLanguages
Licence GNU General Public License 2.0 or later
Tải xuống
Translate the ContentTranslation extension if it is available at translatewiki.net
Phản hồi Open tasks · Báo cáo lỗi

Tiện ích mở rộng "ContentTranslation" là một công cụ cho phép biên tập viên dịch bài từ một ngôn ngữ này sang một ngôn ngữ khác với sự hỗ trợ của máy dịch và những tiện ích dịch khác. Xem Biên dịch nội dung/V2 để biết thêm thông tin chi tiết. Tiện ích mở rộng này đang được phát triển bởi đội ngũ kỹ thuật ngôn ngữ của Wikimedia

Cài đặt

This extension requires a CXserver to be setup first. Moreover it has extension dependencies.
  • Download and move the extracted ContentTranslation folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContentTranslation
    
  • Only when installing from git, Chạy Composer để cài đặt các phần phụ thuộc PHP, bằng cách cung cấp composer install --no-dev trong thư mục phần mở rộng. (Xem T173141 để biết các xung đột có thể xảy ra.)
  • Thêm mã sau vào dưới cùng tệp $LocalSettings của bạn:
    wfLoadExtension( 'ContentTranslation' );
    
  • Chạy mã cập nhật mà sẽ tự động tạo các bảng cơ sở dữ liệu mà phần mở rộng này cần.
  • Yes Xong – Chuyển tới Special:Version trên wiki của bạn để xác nhận phần mở rộng được cài đặt thành công.


Vagrant installation:

  • Nếu sử dụng Vagrant , cài đặt bằng vagrant roles enable contenttranslation --provision

Máy chủ của tiện ích "Content Translation

Việc mở rộng cần máy chủ dịch thuật nội dung (tên gọi là cxserver) hoạt động. Xem Content translation/cxserver/Setup để thiết lập máy chủ dịch nội dung. Khi chạy Content Translation tại địa phương, những gì sau đây có thể được thêm vào LocalSettings.php để sử dụng máy chủ sản xuất:

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

Phụ thuộc tùy chọn

ContentTranslation phụ thuộc vào các phần mở rộng sau:

UniversalLanguageSelector Required
VisualEditor Required Cần cho phần chỉnh sửa.
Cite Required Cần nếu bạn muốn hỗ trợ tham chiếu trong khi dịch.
WikimediaMessages Required
GuidedTour Optional Nếu được cài đặt, nó sẽ được sử dụng để hiển thị một lời giải thích về việc di chuyển một trang ra khỏi không gian người dùng.
Echo Optional Nếu được cài đặt, nó sẽ được sử dụng để hiển thị thông báo "chúc mừng" sau khi hoàn thành các bước quan trọng trong dịch.
Wikibase Optional Nếu được cài đặt và cấu hình tương tự như Wikipedia, nó sẽ được sử dụng để tự động thêm các liên kết giữa các ngôn ngữ (như liên kết trang web).
EventLogging Optional Nếu được cài đặt, có thể được sử dụng để ghi nhật ký xuất bản, lỗi và các sự kiện khác.
BetaFeatures Optional Nếu được cài đặt, ContentTranslation sẽ xuất hiện như một tính năng beta trong preferences.

Tham số cấu hình

Để biết danh sách đầy đủ và các mặc định, xem extension.json trong kho nguồn.

ContentTranslationDomainCodeMapping Used to map between non-standard language codes and actual domains. The default is the same as in Wikipedia codes and domains.
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 parameters

Dịch nội dung chủ yếu hoạt động trên trang đặc biệt Special:ContentTranslation. Các tham số URL là

  • page: source title
  • targettitle: target title
  • from: source language
  • to: target language
  • campaign: campaign name
    • In Wikimedia wikis, if content translation is not enabled in the user settings then only links to pre-defined campaign will work. Campaigns are defined in InitialiseSettings.php wmgContentTranslationCampaigns variable.

Ví dụ

Xem thêm