From a6b600c4e27af2b752db8eabb3058bf1467a0a8a Mon Sep 17 00:00:00 2001 From: milde Date: Thu, 18 Aug 2016 13:19:19 +0000 Subject: [PATCH] Apply [ 133 ] Persian mappings by Shahin Azad. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7967 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/HISTORY.txt | 5 ++ docutils/docutils/languages/fa.py | 61 ++++++++++++++++ docutils/docutils/parsers/rst/languages/fa.py | 101 ++++++++++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 docutils/docutils/languages/fa.py create mode 100644 docutils/docutils/parsers/rst/languages/fa.py diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt index 25b39d493..bea1744e8 100644 --- a/docutils/HISTORY.txt +++ b/docutils/HISTORY.txt @@ -16,6 +16,11 @@ Changes Since 0.12 ================== +* docutils/languages/fa.py + docutils/parsers/rst/languages/fa.py: + + - Apply [ 133 ] Persian mappings by Shahin Azad. + * docutils/nodes.py - Fix [ 253 ] Attribute key without value not allowed in XML. diff --git a/docutils/docutils/languages/fa.py b/docutils/docutils/languages/fa.py new file mode 100644 index 000000000..58351d4fa --- /dev/null +++ b/docutils/docutils/languages/fa.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# $Id: fa.py 4564 2016-08-10 11:48:42Z +# Author: Shahin +# Copyright: This module has been placed in the public domain. + +# New language mappings are welcome. Before doing a new translation, please +# read . Two files must be +# translated for each language: one in docutils/languages, the other in +# docutils/parsers/rst/languages. + +""" +Persian-language mappings for language-dependent features of Docutils. +""" + +__docformat__ = 'reStructuredText' + +labels = { + # fixed: language-dependent + 'author': 'نویسنده', + 'authors': 'نویسندگان', + 'organization': 'سازمان', + 'address': 'آدرس', + 'contact': 'تماس', + 'version': 'نسخه', + 'revision': 'بازبینی', + 'status': 'وضعیت', + 'date': 'تاریخ', + 'copyright': 'کپی‌رایت', + 'dedication': 'تخصیص', + 'abstract': 'چکیده', + 'attention': 'توجه!', + 'caution': 'احتیاط!', + 'danger': 'خطر!', + 'error': 'خطا', + 'hint': 'راهنما', + 'important': 'مهم', + 'note': 'یادداشت', + 'tip': 'نکته', + 'warning': 'اخطار', + 'contents': 'محتوا'} +"""Mapping of node class name to label text.""" + +bibliographic_fields = { + # language-dependent: fixed + 'author': 'نویسنده', + 'authors': 'نویسندگان', + 'organization': 'سازمان', + 'address': 'آدرس', + 'contact': 'تماس', + 'version': 'نسخه', + 'revision': 'بازبینی', + 'status': 'وضعیت', + 'date': 'تاریخ', + 'copyright': 'کپی‌رایت', + 'dedication': 'تخصیص', + 'abstract': 'چکیده'} +"""Persian (lowcased) to canonical name mapping for bibliographic fields.""" + +author_separators = ['؛', '،'] +"""List of separator strings for the 'Authors' bibliographic field. Tried in +order.""" diff --git a/docutils/docutils/parsers/rst/languages/fa.py b/docutils/docutils/parsers/rst/languages/fa.py new file mode 100644 index 000000000..467c2c889 --- /dev/null +++ b/docutils/docutils/parsers/rst/languages/fa.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +# $Id: fa.py 4564 2016-08-10 11:48:42Z +# Author: Shahin +# Copyright: This module has been placed in the public domain. + +# New language mappings are welcome. Before doing a new translation, please +# read . Two files must be +# translated for each language: one in docutils/languages, the other in +# docutils/parsers/rst/languages. + +""" +Persian-language mappings for language-dependent features of +reStructuredText. +""" + +__docformat__ = 'reStructuredText' + + +directives = { + # language-dependent: fixed + 'توجه': 'attention', + 'احتیاط': 'caution', + 'کد': 'code', + 'بلوک-کد': 'code', + 'کد-منبع': 'code', + 'خطر': 'danger', + 'خطا': 'error', + 'راهنما': 'hint', + 'مهم': 'important', + 'یادداشت': 'note', + 'نکته': 'tip', + 'اخطار': 'warning', + 'تذکر': 'admonition', + 'نوار-کناری': 'sidebar', + 'موضوع': 'topic', + 'بلوک-خط': 'line-block', + 'تلفظ-پردازش-شده': 'parsed-literal', + 'سر-فصل': 'rubric', + 'کتیبه': 'epigraph', + 'نکات-برجسته': 'highlights', + 'نقل-قول': 'pull-quote', + 'ترکیب': 'compound', + 'ظرف': 'container', + #'questions': 'questions', + 'جدول': 'table', + 'جدول-csv': 'csv-table', + 'جدول-لیست': 'list-table', + #'qa': 'questions', + #'faq': 'questions', + 'متا': 'meta', + 'ریاضی': 'math', + #'imagemap': 'imagemap', + 'تصویر': 'image', + 'شکل': 'figure', + 'شامل': 'include', + 'خام': 'raw', + 'جایگزین': 'replace', + 'یونیکد': 'unicode', + 'تاریخ': 'date', + 'کلاس': 'class', + 'قانون': 'role', + 'قانون-پیش‌فرض': 'default-role', + 'عنوان': 'title', + 'محتوا': 'contents', + 'شماره-فصل': 'sectnum', + 'شماره‌گذاری-فصل': 'sectnum', + 'سرآیند': 'header', + 'پاصفحه': 'footer', + #'footnotes': 'footnotes', + #'citations': 'citations', + 'یادداشت-هدف': 'target-notes', + } +"""Persian name to registered (in directives/__init__.py) directive name +mapping.""" + +roles = { + # language-dependent: fixed + 'مخفف': 'abbreviation', + 'سرنام': 'acronym', + 'کد': 'code', + 'شاخص': 'index', + 'زیرنویس': 'subscript', + 'بالانویس': 'superscript', + 'عنوان': 'title-reference', + 'نیرو': 'pep-reference', + 'تاکید': 'emphasis', + 'قوی': 'strong', + 'لفظی': 'literal', + 'ریاضی': 'math', + 'منبع-نام‌گذاری': 'named-reference', + 'منبع-ناشناس': 'anonymous-reference', + 'منبع-پانویس': 'footnote-reference', + 'منبع-نقل‌فول': 'citation-reference', + 'منبع-جایگزینی': 'substitution-reference', + 'هدف': 'target', + 'منبع-uri': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'خام': 'raw',} +"""Mapping of Persian role names to canonical role names for interpreted text. +""" -- 2.11.4.GIT