Commons:Localization/zh
维基共享资源是一项国际化并因而多语言的计划。虽然本站默认语言为英语,但无论使用者阅读何种本地语言,该项目都旨在为其提供可用性与实用性。
国际化是指设计软件应用程序的过程,使其无需工程级改动即可适配不同语言和地区。本地化则是通过添加特定区域组件和翻译文本来使国际化软件适应特定区域或语言的过程。针对Commons的国际化与本地化工作包含以下几个组成部分:
- 软件
- 内容
- 项目页面
- 内容页面(文件、分类、图库)
- 内容页面与项目页面所使用的模板
软件
MediaWiki默认信息
MediaWiki是共享资源运行的软件。MediaWiki的界面翻译(翻译在MediaWiki安装时提供)由Translatewiki接管和进行;请点击左侧链接进行贡献。
要检查特定MediaWiki消息在translatewiki上的本地化内容,请访问translatewiki:Special:Translations/MediaWiki:并输入该MediaWiki消息的名称。若需查找特定MediaWiki消息的名称,请访问显示该消息的共享资源页面,并在URL中添加?uselang=qqx参数。重新加载页面后,所有消息文本将被替换为生成该文本的消息名称。(示例:使用Commons:Localization)
MediaWiki消息可在共享资源站内(例如模板中)通过{{int:消息名称}}调用,例如通过{{int:edit-conflict}}获取MediaWiki:edit-conflict。本地化的MediaWiki消息存储在以对应语言代码命名的子页面中,例如MediaWiki:edit-conflict/de和MediaWiki:edit-conflict/fr。若调用不存在的消息(包括对实际消息的错误拼写),系统将显示尖括号包裹的标识符(<消息名称>),例如常见的将"{{int:license}}"误写为"{{int:licensing}}"的情况(此时会显示带尖括号的错误结果:⧼licensing⧽)。
有关模板中可能用到的部分MediaWiki系统消息,请参阅Commons:Localization/useful MediaWiki messages。另请参见mw:Localisation及其系统消息。
Commons MediaWiki: namespace custom messages
MediaWiki安装时提供的默认消息文本可在本地被覆盖。[1]此外,为本地化目的可在MediaWiki:命名空间中创建全新消息。这两种情况下,此类“自定义消息”仅在Commons的MediaWiki安装中可用。
- mw:Help:System message–MediaWiki手册,关于
MediaWiki:命名空间中的系统消息。关键点:本地化主要通过/xx子页面实现,例如MediaWiki:Summary是维基的默认语言(在Commons上为en),而MediaWiki:Summary/de是该消息的德语本地化版本,适用于用户指定不同语言的情况。{{MWheader}}用于MediaWiki talk:页面,显示相关消息的本地化版本列表(但仅当这些版本与MediaWiki默认设置不同时)。 - Template:MediaWiki messages–组织关键系统消息。另请参阅英文维基百科上的en:Template:MediaWiki messages(该处通常附有讨论页说明)
- MediaWiki:Common.js–provides localization of signatures
- Help:Gadget-ImprovedUploadForm–关于如何本地化上传表单的说明(Special:Upload)。
用户脚本
- Commons:Gadgets#Localization–on localization of gadgets
内容
About localization text in images see Translation text in images. For localization read below.
项目页面
项目页面(位于Commons:和Help:命名空间中)的翻译至关重要。初访维基共享的用户可能对该平台及其宗旨了解有限,而项目页面正是阐明维基共享内容范围、适宜内容标准、上传流程及操作规范的核心说明文档。
重要页面翻译:
- Commons:Licensing
- Commons:Welcome
- Commons:Deletion policy
- Commons:FAQ
- Commons:General disclaimer
- Commons:Media help
- Commons:Project scope
- Commons:Blocking policy
- Commons:User-specific galleries, templates and categories
- Commons:Ownership of pages and files
内容页面
内容页包括分类、图库和文件描述页。这些页面的本地化包含两个要素:
- 标准文本元素。通常应通过相应的内容模板来引入。例如,分类页可包含{{See also}}模板,该模板能以多种语言提供“参见”文本。少数情况下,可直接调用MediaWiki软件内置的标准文本元素,使用
{{int:mediawiki-message-name}}结构即可实现。 - 非标准文本元素。这些内容直接包含在页面中,但应当用翻译模板进行包装,以便在添加翻译时,软件能够识别它们。通常采用的方式是简单的语言模板,或者使用{{LangSwitch}}、{{Mld}}等模板。
内容模板
模板是出现在数十、数千甚至数百万页面上的文本字符串。通过翻译最广泛使用的模板,您可以极大地方便那些不懂英语或更习惯使用母语的用户,提升 Commons 页面的实用价值。例如Template:Information模板就被超过两百万个文件描述页面所使用。虽然只是几段简短的文字,却能显著提升描述页面信息的可读性。(并非所有模板都需要翻译,有些语言中立的模板无需处理)
若模板已实现国际化,新增语言本地化的方法应清晰明了(模板文档中应有说明,或在编辑模式下查看模板时即可明确操作方式)。若模板尚未国际化,请参阅下文相关章节。
See most used translatable templates and modules.
內容國際化的方法
The major methods for internationalization are
- Autotranslate, using the {{Autotranslate}} template, which uses subpages in the standard
/xxlanguage code format to store localizations - LangSwitch, using the {{LangSwitch}} template, which stores localizations within the page or template being translated.
- Simple list, using a header linking to different language versions of a page.
- Language templates, using the individual templates listed at Commons:Language templates
- Multilingual tags are templates devoted to translating a particular message, without providing any formatting, for re-use in multiple templates.
- MediaWiki messages– in a few cases, standard text elements that are part of the MediaWiki software can be accessed directly, using the construction
{{int:mediawiki-message-name}}
Many of them are discussed in more details on Commons:Template i18n page.
Content templates with complex layouts tend to use {{Autotranslate}}, whilst simpler ones use {{LangSwitch}}. Content pages largely use LangSwitch or language templates, with a handful of MediaWiki messages. The "simple list" method is generally used only by project pages. Multilingual tags and most MediaWiki messages are normally used only by templates. For templates, {{TemplateBox}} facilitates creating a documentation page, including providing a standard explanation of how to localise the template for a new language version, given the specified internationalization method.
An additional method is demonstrated by {{Talkbox}}, which supports the construction of talkpage templates (e.g., {{Permprot}}). Here, the translations are stored in subpages of the calling template, and {{Talkbox}} switches the content as needed. The approach is similar to autotranslate, but the setup of the subpages is slightly different, and there is no /layout subpage.
自動翻譯
- some templates are localised by using the {{Autotranslate}} template. This creates a {{MainTemplate}}, {{MainTemplate/en}}, {{MainTemplate/de}} etc structure, with layout dictated by a separate {{MainTemplate/layout}} template. Individual localised templates would then be marked with
{{Translated tag}}.
- Headings (for example for user messages such as {{Blocked}}) can be localised separately with a {{MainTemplate/heading}}, but this needs to be referenced separately in MainTemplate (see {{Blocked}}), and have a parallel localisation structure ({{MainTemplate/heading/en}}, {{MainTemplate/heading/de}} etc).
- {{Translated tag}} puts the template into the appropriate subcategory of Category:Translated templates by language. Use of a parameter from the list at Template:translated tag/local category-en puts the template in additional subcategories for the type of template (for English localised templates).
其他
- {{LangSwitch}} is used for some template localization, for example at {{Shortcut text}}, a helper template for {{Shortcut}}. Another example: {{Académie Royale de Peinture, Sculpture et Architecture}}, as used at File:Boucher renaud et armide louvre.jpg.
- Simple list: some templates/categories are localised using the simple list approach demonstrated by {{Lang-CatHelp}}, allowing each page to have its own localised name. The list template should be referenced using {{Header}}, for example
{{header|Lang-CatHelp}}.
- Commons:Language templates are used for galleries, categories description, file description pages. Each is simply the ISO code of the language. Example:
{{en|English description}}.- {{Multilingual description}} is a similar template, with each language translation as a parameter, so that only one {{Multilingual description}} template is needed per page.
- {{Mldcat}} is adapted for use on category pages, but is currently experimental only and not fully functional without js/css support.
- Multilingual tags: Some templates, called multilingual tags, localise a specific class of thing. For example {{Language}} translates language names. {{CountryAdjective}}, {{Occupation}}, {{NationAndOccupation}}, {{Country}} perform similar tasks. Other templates translating names, words and phrases (usually using {{LangSwitch}}) are categorised under Category:Multilingual tags. {{Multilingual link}} allows to indicate names of versions of same Wikipedia article in many languages and displays one link in user's interface language. See also Help:Creating multilingual tags with interwiki links.
- MediaWiki messages: some translation is via MediaWiki messages–either by accessing default messages (part of the MediaWiki software) or by creating custom messages (part of Commons' MediaWiki installation only). See #MediaWiki default messages and #Commons MediaWiki: namespace custom messages sections above.
备注
- ↑ “默认消息”包括作为MediaWiki一部分提供的消息,以及由mw:Extension:WikimediaMessages提供的额外
wm-消息(例如MediaWiki:wm-license-information-description)。
參閱
- Commons:Project page translation for hints and tips on translating project pages in the Commons and Help namespaces
- Commons:Template i18n which has the details of 9 methods used for template translation and localization
- Help:AI video dubbing, machine translation based creation of video transcripts and translations
- Commons:WikiProject Templates
- Commons:Main page templates
- Commons:Administrator translations (administrative messages)
- {{User internationalisation}} and {{User MediaWiki}} userboxes
- MediaWiki:Gadget-AnonymousI18N.js (preserves
&uselangparameter in URL, for users not logged in) - {{Please Internationalise}} and {{Please translate}} / {{Description insufficient}} / Commons:Requests for translation.
- {{Template translated by copying}}, {{Redirect from translated template name}}
- Commons:Multilingual tags
- Special:MyLanguage
帮助
- "I'm trying to localize something, and I need help!" ➜ Commons:Help Desk