packages feed

citeproc-hs 0.3.2 → 0.3.3

raw patch · 48 files changed

+1868/−1598 lines, 48 filesdep +file-embeddep +template-haskell

Dependencies added: file-embed, template-haskell

Files

citeproc-hs.cabal view
@@ -1,5 +1,5 @@ name:               citeproc-hs-version:            0.3.2+version:            0.3.3 homepage:           http://gorgias.mine.nu/repos/citeproc-hs/ synopsis:           A Citation Style Language implementation in Haskell @@ -39,7 +39,7 @@                     locales/locales-is-IS.xml                     locales/locales-it-IT.xml                     locales/locales-ja-JP.xml-                    locales/locales-kh-KH.xml+                    locales/locales-km-KH.xml                     locales/locales-ko-KR.xml                     locales/locales-mn-MN.xml                     locales/locales-nb-NO.xml@@ -72,6 +72,10 @@   description: Use network and HTTP to retrieve csl file from URIs.   default:     True +flag embed_data_files+  description: Embed locale files into the library (needed for windows packaging)+  default:     False+ library     exposed-modules:  Text.CSL                       Text.CSL.Eval@@ -91,6 +95,7 @@                       Text.CSL.Input.Json                       Text.CSL.Output.Pandoc                       Text.CSL.Output.Plain+                      Text.CSL.Test     other-modules:    Paths_citeproc_hs     ghc-options:      -funbox-strict-fields -Wall     ghc-prof-options: -prof -auto-all@@ -107,6 +112,11 @@        build-depends: network >= 2, HTTP >= 4000.0.9        extensions:    CPP        cpp-options:   -DUSE_NETWORK++    if flag(embed_data_files)+       build-depends: template-haskell, file-embed+       extensions:    CPP+       cpp-options:   -DEMBED_DATA_FILES      if impl(ghc >= 6.10)        build-depends: base >= 4, syb, parsec, old-locale, time
locales/locales-af-ZA.xml view
@@ -55,6 +55,7 @@       <term name="bc">BC</term>        <!-- QUOTES -->+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->       <term name="open-quote">“</term>       <term name="close-quote">”</term>       <term name="open-inner-quote">‘</term>
locales/locales-ar-AR.xml view
@@ -1,304 +1,291 @@-<?xml version="1.0" encoding="utf-8"?>-<locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="ar">-   <style-options punctuation-in-quote="false"/>-   <date form="text">-      <date-part name="day" suffix=" "/>-      <date-part name="month" suffix=", "/>-      <date-part name="year"/>-   </date>-   <date form="numeric">-      <date-part name="day" suffix="/"/>-      <date-part name="month" form="numeric" suffix="/"/>-      <date-part name="year"/>-   </date>-   <terms>-      <term name="accessed">زير</term>-      <term name="and">و</term>-      <term name="and others">وآخرون</term>-      <term name="anonymous">مجهول</term>-      <term name="anonymous" form="short">مجهول</term>-      <term name="at">عند</term>-      <term name="by">by</term>-      <term name="circa">circa</term>-      <term name="circa" form="short">c.</term>-      <term name="cited">وثِّقَ</term>-      <term name="edition">-         <single>الطبعة</single>-         <multiple>الطبعات</multiple>-      </term>-      <term name="edition" form="short">ط</term>-      <term name="et-al">et al.</term>-      <term name="forthcoming">القادم</term>-      <term name="from">من</term>-      <term name="ibid">آيبيد</term>-      <term name="in">في</term>-      <term name="in press">تحت الطبع</term>-      <term name="internet">الإنترنت</term>-      <term name="interview">مقابلة</term>-      <term name="letter">رسالة</term>-      <term name="no date">no date</term>-      <term name="no date" form="short">n.d.</term>-      <term name="online">ربط مباشر</term>-      <term name="presented at">قُدَّم في</term>-      <term name="reference">-         <single>reference</single>-         <multiple>references</multiple>-      </term>-      <term name="reference" form="short">-         <single>ref.</single>-         <multiple>refs.</multiple>-      </term>-      <term name="retrieved">جلب</term>--      <!-- ANNO DOMINI; BEFORE CHRIST -->-      <term name="ad">AD</term>-      <term name="bc">BC</term>--      <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>--      <!-- ORDINALS -->-      <term name="ordinal-01">st</term>-      <term name="ordinal-02">nd</term>-      <term name="ordinal-03">rd</term>-      <term name="ordinal-04">th</term>--      <!-- LONG ORDINALS -->-      <term name="long-ordinal-01">first</term>-      <term name="long-ordinal-02">second</term>-      <term name="long-ordinal-03">third</term>-      <term name="long-ordinal-04">fourth</term>-      <term name="long-ordinal-05">fifth</term>-      <term name="long-ordinal-06">sixth</term>-      <term name="long-ordinal-07">seventh</term>-      <term name="long-ordinal-08">eighth</term>-      <term name="long-ordinal-09">ninth</term>-      <term name="long-ordinal-10">tenth</term>--      <!-- CATEGORIES -->-      <term name="anthropology">علم الإنسان</term>-      <term name="astronomy">علم الفلك</term>-      <term name="biology">علم الأحياء</term>-      <term name="botany">علم النبات</term>-      <term name="chemistry">علم الكيمياء</term>-      <term name="engineering">الهندسة</term>-      <term name="generic-base">أساس عام</term>-      <term name="geography">جغرافيا</term>-      <term name="geology">علم الأرض</term>-      <term name="history">التاريخ</term>-      <term name="humanities">الإنسانيات</term>-      <term name="linguistics">linguistics</term>-      <term name="literature">الأدب</term>-      <term name="math">الرياضيات</term>-      <term name="medicine">الطب</term>-      <term name="philosophy">الفلسفة</term>-      <term name="physics">الفيزياء</term>-      <term name="psychology">علم النفس</term>-      <term name="sociology">علم الإجتماع</term>-      <term name="science">العلوم</term>-      <term name="political_science">العلوم السياسية</term>-      <term name="social_science">العلوم الإجتماعية</term>-      <term name="theology">العلوم الإلهية</term>-      <term name="zoology">علم الحيوان</term>--      <!-- LONG LOCATOR FORMS -->-      <term name="book">-         <single>كتاب</single>-         <multiple>كُتُب</multiple>-      </term>-      <term name="chapter">-         <single>فصل</single>-         <multiple>فصول</multiple>-      </term>-      <term name="column">-         <single>عمود</single>-         <multiple>أعمدة</multiple>-      </term>-      <term name="figure">-         <single>رسم توضيحي</single>-         <multiple>رسوم توضيحية</multiple>-      </term>-      <term name="folio">-         <single>ورقة</single>-         <multiple>أوراق</multiple>-      </term>-      <term name="issue">-         <single>عدد</single>-         <multiple>أعداد</multiple>-      </term>-      <term name="line">-         <single>سطر</single>-         <multiple>أسطر</multiple>-      </term>-      <term name="note">-         <single>ملاحظة</single>-         <multiple>ملاحظات</multiple>-      </term>-      <term name="opus">-         <single>قطعة موسيقية</single>-         <multiple>أوبرا</multiple>-      </term>-      <term name="page">-         <single>صفحة</single>-         <multiple>صفحات</multiple>-      </term>-      <term name="paragraph">-         <single>فقرة</single>-         <multiple>فقرات</multiple>-      </term>-      <term name="part">-         <single>جزء</single>-         <multiple>أجزاء</multiple>-      </term>-      <term name="section">-         <single>قسم</single>-         <multiple>أقسام</multiple>-      </term>-      <term name="sub verbo">-         <single>sub verbo</single>-         <multiple>sub verbis</multiple>-      </term>-      <term name="verse">-         <single>بيت</single>-         <multiple>أبيات</multiple>-      </term>-      <term name="volume">-         <single>مجلد</single>-         <multiple>مجلدات</multiple>-      </term>--      <!-- SHORT LOCATOR FORMS -->-      <term name="book" form="short">ك</term>-      <term name="chapter" form="short">ف</term>-      <term name="column" form="short">عم</term>-      <term name="figure" form="short">ر</term>-      <term name="folio" form="short">و</term>-      <term name="issue" form="short">عد</term>-      <term name="opus" form="short">مم</term>-      <term name="page" form="short">-         <single>ص</single>-         <multiple>ص.ص</multiple>-      </term>-      <term name="paragraph" form="short">فق</term>-      <term name="part" form="short">جز</term>-      <term name="section" form="short">ق</term>-      <term name="sub verbo" form="short">-         <single>s.v.</single>-         <multiple>s.vv.</multiple>-      </term>-      <term name="verse" form="short">-         <single>ب</single>-         <multiple>بب</multiple>-      </term>-      <term name="volume" form="short">-         <single>مج</single>-         <multiple>مجج</multiple>-      </term>--      <!-- SYMBOL LOCATOR FORMS -->-      <term name="paragraph" form="symbol">-         <single>¶</single>-         <multiple>¶¶</multiple>-      </term>-      <term name="section" form="symbol">-         <single>§</single>-         <multiple>§§</multiple>-      </term>--      <!-- LONG ROLE FORMS -->-      <term name="author">-         <single/>-         <multiple/>-      </term>-      <term name="editor">-         <single>تحرير</single>-         <multiple>تحرير</multiple>-      </term>-      <term name="editorial-director">-         <single>editor</single>-         <multiple>editors</multiple>-      </term>-      <term name="translator">-         <single>ترجمة</single>-         <multiple>ترجمة</multiple>-      </term>-      <term name="editortranslator">-         <single>editor &amp; translator</single>-         <multiple>editors &amp; translators</multiple>-      </term>--      <!-- SHORT ROLE FORMS -->-      <term name="author" form="short">-         <single/>-         <multiple/>-      </term>-      <term name="editor" form="short">-         <single>مح</single>-         <multiple>محح</multiple>-      </term>-      <term name="editorial-director" form="short">-         <single>ed.</single>-         <multiple>eds.</multiple>-      </term>-      <term name="translator" form="short">-         <single>تر</single>-         <multiple>ترر</multiple>-      </term>-      <term name="editortranslator" form="short">-         <single>ed. &amp; tran.</single>-         <multiple>eds. &amp; trans.</multiple>-      </term>--      <!-- VERB ROLE FORMS -->-      <term name="editor" form="verb">حرره</term>-      <term name="editorial-director" form="verb">edited by</term>-      <term name="translator" form="verb">ترجمه</term>-      <term name="editortranslator" form="verb">edited &amp; translated by</term>-      <term name="recipient" form="verb">إلى</term>-      <term name="interviewer" form="verb">مقابلة بواسطة</term>--      <!-- SHORT VERB ROLE FORMS -->-      <term name="container-author" form="verb-short">by</term>-      <term name="editor" form="verb-short">مح</term>-      <term name="editorial-director" form="verb-short">ed.</term>-      <term name="translator" form="verb-short">مت</term>-      <term name="editortranslator" form="verb-short">ed. &amp; trans. by</term>--      <!-- LONG MONTH FORMS -->-      <term name="month-01">يناير</term>-      <term name="month-02">فبراير</term>-      <term name="month-03">مارس</term>-      <term name="month-04">ابريل</term>-      <term name="month-05">مايو</term>-      <term name="month-06">يونيو</term>-      <term name="month-07">يوليو</term>-      <term name="month-08">اغسطس</term>-      <term name="month-09">سبتمبر</term>-      <term name="month-10">اكتوبر</term>-      <term name="month-11">نوفمبر</term>-      <term name="month-12">ديسمبر</term>--      <!-- SHORT MONTH FORMS -->-      <term name="month-01" form="short">يناير</term>-      <term name="month-02" form="short">فبراير</term>-      <term name="month-03" form="short">مارس</term>-      <term name="month-04" form="short">ابريل</term>-      <term name="month-05" form="short">مايو</term>-      <term name="month-06" form="short">يونيو</term>-      <term name="month-07" form="short">يوليو</term>-      <term name="month-08" form="short">اغسطس</term>-      <term name="month-09" form="short">سبتمبر</term>-      <term name="month-10" form="short">اكتوبر</term>-      <term name="month-11" form="short">نوفمبر</term>-      <term name="month-12" form="short">ديسمبر</term>--      <!-- SEASONS -->-      <term name="season-01">Spring</term>-      <term name="season-02">Summer</term>-      <term name="season-03">Autumn</term>-      <term name="season-04">Winter</term>-   </terms>-</locale>+<?xml version="1.0" encoding="UTF-8"?>
+<locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="ar">
+  <style-options punctuation-in-quote="false"/>
+  <date form="text">
+    <date-part name="day" suffix=" "/>
+    <date-part name="month" suffix=", "/>
+    <date-part name="year"/>
+  </date>
+  <date form="numeric">
+    <date-part name="day" suffix="/"/>
+    <date-part name="month" form="numeric" suffix="/"/>
+    <date-part name="year"/>
+  </date>
+  <terms>
+    <term name="accessed">قدمه</term>
+    <term name="and">و</term>
+    <term name="and others">وآخرون</term>
+    <term name="anonymous">مجهول</term>
+    <term name="anonymous" form="short">مجهول</term>
+    <term name="at">عند</term>
+    <term name="by">عن طريق</term>
+    <term name="circa">حوالي</term>
+    <term name="circa" form="short">حو.</term>
+    <term name="cited">وثِّقَ</term>
+    <term name="edition">
+      <single>الطبعة</single>
+      <multiple>الطبعات</multiple>
+    </term>
+    <term name="edition" form="short">ط.</term>
+    <term name="et-al">واخ.</term>
+    <term name="forthcoming">القادم</term>
+    <term name="from">من</term>
+    <term name="ibid">المرجع السابق</term>
+    <term name="in">في</term>
+    <term name="in press">قيد النشر</term>
+    <term name="internet">الإنترنت</term>
+    <term name="interview">مقابلة</term>
+    <term name="letter">خطاب</term>
+    <term name="no date">دون تاريخ</term>
+    <term name="no date" form="short">د.ت</term>
+    <term name="online">الخط المباشر</term>
+    <term name="presented at">قُدَّم في</term>
+    <term name="reference">
+      <single>مرجع</single>
+      <multiple>مراجع</multiple>
+    </term>
+    <term name="reference" form="short">
+      <single>مرجع</single>
+      <multiple>مراجع</multiple>
+    </term>
+    <term name="retrieved">استرجع</term>
+    <!-- ANNO DOMINI; BEFORE CHRIST -->
+    <term name="ad">بعد الميلاد</term>
+    <term name="bc">قبل الميلاد</term>
+    <!-- QUOTES -->
+	<!-- Source: http://www.w3.org/International/tutorials/bidi-xhtml/ -->
+    <!-- Use of single straight quote for inner is a guess -->
+    <term name="open-quote">"</term>
+    <term name="close-quote">"</term>
+    <term name="open-inner-quote">'</term>
+    <term name="close-inner-quote">'</term>
+    <!-- ORDINALS st., nd., rd.-->
+    <term name="ordinal-01"/>
+    <term name="ordinal-02"/>
+    <term name="ordinal-03"/>
+    <term name="ordinal-04"/>
+    <!-- LONG ORDINALS -->
+    <term name="long-ordinal-01">الاول</term>
+    <term name="long-ordinal-02">الثاني</term>
+    <term name="long-ordinal-03">الثالث</term>
+    <term name="long-ordinal-04">الرابع</term>
+    <term name="long-ordinal-05">الخامس</term>
+    <term name="long-ordinal-06">السادس</term>
+    <term name="long-ordinal-07">السابع</term>
+    <term name="long-ordinal-08">الثامن</term>
+    <term name="long-ordinal-09">التاسع</term>
+    <term name="long-ordinal-10">العاشر</term>
+    <!-- CATEGORIES -->
+    <term name="anthropology">علم الأعراق البشرية</term>
+    <term name="astronomy">الفلك</term>
+    <term name="biology">الأحياء</term>
+    <term name="botany">النبات</term>
+    <term name="chemistry">الكيمياء</term>
+    <term name="engineering">الهندسة</term>
+    <term name="generic-base">العلوم العامة</term>
+    <term name="geography">الجغرافيا</term>
+    <term name="geology">الجيولوجيا</term>
+    <term name="history">التاريخ</term>
+    <term name="humanities">الإنسانيات</term>
+    <term name="linguistics">اللغويات</term>
+    <term name="literature">الأدب</term>
+    <term name="math">الرياضيات</term>
+    <term name="medicine">الطب</term>
+    <term name="philosophy">الفلسفة</term>
+    <term name="physics">الفيزياء</term>
+    <term name="psychology">علم النفس</term>
+    <term name="sociology">علم الإجتماع</term>
+    <term name="science">العلوم البحتة</term>
+    <term name="political_science">العلوم السياسية</term>
+    <term name="social_science">العلوم الإجتماعية</term>
+    <term name="theology">الإلهيات</term>
+    <term name="zoology">علم الحيوان</term>
+    <!-- LONG LOCATOR FORMS -->
+    <term name="book">
+      <single>كتاب</single>
+      <multiple>كُتُب</multiple>
+    </term>
+    <term name="chapter">
+      <single>فصل</single>
+      <multiple>فصول</multiple>
+    </term>
+    <term name="column">
+      <single>عمود</single>
+      <multiple>أعمدة</multiple>
+    </term>
+    <term name="figure">
+      <single>رسم توضيحي</single>
+      <multiple>رسوم توضيحية</multiple>
+    </term>
+    <term name="folio">
+      <single>ورقة</single>
+      <multiple>أوراق</multiple>
+    </term>
+    <term name="issue">
+      <single>عدد</single>
+      <multiple>أعداد</multiple>
+    </term>
+    <term name="line">
+      <single>سطر</single>
+      <multiple>أسطر</multiple>
+    </term>
+    <term name="note">
+      <single>ملاحظة</single>
+      <multiple>ملاحظات</multiple>
+    </term>
+    <term name="opus">
+      <single>نوته موسيقية</single>
+      <multiple>نوتات موسيقية</multiple>
+    </term>
+    <term name="page">
+      <single>صفحة</single>
+      <multiple>صفحات</multiple>
+    </term>
+    <term name="paragraph">
+      <single>فقرة</single>
+      <multiple>فقرات</multiple>
+    </term>
+    <term name="part">
+      <single>جزء</single>
+      <multiple>أجزاء</multiple>
+    </term>
+    <term name="section">
+      <single>قسم</single>
+      <multiple>أقسام</multiple>
+    </term>
+    <term name="sub verbo">
+      <single>تفسير فرعي</single>
+      <multiple>تفسيرات فرعية</multiple>
+    </term>
+    <term name="verse">
+      <single>بيت شعر</single>
+      <multiple>أبيات شعرية</multiple>
+    </term>
+    <term name="volume">
+      <single>مجلد</single>
+      <multiple>مجلدات</multiple>
+    </term>
+    <!-- SHORT LOCATOR FORMS -->
+    <term name="book" form="short">كتاب</term>
+    <term name="chapter" form="short">فصل</term>
+    <term name="column" form="short">عمود</term>
+    <term name="figure" form="short">رسم توضيحي</term>
+    <term name="folio" form="short">مطوية</term>
+    <term name="issue" form="short">عدد</term>
+    <term name="opus" form="short">نوتة موسيقية</term>
+    <term name="page" form="short">
+      <single>ص</single>
+      <multiple>ص.ص.</multiple>
+    </term>
+    <term name="paragraph" form="short">فقرة</term>
+    <term name="part" form="short">ج.</term>
+    <term name="section" form="short">قسم</term>
+    <term name="sub verbo" form="short">
+      <single>تفسير فرعي</single>
+      <multiple>تفسيرات فرعية</multiple>
+    </term>
+    <term name="verse" form="short">
+      <single>بيت شعر</single>
+      <multiple>ابيات شعرية</multiple>
+    </term>
+    <term name="volume" form="short">
+      <single>مج.</single>
+      <multiple>مج.</multiple>
+    </term>
+    <!-- SYMBOL LOCATOR FORMS -->
+    <term name="paragraph" form="symbol">
+      <single>¶</single>
+      <multiple>¶¶</multiple>
+    </term>
+    <term name="section" form="symbol">
+      <single>§</single>
+      <multiple>§§</multiple>
+    </term>
+    <!-- LONG ROLE FORMS -->
+    <term name="author">
+      <single>مؤلف</single>
+      <multiple>مؤلفين</multiple>
+    </term>
+    <term name="editor">
+      <single>محرر</single>
+      <multiple>محررين</multiple>
+    </term>
+    <term name="editorial-director">
+      <single>رئيس التحرير</single>
+      <multiple>رؤساء التحرير</multiple>
+    </term>
+    <term name="translator">
+      <single>مترجم</single>
+      <multiple>مترجمين</multiple>
+    </term>
+    <term name="editortranslator">
+      <single>مترجم ومحرر</single>
+      <multiple>مترجمين ومحررين</multiple>
+    </term>
+    <!-- SHORT ROLE FORMS -->
+    <term name="author" form="short">
+      <single>مؤلف</single>
+      <multiple>مؤلف</multiple>
+    </term>
+    <term name="editor" form="short">
+      <single>محرر</single>
+      <multiple>محرر</multiple>
+    </term>
+    <term name="editorial-director" form="short">
+      <single>مشرف على الطبعة</single>
+      <multiple>مشرفين على الطبعة</multiple>
+    </term>
+    <term name="translator" form="short">
+      <single>مترجم</single>
+      <multiple>مترجمين</multiple>
+    </term>
+    <term name="editortranslator" form="short">
+      <single>مترجم ومشرف على الطباعه</single>
+      <multiple>مترجمين ومشرفين على الطباعه</multiple>
+    </term>
+    <!-- VERB ROLE FORMS -->
+    <term name="editor" form="verb">تحرير</term>
+    <term name="editorial-director" form="verb">اعداد</term>
+    <term name="translator" form="verb">ترجمة</term>
+    <term name="editortranslator" form="verb">اعداد وترجمة</term>
+    <term name="recipient" form="verb">إلى</term>
+    <term name="interviewer" form="verb">مقابلة بواسطة</term>
+    <!-- SHORT VERB ROLE FORMS -->
+    <term name="container-author" form="verb-short">by</term>
+    <term name="editor" form="verb-short">تحرير</term>
+    <term name="editorial-director" form="verb-short">اشرف على الطبعة</term>
+    <term name="translator" form="verb-short">ترجمة</term>
+    <term name="editortranslator" form="verb-short">ترجمه واشرف على الطباعه</term>
+    <!-- LONG MONTH FORMS -->
+    <term name="month-01">يناير</term>
+    <term name="month-02">فبراير</term>
+    <term name="month-03">مارس</term>
+    <term name="month-04">ابريل</term>
+    <term name="month-05">مايو</term>
+    <term name="month-06">يونيو</term>
+    <term name="month-07">يوليو</term>
+    <term name="month-08">اغسطس</term>
+    <term name="month-09">سبتمبر</term>
+    <term name="month-10">اكتوبر</term>
+    <term name="month-11">نوفمبر</term>
+    <term name="month-12">ديسمبر</term>
+    <!-- SHORT MONTH FORMS -->
+    <term name="month-01" form="short">يناير</term>
+    <term name="month-02" form="short">فبراير</term>
+    <term name="month-03" form="short">مارس</term>
+    <term name="month-04" form="short">ابريل</term>
+    <term name="month-05" form="short">مايو</term>
+    <term name="month-06" form="short">يونيو</term>
+    <term name="month-07" form="short">يوليو</term>
+    <term name="month-08" form="short">اغسطس</term>
+    <term name="month-09" form="short">سبتمبر</term>
+    <term name="month-10" form="short">اكتوبر</term>
+    <term name="month-11" form="short">نوفمبر</term>
+    <term name="month-12" form="short">ديسمبر</term>
+    <!-- SEASONS -->
+    <term name="season-01">الربيع</term>
+    <term name="season-02">الصيف</term>
+    <term name="season-03">الخريف</term>
+    <term name="season-04">الشتاء</term>
+  </terms>
+</locale>
locales/locales-bg-BG.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>+      <term name="close-quote">“</term>+      <term name="open-inner-quote">„</term>+      <term name="close-inner-quote">“</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-ca-AD.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>+      <term name="open-inner-quote">“</term>+      <term name="close-inner-quote">”</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-cs-CZ.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>+      <term name="close-quote">“</term>+      <term name="open-inner-quote">‚</term>+      <term name="close-inner-quote">‘</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-da-DK.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">»</term>+      <term name="close-quote">«</term>+      <term name="open-inner-quote">›</term>+      <term name="close-inner-quote">‹</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-de-AT.xml view
@@ -55,10 +55,12 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>+      <term name="close-quote">“</term>+      <term name="open-inner-quote">‚</term>+      <term name="close-inner-quote">‘</term>+        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-de-CH.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>+      <term name="open-inner-quote">‹</term>+      <term name="close-inner-quote">›</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-de-DE.xml view
@@ -55,16 +55,16 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+      <term name="open-quote">„</term>+      <term name="close-quote">“</term>+      <term name="open-inner-quote">‚</term>+      <term name="close-inner-quote">‘</term>        <!-- ORDINALS -->-      <term name="ordinal-01">st</term>-      <term name="ordinal-02">nd</term>-      <term name="ordinal-03">rd</term>-      <term name="ordinal-04">th</term>+      <term name="ordinal-01">.</term>+      <term name="ordinal-02">.</term>+      <term name="ordinal-03">.</term>+      <term name="ordinal-04">.</term>        <!-- LONG ORDINALS -->       <term name="long-ordinal-01">first</term>
locales/locales-el-GR.xml view
@@ -16,17 +16,17 @@       <term name="and">και</term>       <term name="and others">και άλλοι</term>       <term name="anonymous">ανώνυμο</term>-      <term name="anonymous" form="short">ανών</term>-      <term name="at">εφ</term>-      <term name="by">του</term>+      <term name="anonymous" form="short">ανών.</term>+      <term name="at">εφ.</term>+      <term name="by">από</term>       <term name="circa">περίπου</term>-      <term name="circa" form="short">περ</term>-      <term name="cited">παρατίθεται στο</term>+      <term name="circa" form="short">περ.</term>+      <term name="cited">παρατίθεται</term>       <term name="edition">-         <single>έκδοση</single>-         <multiple>εκδόσεις</multiple>+        <single>έκδοση</single>+        <multiple>εκδόσεις</multiple>       </term>-      <term name="edition" form="short">έκδ</term>+      <term name="edition" form="short">έκδ.</term>       <term name="et-al">κ.ά.</term>       <term name="forthcoming">προσεχές</term>       <term name="from">από</term>@@ -41,12 +41,12 @@       <term name="online">έκδοση σε ψηφιακή μορφή</term>       <term name="presented at">παρουσιάστηκε στο</term>       <term name="reference">-         <single>αναφορά</single>-         <multiple>αναφορές</multiple>+        <single>παραπομπή</single>+        <multiple>παραπομπές</multiple>       </term>       <term name="reference" form="short">-         <single>αναφ.</single>-         <multiple>αναφ.</multiple>+        <single>παρ.</single>+        <multiple>παρ.</multiple>       </term>       <term name="retrieved">ανακτήθηκε</term> @@ -55,10 +55,12 @@       <term name="bc">π.Χ.</term>        <!-- QUOTES -->-      <term name="open-quote">«</term>-      <term name="close-quote">»</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks differs,+           but the characters below are directly from a Greek-speaking style author -->+      <term name="open-quote">‘</term>+      <term name="close-quote">’</term>+      <term name="open-inner-quote">'</term>+      <term name="close-inner-quote">'</term>        <!-- ORDINALS -->       <term name="ordinal-01">ος</term>@@ -85,7 +87,7 @@     <term name="botany">βοτανική</term>     <term name="chemistry">χημεία</term>     <term name="engineering">μηχανική</term>-    <term name="generic-base">γενική βάση</term>+    <term name="generic-base">γενική βιβλιογραφία</term>     <term name="geography">γεωγραφία</term>     <term name="geology">γεωλογία</term>     <term name="history">ιστορία</term>@@ -170,31 +172,31 @@       </term>        <!-- SHORT LOCATOR FORMS -->-      <term name="book" form="short">βιβ</term>-      <term name="chapter" form="short">κεφ</term>-      <term name="column" form="short">στ</term>-      <term name="figure" form="short">εικ</term>-      <term name="folio" form="short">φακ</term>-      <term name="issue" form="short">τχ</term>-      <term name="opus" form="short">έργ</term>+      <term name="book" form="short">βιβ.</term>+      <term name="chapter" form="short">κεφ.</term>+      <term name="column" form="short">στ.</term>+      <term name="figure" form="short">εικ.</term>+      <term name="folio" form="short">φάκ</term>+      <term name="issue" form="short">τχ.</term>+      <term name="opus" form="short">έργ.</term>       <term name="page" form="short">          <single>σ</single>          <multiple>σσ</multiple>       </term>-      <term name="paragraph" form="short">παρ</term>-      <term name="part" form="short">μερ</term>-      <term name="section" form="short">τμ</term>+      <term name="paragraph" form="short">παρ.</term>+      <term name="part" form="short">μέρ.</term>+      <term name="section" form="short">τμ.</term>       <term name="sub verbo" form="short">-         <single>λήμ</single>-         <multiple>λήμ</multiple>+         <single>λήμ.</single>+         <multiple>λήμ.</multiple>       </term>       <term name="verse" form="short">-         <single>στ</single>-         <multiple>στ</multiple>+         <single>στ.</single>+         <multiple>στ.</multiple>       </term>       <term name="volume" form="short">-         <single>τμ</single>-         <multiple>τμ</multiple>+         <single>τ.</single>+         <multiple>τ.</multiple>       </term>        <!-- SYMBOL LOCATOR FORMS -->@@ -209,63 +211,63 @@        <!-- LONG ROLE FORMS -->       <term name="author">-         <single/>-         <multiple/>+      <single>συγγραφέας</single>+        <multiple>συγγραφείς</multiple>       </term>       <term name="editor">          <single>επιμελητής</single>          <multiple>επιμελητές</multiple>       </term>       <term name="editorial-director">-         <single>γενική εποπτεία</single>-         <multiple>γενική εποπτεία</multiple>+     	<single>διευθυντής σειράς</single>+        <multiple>διευθυντές σειράς</multiple>       </term>       <term name="translator">          <single>μεταφραστής</single>          <multiple>μεταφραστές</multiple>       </term>       <term name="editortranslator">-         <single>μετάφραση και επιμέλεια</single>-         <multiple>μετάφραση και επιμέλεια</multiple>+         <single>μεταφραστής και επιμελητής</single>+         <multiple>μεταφραστές και επιμελητές</multiple>       </term>        <!-- SHORT ROLE FORMS -->       <term name="author" form="short">-         <single/>-         <multiple/>+        <single>συγγρ.</single>+         <multiple>συγγρ.</multiple>       </term>       <term name="editor" form="short">-         <single>επιμ</single>-         <multiple>επιμ</multiple>+         <single>επιμ.</single>+         <multiple>επιμ.</multiple>       </term>       <term name="editorial-director" form="short">-         <single>γεν. επ</single>-         <multiple>γεν. επ</multiple>+        <single>δ/ντής σειράς</single>+         <multiple>δ/ντές σειρας</multiple>       </term>       <term name="translator" form="short">          <single>μτφ.</single>          <multiple>μτφ.</multiple>       </term>       <term name="editortranslator" form="short">-         <single>μτφ. και επιμ</single>-         <multiple>μτφ. και επιμ</multiple>+         <single>μτφ. και επιμ.</single>+         <multiple>μτφ. και επιμ.</multiple>       </term>        <!-- VERB ROLE FORMS -->-      <term name="editor" form="verb">επιμ</term>-      <term name="editorial-director" form="verb">γεν επ</term>-      <term name="translator" form="verb">μτφ</term>-      <term name="editortranslator" form="verb">μτφ. και επιμ</term>-      <term name="recipient" form="verb">στο</term>+      <term name="editor" form="verb">επιμέλεια</term>+      <term name="editorial-director" form="verb">διεύθυνση σειράς</term>+      <term name="translator" form="verb">μετάφραση</term>+      <term name="editortranslator" form="verb">μετάφραση και επιμέλεια</term>+      <term name="recipient" form="verb">παραλήπτης</term>       <term name="interviewer" form="verb">συνέντευξη</term>        <!-- SHORT VERB ROLE FORMS -->-      <term name="container-author" form="verb-short">στο</term>-      <term name="editor" form="verb-short">επιμ</term>-      <term name="editorial-director" form="verb-short">γεν. επ</term>-      <term name="translator" form="verb-short">μτφ</term>-      <term name="editortranslator" form="verb-short">μτφ. και επιμ</term>-+      <term name="container-author" form="verb-short">στον συλλ. τόμο</term>+      <term name="editor" form="verb-short">επιμέλ.</term>+    <term name="editorial-director" form="verb-short">δ/νση σειράς</term>+      <term name="translator" form="verb-short">μετάφρ.</term>+      <term name="editortranslator" form="verb-short">μετάφρ. και επιμέλ.</term>+             <!-- LONG MONTH FORMS -->     <term name="month-01">Ιανουάριος</term>     <term name="month-02">Φεβρουάριος</term>
locales/locales-es-ES.xml view
@@ -55,16 +55,17 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>+      <term name="open-inner-quote">“</term>+      <term name="close-inner-quote">”</term>        <!-- ORDINALS -->-      <term name="ordinal-01">st</term>-      <term name="ordinal-02">nd</term>-      <term name="ordinal-03">rd</term>-      <term name="ordinal-04">th</term>+      <term name="ordinal-01">o</term>+      <term name="ordinal-02">o</term>+      <term name="ordinal-03">o</term>+      <term name="ordinal-04">o</term>        <!-- LONG ORDINALS -->       <term name="long-ordinal-01">first</term>
locales/locales-fr-FR.xml view
locales/locales-hu-HU.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>       <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+      <term name="open-inner-quote">»</term>+      <term name="close-inner-quote">«</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-is-IS.xml view
@@ -7,195 +7,196 @@       <date-part name="year"/>    </date>    <date form="numeric">-      <date-part name="day" form="numeric-leading-zeros" suffix="."/>-      <date-part name="month" form="numeric-leading-zeros" suffix="."/>+      <date-part name="day" suffix="."/>+      <date-part name="month" suffix="."/>       <date-part name="year"/>    </date>    <terms>-      <term name="accessed">accessed</term>-      <term name="and">and</term>-      <term name="and others">and others</term>-      <term name="anonymous">anonymous</term>-      <term name="anonymous" form="short">anon</term>-      <term name="at">at</term>-      <term name="by">by</term>-      <term name="circa">circa</term>-      <term name="circa" form="short">c.</term>-      <term name="cited">cited</term>+      <term name="accessed">opnað</term>+      <term name="and">og</term>+      <term name="and others">og fleiri</term>+      <term name="anonymous">nafnlaus</term>+      <term name="anonymous" form="short">nafnl.</term>+      <term name="at">af</term>+      <term name="by">eftir</term>+      <term name="circa">sirca</term>+      <term name="circa" form="short">u.þ.b.</term>+      <term name="cited">tilvitnun</term>       <term name="edition">-         <single>edition</single>-         <multiple>editions</multiple>+         <single>útgáfa</single>+         <multiple>útgáfur</multiple>       </term>-      <term name="edition" form="short">ed</term>-      <term name="et-al">et al.</term>-      <term name="forthcoming">forthcoming</term>-      <term name="from">from</term>+      <term name="edition" form="short">útg.</term>+      <term name="et-al">o.fl.</term>+      <term name="forthcoming">óbirt</term>+      <term name="from">af</term>       <term name="ibid">ibid.</term>-      <term name="in">in</term>-      <term name="in press">in press</term>+      <term name="in">í</term>+      <term name="in press">í prentun</term>       <term name="internet">internet</term>-      <term name="interview">interview</term>-      <term name="letter">letter</term>-      <term name="no date">no date</term>-      <term name="no date" form="short">nd</term>-      <term name="online">online</term>-      <term name="presented at">presented at the</term>+      <term name="interview">viðtal</term>+      <term name="letter">bréf</term>+      <term name="no date">engin dagsetning</term>+      <term name="no date" form="short">e.d.</term>+      <term name="online">rafrænt</term>+      <term name="presented at">flutt á</term>       <term name="reference">-         <single>reference</single>-         <multiple>references</multiple>+         <single>tilvitnun</single>+         <multiple>tilvitnanir</multiple>       </term>       <term name="reference" form="short">-         <single>ref.</single>-         <multiple>refs.</multiple>+         <single>tilv.</single>+         <multiple>tilv.</multiple>       </term>-      <term name="retrieved">retrieved</term>+      <term name="retrieved">sótt</term>        <!-- ANNO DOMINI; BEFORE CHRIST -->-      <term name="ad">AD</term>-      <term name="bc">BC</term>+      <term name="ad">e.Kr.</term>+      <term name="bc">f.Kr.</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>+      <term name="close-quote">“</term>+      <term name="open-inner-quote">‚</term>+      <term name="close-inner-quote">‘</term>        <!-- ORDINALS -->-      <term name="ordinal-01">st</term>-      <term name="ordinal-02">nd</term>-      <term name="ordinal-03">rd</term>-      <term name="ordinal-04">th</term>+      <term name="ordinal-01">.</term>+      <term name="ordinal-02">.</term>+      <term name="ordinal-03">.</term>+      <term name="ordinal-04">.</term>        <!-- LONG ORDINALS -->-      <term name="long-ordinal-01">first</term>-      <term name="long-ordinal-02">second</term>-      <term name="long-ordinal-03">third</term>-      <term name="long-ordinal-04">fourth</term>-      <term name="long-ordinal-05">fifth</term>-      <term name="long-ordinal-06">sixth</term>-      <term name="long-ordinal-07">seventh</term>-      <term name="long-ordinal-08">eighth</term>-      <term name="long-ordinal-09">ninth</term>-      <term name="long-ordinal-10">tenth</term>+      <term name="long-ordinal-01">fyrsti</term>+      <term name="long-ordinal-02">annar</term>+      <term name="long-ordinal-03">þriðji</term>+      <term name="long-ordinal-04">fjórði</term>+      <term name="long-ordinal-05">fimmti</term>+      <term name="long-ordinal-06">sjötti</term>+      <term name="long-ordinal-07">sjöundi</term>+      <term name="long-ordinal-08">áttundi</term>+      <term name="long-ordinal-09">níundi</term>+      <term name="long-ordinal-10">tíundi</term>        <!-- CATEGORIES -->-      <term name="anthropology">anthropology</term>-      <term name="astronomy">astronomy</term>-      <term name="biology">biology</term>-      <term name="botany">botany</term>-      <term name="chemistry">chemistry</term>-      <term name="engineering">engineering</term>+      <term name="anthropology">mannfræði</term>+      <term name="astronomy">stjörnufræði</term>+      <term name="biology">líffræði</term>+      <term name="botany">grasafræði</term>+      <term name="chemistry">efnafræði</term>+      <term name="engineering">verkfræði</term>       <term name="generic-base">generic base</term>-      <term name="geography">geography</term>-      <term name="geology">geology</term>-      <term name="history">history</term>-      <term name="humanities">humanities</term>-      <term name="linguistics">linguistics</term>-      <term name="literature">literature</term>-      <term name="math">math</term>-      <term name="medicine">medicine</term>-      <term name="philosophy">philosophy</term>-      <term name="physics">physics</term>-      <term name="psychology">psychology</term>-      <term name="sociology">sociology</term>-      <term name="science">science</term>-      <term name="political_science">political science</term>-      <term name="social_science">social science</term>-      <term name="theology">theology</term>-      <term name="zoology">zoology</term>+      <term name="geography">landafræði</term>+      <term name="geology">jarðfræði</term>+      <term name="history">saga</term>+      <term name="humanities">hugvísindi</term>+      <term name="linguistics">málvísindi</term>+      <term name="literature">bókmenntir</term>+      <term name="math">stærðfræði</term>+      <term name="medicine">læknisfræði</term>+      <term name="philosophy">heimspeki</term>+      <term name="physics">eðlisfræði</term>+      <term name="psychology">sálfræði</term>+      <term name="sociology">félagsfræði</term>+      <term name="science">vísindi</term>+      <term name="political_science">stjórnmálafræði</term>+      <term name="social_science">félagsvísindi</term>+      <term name="theology">guðfræði</term>+      <term name="zoology">dýrafræði</term>        <!-- LONG LOCATOR FORMS -->       <term name="book">-         <single>book</single>-         <multiple>books</multiple>+         <single>bók</single>+         <multiple>bækur</multiple>       </term>       <term name="chapter">-         <single>chapter</single>-         <multiple>chapters</multiple>+         <single>kafli</single>+         <multiple>kaflar</multiple>       </term>       <term name="column">-         <single>column</single>-         <multiple>columns</multiple>+         <single>dálkur</single>+         <multiple>dálkar</multiple>       </term>       <term name="figure">-         <single>figure</single>-         <multiple>figures</multiple>+         <single>mynd</single>+         <multiple>myndir</multiple>       </term>       <term name="folio">-         <single>folio</single>-         <multiple>folios</multiple>+         <single>handrit</single>+         <multiple>handrit</multiple>       </term>       <term name="issue">-         <single>number</single>-         <multiple>numbers</multiple>+         <single>númer</single>+         <multiple>númer</multiple>       </term>       <term name="line">-         <single>line</single>-         <multiple>line</multiple>+         <single>lína</single>+         <multiple>línur</multiple>       </term>       <term name="note">-         <single>note</single>-         <multiple>notes</multiple>+         <single>skilaboð</single>+         <multiple>skilaboð</multiple>       </term>       <term name="opus">-         <single>opus</single>-         <multiple>opera</multiple>+         <single>tónverk</single>+         <multiple>tónverk</multiple>       </term>       <term name="page">-         <single>page</single>-         <multiple>pages</multiple>+         <single>blaðsíða</single>+         <multiple>blaðsíður</multiple>       </term>       <term name="paragraph">-         <single>paragraph</single>-         <multiple>paragraph</multiple>+         <single>málsgrein</single>+         <multiple>málsgreinar</multiple>       </term>       <term name="part">-         <single>part</single>-         <multiple>parts</multiple>+         <single>hluti</single>+         <multiple>hlutar</multiple>       </term>       <term name="section">-         <single>section</single>-         <multiple>sections</multiple>+         <single>hluti</single>+         <multiple>hlutar</multiple>       </term>       <term name="sub verbo">          <single>sub verbo</single>          <multiple>sub verbis</multiple>       </term>       <term name="verse">-         <single>verse</single>-         <multiple>verses</multiple>+         <single>vers</single>+         <multiple>vers</multiple>       </term>       <term name="volume">-         <single>volume</single>-         <multiple>volumes</multiple>+         <single>útgáfa</single>+         <multiple>útgáfur</multiple>       </term>        <!-- SHORT LOCATOR FORMS -->-      <term name="book" form="short">bk</term>-      <term name="chapter" form="short">chap</term>-      <term name="column" form="short">col</term>-      <term name="figure" form="short">fig</term>-      <term name="folio" form="short">f</term>-      <term name="issue" form="short">no</term>-      <term name="opus" form="short">op</term>+      <term name="book" form="short">b.</term>+      <term name="chapter" form="short">k.</term>+      <term name="column" form="short">d.</term>+      <term name="figure" form="short">mynd.</term>+      <term name="folio" form="short">handr.</term>+      <term name="issue" form="short">nr.</term>+      <term name="opus" form="short">tónv.</term>       <term name="page" form="short">-         <single>p</single>-         <multiple>pp</multiple>+         <single>bls.</single>+         <multiple>bls.</multiple>       </term>-      <term name="paragraph" form="short">para</term>-      <term name="part" form="short">pt</term>-      <term name="section" form="short">sec</term>+      <term name="paragraph" form="short">málsgr.</term>+      <term name="part" form="short">hl.</term>+      <term name="section" form="short">hl.</term>       <term name="sub verbo" form="short">          <single>s.v.</single>          <multiple>s.vv.</multiple>       </term>       <term name="verse" form="short">-         <single>v</single>-         <multiple>vv</multiple>+         <single>v.</single>+         <multiple>v.</multiple>       </term>       <term name="volume" form="short">-         <single>vol</single>-         <multiple>vols</multiple>+         <single>útg.</single>+         <multiple>útg.</multiple>       </term>        <!-- SYMBOL LOCATOR FORMS -->@@ -210,95 +211,95 @@        <!-- LONG ROLE FORMS -->       <term name="author">-         <single/>-         <multiple/>+         <single>höfundur</single>+         <multiple>höfundar</multiple>       </term>       <term name="editor">-         <single>editor</single>-         <multiple>editors</multiple>+         <single>ritstjóri</single>+         <multiple>ritstjórar</multiple>       </term>       <term name="editorial-director">-         <single>editor</single>-         <multiple>editors</multiple>+         <single>ritstjóri</single>+         <multiple>ritstjórar</multiple>       </term>       <term name="translator">-         <single>translator</single>-         <multiple>translators</multiple>+         <single>þýðandi</single>+         <multiple>þýðendur</multiple>       </term>       <term name="editortranslator">-         <single>editor &amp; translator</single>-         <multiple>editors &amp; translators</multiple>+        <single>ritstjóri og þýðandi</single>+        <multiple>ritstjórar og þýðendur</multiple>       </term>        <!-- SHORT ROLE FORMS -->       <term name="author" form="short">-         <single/>-         <multiple/>+         <single>höf.</single>+         <multiple>höf.</multiple>       </term>       <term name="editor" form="short">-         <single>ed</single>-         <multiple>eds</multiple>+         <single>ritstj.</single>+         <multiple>ritstj.</multiple>       </term>       <term name="editorial-director" form="short">-         <single>ed.</single>-         <multiple>eds.</multiple>+         <single>ritstj.</single>+         <multiple>ritstj.</multiple>       </term>       <term name="translator" form="short">-         <single>tran</single>-         <multiple>trans</multiple>+         <single>þýð.</single>+         <multiple>þýð.</multiple>       </term>       <term name="editortranslator" form="short">-         <single>ed. &amp; tran.</single>-         <multiple>eds. &amp; trans.</multiple>+        <single>ritstj. og þýð.</single>+        <multiple>ritstj. og þýð.</multiple>       </term>        <!-- VERB ROLE FORMS -->-      <term name="editor" form="verb">edited by</term>-      <term name="editorial-director" form="verb">edited by</term>-      <term name="translator" form="verb">translated by</term>-      <term name="editortranslator" form="verb">edited &amp; translated by</term>-      <term name="recipient" form="verb">to</term>-      <term name="interviewer" form="verb">interview by</term>+      <term name="editor" form="verb">ritstýrt af</term>+      <term name="editorial-director" form="verb">ritstýrt af</term>+      <term name="translator" form="verb">þýtt af</term>+      <term name="editortranslator" form="verb">ritstýrt og þýtt af</term>+      <term name="recipient" form="verb">til</term>+      <term name="interviewer" form="verb">viðtal tekið af</term>        <!-- SHORT VERB ROLE FORMS -->-      <term name="container-author" form="verb-short">by</term>-      <term name="editor" form="verb-short">ed</term>-      <term name="editorial-director" form="verb-short">ed.</term>-      <term name="translator" form="verb-short">trans</term>-      <term name="editortranslator" form="verb-short">ed. &amp; trans. by</term>+      <term name="container-author" form="verb-short">eftir</term>+      <term name="editor" form="verb-short">ritst.</term>+      <term name="editorial-director" form="verb-short">ritst.</term>+      <term name="translator" form="verb-short">þýtt</term>+      <term name="editortranslator" form="verb-short">ritstýrt og þýtt af</term>        <!-- LONG MONTH FORMS -->-      <term name="month-01">January</term>-      <term name="month-02">February</term>-      <term name="month-03">March</term>-      <term name="month-04">April</term>-      <term name="month-05">May</term>-      <term name="month-06">June</term>-      <term name="month-07">July</term>-      <term name="month-08">August</term>-      <term name="month-09">September</term>-      <term name="month-10">October</term>-      <term name="month-11">November</term>-      <term name="month-12">December</term>+      <term name="month-01">janúar</term>+      <term name="month-02">febrúar</term>+      <term name="month-03">mars</term>+      <term name="month-04">apríl</term>+      <term name="month-05">maí</term>+      <term name="month-06">júní</term>+      <term name="month-07">júlí</term>+      <term name="month-08">ágúst</term>+      <term name="month-09">september</term>+      <term name="month-10">október</term>+      <term name="month-11">nóvember</term>+      <term name="month-12">desember</term>        <!-- SHORT MONTH FORMS -->-      <term name="month-01" form="short">Jan</term>-      <term name="month-02" form="short">Feb</term>-      <term name="month-03" form="short">Mar</term>-      <term name="month-04" form="short">Apr</term>-      <term name="month-05" form="short">May</term>-      <term name="month-06" form="short">Jun</term>-      <term name="month-07" form="short">Jul</term>-      <term name="month-08" form="short">Aug</term>-      <term name="month-09" form="short">Sep</term>-      <term name="month-10" form="short">Oct</term>-      <term name="month-11" form="short">Nov</term>-      <term name="month-12" form="short">Dec</term>+      <term name="month-01" form="short">jan.</term>+      <term name="month-02" form="short">feb.</term>+      <term name="month-03" form="short">mar.</term>+      <term name="month-04" form="short">apr.</term>+      <term name="month-05" form="short">mai</term>+      <term name="month-06" form="short">jún.</term>+      <term name="month-07" form="short">júl.</term>+      <term name="month-08" form="short">ágú.</term>+      <term name="month-09" form="short">sep.</term>+      <term name="month-10" form="short">okt.</term>+      <term name="month-11" form="short">nóv.</term>+      <term name="month-12" form="short">des.</term>        <!-- SEASONS -->-      <term name="season-01">Spring</term>-      <term name="season-02">Summer</term>-      <term name="season-03">Autumn</term>-      <term name="season-04">Winter</term>+      <term name="season-01">vor</term>+      <term name="season-02">sumar</term>+      <term name="season-03">haust</term>+      <term name="season-04">vetur</term>    </terms> </locale>
locales/locales-it-IT.xml view
@@ -55,8 +55,9 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>       <term name="open-inner-quote">‘</term>       <term name="close-inner-quote">’</term> 
locales/locales-ja-JP.xml view
@@ -3,13 +3,13 @@    <style-options punctuation-in-quote="false"/>    <date form="text">       <date-part name="year" suffix="&#24180;"/>-      <date-part name="month" form="numeric" prefix=" " suffix="&#26376;"/>-      <date-part name="day" prefix=" " suffix="&#26085;"/>+      <date-part name="month" form="numeric" suffix="&#26376;"/>+      <date-part name="day" suffix="&#26085;"/>    </date>    <date form="numeric">       <date-part name="year" suffix="&#24180;"/>-      <date-part name="month" form="numeric" prefix=" " suffix="&#26376;"/>-      <date-part name="day" prefix=" " suffix="&#26085;"/>+      <date-part name="month" form="numeric" suffix="&#26376;"/>+      <date-part name="day" suffix="&#26085;"/>    </date>    <terms>       <term name="accessed">アクセス</term>@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">「</term>+      <term name="close-quote">」</term>+      <term name="open-inner-quote">『</term>+      <term name="close-inner-quote">』</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
− locales/locales-kh-KH.xml
@@ -1,303 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>
-<locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="kh">
-   <style-options punctuation-in-quote="false"/>
-   <date form="text">
-      <date-part name="day" form="numeric" suffix="&#8203;"/>
-      <date-part name="month" suffix="&#8203;"/>
-      <date-part name="year"/>
-   </date>
-   <date form="numeric">
-      <date-part name="day" form="numeric-leading-zeros" suffix="/"/>
-      <date-part name="month" form="numeric-leading-zeros" suffix="/"/>
-      <date-part name="year"/>
-   </date>
-   <terms>
-      <term name="accessed">accessed</term>
-      <term name="and">and</term>
-      <term name="and others">and others</term>
-      <term name="anonymous">anonymous</term>
-      <term name="anonymous" form="short">anon.</term>
-      <term name="at">at</term>
-      <term name="by">by</term>
-      <term name="circa">circa</term>
-      <term name="circa" form="short">c.</term>
-      <term name="cited">cited</term>
-      <term name="edition">
-         <single>edition</single>
-         <multiple>editions</multiple>
-      </term>
-      <term name="edition" form="short">ed.</term>
-      <term name="et-al">et al.</term>
-      <term name="forthcoming">forthcoming</term>
-      <term name="from">from</term>
-      <term name="ibid">ibid</term>
-      <term name="in">in</term>
-      <term name="in press">in press</term>
-      <term name="internet">internet</term>
-      <term name="interview">interview</term>
-      <term name="letter">letter</term>
-      <term name="no date">no date</term>
-      <term name="no date" form="short">n.d.</term>
-      <term name="online">online</term>
-      <term name="presented at">presented at the</term>
-      <term name="reference">
-         <single>reference</single>
-         <multiple>references</multiple>
-      </term>
-      <term name="reference" form="short">
-         <single>ref.</single>
-         <multiple>refs.</multiple>
-      </term>
-      <term name="retrieved">retrieved</term>
-
-      <!-- ANNO DOMINI; BEFORE CHRIST -->
-      <term name="ad">AD</term>
-      <term name="bc">BC</term>
-
-      <!-- QUOTES -->
-      <term name="open-quote">“</term>
-      <term name="close-quote">”</term>
-      <term name="open-inner-quote">‘</term>
-      <term name="close-inner-quote">’</term>
-
-      <!-- ORDINALS -->
-      <term name="ordinal-01">st</term>
-      <term name="ordinal-02">nd</term>
-      <term name="ordinal-03">rd</term>
-      <term name="ordinal-04">th</term>
-
-      <!-- LONG ORDINALS -->
-      <term name="long-ordinal-01">ទីមួយ</term>
-      <term name="long-ordinal-02">ទីពីរ</term>
-      <term name="long-ordinal-03">ទីបី</term>
-      <term name="long-ordinal-04">ទីបួន</term>
-      <term name="long-ordinal-05">ទីប្រាំ</term>
-      <term name="long-ordinal-06">ទីប្រាំមួយ</term>
-      <term name="long-ordinal-07">ទីប្រាំពីរ</term>
-      <term name="long-ordinal-08">ទីប្រាំបី</term>
-      <term name="long-ordinal-09">ទីប្រាំបួន</term>
-      <term name="long-ordinal-10">ទីដប់មួយ</term>
-
-      <!-- CATEGORIES -->
-      <term name="anthropology">នរវិទ្យា</term>
-      <term name="astronomy">តារាវិទ្យា</term>
-      <term name="biology">ជីវវិទ្យា</term>
-      <term name="botany">រុក្ខវិទ្យា</term>
-      <term name="chemistry">គីមីវិទ្យា</term>
-      <term name="engineering">វិស្វកម្ម</term>
-      <term name="generic-base">generic base</term>
-      <term name="geography">ភូមិវិទ្យា</term>
-      <term name="geology">ភូគព្ភវិទ្យា</term>
-      <term name="history">ប្រវត្តិវិទ្យា</term>
-      <term name="humanities">មនុស្សវិទ្យា</term>
-      <term name="linguistics">ភាសាវិទ្យា</term>
-      <term name="literature">អក្សរសាស្ត្រ</term>
-      <term name="math">គណិតវិទ្យា</term>
-      <term name="medicine">វេជ្ជសាស្ត្រ</term>
-      <term name="philosophy">ទស្សនវិទ្យា</term>
-      <term name="physics">រូបវិទ្យា</term>
-      <term name="psychology">ចិត្តវិទ្យា</term>
-      <term name="sociology">សង្គមវិទ្យា</term>
-      <term name="science">វិទ្យាសាស្ត្រ</term>
-      <term name="political_science">វិទ្យាសាស្ត្រនយោបាយ</term>
-      <term name="social_science">សង្គមវិទ្យា</term>
-      <term name="theology">ទេវវិទ្យា</term>
-      <term name="zoology">សត្តវិទ្យា</term>
-
-      <!-- LONG LOCATOR FORMS -->
-      <term name="book">
-         <single>សៀវភៅ</single>
-         <multiple>សៀវភៅ</multiple>
-      </term>
-      <term name="chapter">
-         <single>ជំពូក</single>
-         <multiple>ជំពូក</multiple>
-      </term>
-      <term name="column">
-         <single>កាឡោន</single>
-         <multiple>កាឡោន</multiple>
-      </term>
-      <term name="figure">
-         <single>តួលេខ</single>
-         <multiple>តួលេខ</multiple>
-      </term>
-      <term name="folio">
-         <single>folio</single>
-         <multiple>folios</multiple>
-      </term>
-      <term name="issue">
-         <single>ចំនួន</single>
-         <multiple>ចំនួន</multiple>
-      </term>
-      <term name="line">
-         <single>បន្ទាត់</single>
-         <multiple>បន្ទាត់</multiple>
-      </term>
-      <term name="note">
-         <single>កំណត់ចំណាំ</single>
-         <multiple>កំណត់ចំណាំ</multiple>
-      </term>
-      <term name="opus">
-         <single>opus</single>
-         <multiple>opera</multiple>
-      </term>
-      <term name="page">
-         <single>ទំព័រ</single>
-         <multiple>ទំព័រ</multiple>
-      </term>
-      <term name="paragraph">
-         <single>កថាខណ្ឌ</single>
-         <multiple>កថាខណ្ឌ</multiple>
-      </term>
-      <term name="part">
-         <single>ជំពូក</single>
-         <multiple>ជំពូក</multiple>
-      </term>
-      <term name="section">
-         <single>ផ្នែក</single>
-         <multiple>ផ្នែក</multiple>
-      </term>
-      <term name="sub verbo">
-         <single>sub verbo</single>
-         <multiple>sub verbis</multiple>
-      </term>
-      <term name="verse">
-         <single>verse</single>
-         <multiple>verses</multiple>
-      </term>
-      <term name="volume">
-         <single>វ៉ុល</single>
-         <multiple>វ៉ុល</multiple>
-      </term>
-
-      <!-- SHORT LOCATOR FORMS -->
-      <term name="book" form="short">bk.</term>
-      <term name="chapter" form="short">chap.</term>
-      <term name="column" form="short">col.</term>
-      <term name="figure" form="short">fig.</term>
-      <term name="folio" form="short">f.</term>
-      <term name="issue" form="short">no.</term>
-      <term name="opus" form="short">op.</term>
-      <term name="page" form="short">
-         <single>p.</single>
-         <multiple>pp.</multiple>
-      </term>
-      <term name="paragraph" form="short">para.</term>
-      <term name="part" form="short">pt.</term>
-      <term name="section" form="short">sec.</term>
-      <term name="sub verbo" form="short">
-         <single>s.v.</single>
-         <multiple>s.vv.</multiple>
-      </term>
-      <term name="verse" form="short">
-         <single>v.</single>
-         <multiple>vv.</multiple>
-      </term>
-      <term name="volume" form="short">
-         <single>vol.</single>
-         <multiple>vols.</multiple>
-      </term>
-
-      <!-- SYMBOL LOCATOR FORMS -->
-      <term name="paragraph" form="symbol">
-         <single>¶</single>
-         <multiple>¶¶</multiple>
-      </term>
-      <term name="section" form="symbol">
-         <single>§</single>
-         <multiple>§§</multiple>
-      </term>
-
-      <!-- LONG ROLE FORMS -->
-      <term name="author">
-         <single/>
-         <multiple/>
-      </term>
-      <term name="editor">
-         <single>editor</single>
-         <multiple>editors</multiple>
-      </term>
-      <term name="editorial-director">
-         <single></single>
-         <multiple>editors</multiple>
-      </term>
-      <term name="translator">
-         <single>translator</single>
-         <multiple>translator</multiple>
-      </term>
-      <term name="editortranslator">
-        <single>editor &amp; translator</single>
-        <multiple>editors &amp; translators</multiple>
-      </term>
-
-      <!-- SHORT ROLE FORMS -->
-      <term name="author" form="short">
-         <single/>
-         <multiple/>
-      </term>
-      <term name="editor" form="short">
-         <single>ed.</single>
-         <multiple>eds.</multiple>
-      </term>
-      <term name="editorial-director" form="short">
-         <single>ed.</single>
-         <multiple>eds.</multiple>
-      </term>
-      <term name="translator" form="short">
-         <single>tran.</single>
-         <multiple>trans.</multiple>
-      </term>
-      <term name="editortranslator" form="short">
-        <single>ed. &amp; tran.</single>
-        <multiple>eds. &amp; trans.</multiple>
-      </term>
-
-      <!-- VERB ROLE FORMS -->
-      <term name="editor" form="verb">edited by</term>
-      <term name="editorial-director" form="verb">edited by</term>
-      <term name="translator" form="verb">translated by</term>
-      <term name="editortranslator" form="verb">edited &amp; translated by</term>
-      <term name="recipient" form="verb">to</term>
-      <term name="interviewer" form="verb">interview by</term>
-
-      <!-- SHORT VERB ROLE FORMS -->
-      <term name="container-author" form="verb-short">by</term>
-      <term name="editor" form="verb-short">ed.</term>
-      <term name="editorial-director" form="verb-short">ed.</term>
-      <term name="translator" form="verb-short">trans.</term>
-      <term name="editortranslator" form="verb-short">ed. &amp; trans. by</term>
-
-      <!-- LONG MONTH FORMS -->
-      <term name="month-01">មករា</term>
-      <term name="month-02">កុម្ភៈ</term>
-      <term name="month-03">មីនា</term>
-      <term name="month-04">មេសា</term>
-      <term name="month-05">ឧសភា</term>
-      <term name="month-06">មិថុនា</term>
-      <term name="month-07">កក្កដា</term>
-      <term name="month-08">សីហា</term>
-      <term name="month-09">កញ្ញា</term>
-      <term name="month-10">តុលា</term>
-      <term name="month-11">វិច្ឆិកា</term>
-      <term name="month-12">ធ្នូ</term>
-
-      <!-- SHORT MONTH FORMS -->
-      <term name="month-01" form="short">Jan.</term>
-      <term name="month-02" form="short">Feb.</term>
-      <term name="month-03" form="short">Mar.</term>
-      <term name="month-04" form="short">Apr.</term>
-      <term name="month-05" form="short">May</term>
-      <term name="month-06" form="short">Jun.</term>
-      <term name="month-07" form="short">Jul.</term>
-      <term name="month-08" form="short">Aug.</term>
-      <term name="month-09" form="short">Sep.</term>
-      <term name="month-10" form="short">Oct.</term>
-      <term name="month-11" form="short">Nov.</term>
-      <term name="month-12" form="short">Dec.</term>
-
-      <!-- SEASONS -->
-      <term name="season-01">Spring</term>
-      <term name="season-02">Summer</term>
-      <term name="season-03">Autumn</term>
-      <term name="season-04">Winter</term> </terms> 
-</locale>
+ locales/locales-km-KH.xml view
@@ -0,0 +1,303 @@+<?xml version="1.0" encoding="utf-8"?>
+<locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="km">
+   <style-options punctuation-in-quote="false"/>
+   <date form="text">
+      <date-part name="day" form="numeric" suffix="&#8203;"/>
+      <date-part name="month" suffix="&#8203;"/>
+      <date-part name="year"/>
+   </date>
+   <date form="numeric">
+      <date-part name="day" form="numeric-leading-zeros" suffix="/"/>
+      <date-part name="month" form="numeric-leading-zeros" suffix="/"/>
+      <date-part name="year"/>
+   </date>
+   <terms>
+      <term name="accessed">accessed</term>
+      <term name="and">and</term>
+      <term name="and others">and others</term>
+      <term name="anonymous">anonymous</term>
+      <term name="anonymous" form="short">anon.</term>
+      <term name="at">at</term>
+      <term name="by">by</term>
+      <term name="circa">circa</term>
+      <term name="circa" form="short">c.</term>
+      <term name="cited">cited</term>
+      <term name="edition">
+         <single>edition</single>
+         <multiple>editions</multiple>
+      </term>
+      <term name="edition" form="short">ed.</term>
+      <term name="et-al">et al.</term>
+      <term name="forthcoming">forthcoming</term>
+      <term name="from">from</term>
+      <term name="ibid">ibid</term>
+      <term name="in">in</term>
+      <term name="in press">in press</term>
+      <term name="internet">internet</term>
+      <term name="interview">interview</term>
+      <term name="letter">letter</term>
+      <term name="no date">no date</term>
+      <term name="no date" form="short">n.d.</term>
+      <term name="online">online</term>
+      <term name="presented at">presented at the</term>
+      <term name="reference">
+         <single>reference</single>
+         <multiple>references</multiple>
+      </term>
+      <term name="reference" form="short">
+         <single>ref.</single>
+         <multiple>refs.</multiple>
+      </term>
+      <term name="retrieved">retrieved</term>
+
+      <!-- ANNO DOMINI; BEFORE CHRIST -->
+      <term name="ad">AD</term>
+      <term name="bc">BC</term>
+
+      <!-- QUOTES -->
+      <term name="open-quote">“</term>
+      <term name="close-quote">”</term>
+      <term name="open-inner-quote">‘</term>
+      <term name="close-inner-quote">’</term>
+
+      <!-- ORDINALS -->
+      <term name="ordinal-01">st</term>
+      <term name="ordinal-02">nd</term>
+      <term name="ordinal-03">rd</term>
+      <term name="ordinal-04">th</term>
+
+      <!-- LONG ORDINALS -->
+      <term name="long-ordinal-01">ទីមួយ</term>
+      <term name="long-ordinal-02">ទីពីរ</term>
+      <term name="long-ordinal-03">ទីបី</term>
+      <term name="long-ordinal-04">ទីបួន</term>
+      <term name="long-ordinal-05">ទីប្រាំ</term>
+      <term name="long-ordinal-06">ទីប្រាំមួយ</term>
+      <term name="long-ordinal-07">ទីប្រាំពីរ</term>
+      <term name="long-ordinal-08">ទីប្រាំបី</term>
+      <term name="long-ordinal-09">ទីប្រាំបួន</term>
+      <term name="long-ordinal-10">ទីដប់មួយ</term>
+
+      <!-- CATEGORIES -->
+      <term name="anthropology">នរវិទ្យា</term>
+      <term name="astronomy">តារាវិទ្យា</term>
+      <term name="biology">ជីវវិទ្យា</term>
+      <term name="botany">រុក្ខវិទ្យា</term>
+      <term name="chemistry">គីមីវិទ្យា</term>
+      <term name="engineering">វិស្វកម្ម</term>
+      <term name="generic-base">generic base</term>
+      <term name="geography">ភូមិវិទ្យា</term>
+      <term name="geology">ភូគព្ភវិទ្យា</term>
+      <term name="history">ប្រវត្តិវិទ្យា</term>
+      <term name="humanities">មនុស្សវិទ្យា</term>
+      <term name="linguistics">ភាសាវិទ្យា</term>
+      <term name="literature">អក្សរសាស្ត្រ</term>
+      <term name="math">គណិតវិទ្យា</term>
+      <term name="medicine">វេជ្ជសាស្ត្រ</term>
+      <term name="philosophy">ទស្សនវិទ្យា</term>
+      <term name="physics">រូបវិទ្យា</term>
+      <term name="psychology">ចិត្តវិទ្យា</term>
+      <term name="sociology">សង្គមវិទ្យា</term>
+      <term name="science">វិទ្យាសាស្ត្រ</term>
+      <term name="political_science">វិទ្យាសាស្ត្រនយោបាយ</term>
+      <term name="social_science">សង្គមវិទ្យា</term>
+      <term name="theology">ទេវវិទ្យា</term>
+      <term name="zoology">សត្តវិទ្យា</term>
+
+      <!-- LONG LOCATOR FORMS -->
+      <term name="book">
+         <single>សៀវភៅ</single>
+         <multiple>សៀវភៅ</multiple>
+      </term>
+      <term name="chapter">
+         <single>ជំពូក</single>
+         <multiple>ជំពូក</multiple>
+      </term>
+      <term name="column">
+         <single>កាឡោន</single>
+         <multiple>កាឡោន</multiple>
+      </term>
+      <term name="figure">
+         <single>តួលេខ</single>
+         <multiple>តួលេខ</multiple>
+      </term>
+      <term name="folio">
+         <single>folio</single>
+         <multiple>folios</multiple>
+      </term>
+      <term name="issue">
+         <single>ចំនួន</single>
+         <multiple>ចំនួន</multiple>
+      </term>
+      <term name="line">
+         <single>បន្ទាត់</single>
+         <multiple>បន្ទាត់</multiple>
+      </term>
+      <term name="note">
+         <single>កំណត់ចំណាំ</single>
+         <multiple>កំណត់ចំណាំ</multiple>
+      </term>
+      <term name="opus">
+         <single>opus</single>
+         <multiple>opera</multiple>
+      </term>
+      <term name="page">
+         <single>ទំព័រ</single>
+         <multiple>ទំព័រ</multiple>
+      </term>
+      <term name="paragraph">
+         <single>កថាខណ្ឌ</single>
+         <multiple>កថាខណ្ឌ</multiple>
+      </term>
+      <term name="part">
+         <single>ជំពូក</single>
+         <multiple>ជំពូក</multiple>
+      </term>
+      <term name="section">
+         <single>ផ្នែក</single>
+         <multiple>ផ្នែក</multiple>
+      </term>
+      <term name="sub verbo">
+         <single>sub verbo</single>
+         <multiple>sub verbis</multiple>
+      </term>
+      <term name="verse">
+         <single>verse</single>
+         <multiple>verses</multiple>
+      </term>
+      <term name="volume">
+         <single>វ៉ុល</single>
+         <multiple>វ៉ុល</multiple>
+      </term>
+
+      <!-- SHORT LOCATOR FORMS -->
+      <term name="book" form="short">bk.</term>
+      <term name="chapter" form="short">chap.</term>
+      <term name="column" form="short">col.</term>
+      <term name="figure" form="short">fig.</term>
+      <term name="folio" form="short">f.</term>
+      <term name="issue" form="short">no.</term>
+      <term name="opus" form="short">op.</term>
+      <term name="page" form="short">
+         <single>p.</single>
+         <multiple>pp.</multiple>
+      </term>
+      <term name="paragraph" form="short">para.</term>
+      <term name="part" form="short">pt.</term>
+      <term name="section" form="short">sec.</term>
+      <term name="sub verbo" form="short">
+         <single>s.v.</single>
+         <multiple>s.vv.</multiple>
+      </term>
+      <term name="verse" form="short">
+         <single>v.</single>
+         <multiple>vv.</multiple>
+      </term>
+      <term name="volume" form="short">
+         <single>vol.</single>
+         <multiple>vols.</multiple>
+      </term>
+
+      <!-- SYMBOL LOCATOR FORMS -->
+      <term name="paragraph" form="symbol">
+         <single>¶</single>
+         <multiple>¶¶</multiple>
+      </term>
+      <term name="section" form="symbol">
+         <single>§</single>
+         <multiple>§§</multiple>
+      </term>
+
+      <!-- LONG ROLE FORMS -->
+      <term name="author">
+         <single/>
+         <multiple/>
+      </term>
+      <term name="editor">
+         <single>editor</single>
+         <multiple>editors</multiple>
+      </term>
+      <term name="editorial-director">
+         <single></single>
+         <multiple>editors</multiple>
+      </term>
+      <term name="translator">
+         <single>translator</single>
+         <multiple>translator</multiple>
+      </term>
+      <term name="editortranslator">
+        <single>editor &amp; translator</single>
+        <multiple>editors &amp; translators</multiple>
+      </term>
+
+      <!-- SHORT ROLE FORMS -->
+      <term name="author" form="short">
+         <single/>
+         <multiple/>
+      </term>
+      <term name="editor" form="short">
+         <single>ed.</single>
+         <multiple>eds.</multiple>
+      </term>
+      <term name="editorial-director" form="short">
+         <single>ed.</single>
+         <multiple>eds.</multiple>
+      </term>
+      <term name="translator" form="short">
+         <single>tran.</single>
+         <multiple>trans.</multiple>
+      </term>
+      <term name="editortranslator" form="short">
+        <single>ed. &amp; tran.</single>
+        <multiple>eds. &amp; trans.</multiple>
+      </term>
+
+      <!-- VERB ROLE FORMS -->
+      <term name="editor" form="verb">edited by</term>
+      <term name="editorial-director" form="verb">edited by</term>
+      <term name="translator" form="verb">translated by</term>
+      <term name="editortranslator" form="verb">edited &amp; translated by</term>
+      <term name="recipient" form="verb">to</term>
+      <term name="interviewer" form="verb">interview by</term>
+
+      <!-- SHORT VERB ROLE FORMS -->
+      <term name="container-author" form="verb-short">by</term>
+      <term name="editor" form="verb-short">ed.</term>
+      <term name="editorial-director" form="verb-short">ed.</term>
+      <term name="translator" form="verb-short">trans.</term>
+      <term name="editortranslator" form="verb-short">ed. &amp; trans. by</term>
+
+      <!-- LONG MONTH FORMS -->
+      <term name="month-01">មករា</term>
+      <term name="month-02">កុម្ភៈ</term>
+      <term name="month-03">មីនា</term>
+      <term name="month-04">មេសា</term>
+      <term name="month-05">ឧសភា</term>
+      <term name="month-06">មិថុនា</term>
+      <term name="month-07">កក្កដា</term>
+      <term name="month-08">សីហា</term>
+      <term name="month-09">កញ្ញា</term>
+      <term name="month-10">តុលា</term>
+      <term name="month-11">វិច្ឆិកា</term>
+      <term name="month-12">ធ្នូ</term>
+
+      <!-- SHORT MONTH FORMS -->
+      <term name="month-01" form="short">Jan.</term>
+      <term name="month-02" form="short">Feb.</term>
+      <term name="month-03" form="short">Mar.</term>
+      <term name="month-04" form="short">Apr.</term>
+      <term name="month-05" form="short">May</term>
+      <term name="month-06" form="short">Jun.</term>
+      <term name="month-07" form="short">Jul.</term>
+      <term name="month-08" form="short">Aug.</term>
+      <term name="month-09" form="short">Sep.</term>
+      <term name="month-10" form="short">Oct.</term>
+      <term name="month-11" form="short">Nov.</term>
+      <term name="month-12" form="short">Dec.</term>
+
+      <!-- SEASONS -->
+      <term name="season-01">Spring</term>
+      <term name="season-02">Summer</term>
+      <term name="season-03">Autumn</term>
+      <term name="season-04">Winter</term> </terms> 
+</locale>
locales/locales-ko-KR.xml view
@@ -55,6 +55,7 @@       <term name="bc">BC</term>        <!-- QUOTES -->+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->       <term name="open-quote">“</term>       <term name="close-quote">”</term>       <term name="open-inner-quote">‘</term>
locales/locales-mn-MN.xml view
@@ -55,10 +55,12 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <!-- (Assumed to follow Russian conventions) -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>+      <term name="open-inner-quote">„</term>+      <term name="close-inner-quote">“</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-nb-NO.xml view
@@ -27,7 +27,7 @@          <multiple>utgaver</multiple>       </term>       <term name="edition" form="short">utg.</term>-      <term name="et-al">m.fl.</term>+      <term name="et-al">mfl.</term>       <term name="forthcoming">kommende</term>       <term name="from">fra</term>       <term name="ibid">ibid.</term>
locales/locales-nn-NO.xml view
@@ -27,7 +27,7 @@          <multiple>utgåver</multiple>       </term>       <term name="edition" form="short">utg.</term>-      <term name="et-al">m.fl.</term>+      <term name="et-al">mfl.</term>       <term name="forthcoming">kommande</term>       <term name="from">frå</term>       <term name="ibid">ibid.</term>
locales/locales-pl-PL.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>       <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+      <term name="open-inner-quote">«</term>+      <term name="close-inner-quote">»</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-pt-PT.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>+      <term name="open-inner-quote">“</term>+      <term name="close-inner-quote">”</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-ro-RO.xml view
@@ -12,23 +12,23 @@       <date-part name="year"/>    </date>    <terms>-      <term name="accessed">accesat în</term>-      <term name="and">şi</term>-      <term name="and others">şi alţii</term>+      <term name="accessed">data accesării:</term>+      <term name="and">și</term>+      <term name="and others">și alții</term>       <term name="anonymous">anonim</term>-      <term name="anonymous" form="short">anon</term>+      <term name="anonymous" form="short">anon.</term>       <term name="at">la</term>-      <term name="by">by</term>+      <term name="by">de</term>       <term name="circa">circa</term>-      <term name="circa" form="short">c.</term>+      <term name="circa" form="short">cca.</term>       <term name="cited">citat</term>       <term name="edition">-         <single>ediţia</single>-         <multiple>ediţiile</multiple>+         <single>ediția</single>+         <multiple>edițiile</multiple>       </term>       <term name="edition" form="short">ed</term>       <term name="et-al">et al.</term>-      <term name="forthcoming">în curs de apariţie</term>+      <term name="forthcoming">în curs de apariție</term>       <term name="from">din</term>       <term name="ibid">ibidem</term>       <term name="in">în</term>@@ -36,47 +36,48 @@       <term name="internet">internet</term>       <term name="interview">interviu</term>       <term name="letter">scrisoare</term>-      <term name="no date">no date</term>+      <term name="no date">fără dată</term>       <term name="no date" form="short">f.a.</term>       <term name="online">online</term>       <term name="presented at">prezentat la</term>       <term name="reference">-         <single>reference</single>-         <multiple>references</multiple>+         <single>referință</single>+         <multiple>referințe</multiple>       </term>       <term name="reference" form="short">          <single>ref.</single>-         <multiple>refs.</multiple>+         <multiple>ref.</multiple>       </term>       <term name="retrieved">preluat în</term>        <!-- ANNO DOMINI; BEFORE CHRIST -->-      <term name="ad">AD</term>-      <term name="bc">BC</term>+      <term name="ad">d.Hr.</term>+      <term name="bc">î.Hr.</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>+      <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>       <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+      <term name="open-inner-quote">«</term>+      <term name="close-inner-quote">»</term>        <!-- ORDINALS -->-      <term name="ordinal-01">st</term>-      <term name="ordinal-02">nd</term>-      <term name="ordinal-03">rd</term>-      <term name="ordinal-04">th</term>+      <term name="ordinal-01"></term>+      <term name="ordinal-02">-lea</term>+      <term name="ordinal-03">-lea</term>+      <term name="ordinal-04">-lea</term>        <!-- LONG ORDINALS -->-      <term name="long-ordinal-01">first</term>-      <term name="long-ordinal-02">second</term>-      <term name="long-ordinal-03">third</term>-      <term name="long-ordinal-04">fourth</term>-      <term name="long-ordinal-05">fifth</term>-      <term name="long-ordinal-06">sixth</term>-      <term name="long-ordinal-07">seventh</term>-      <term name="long-ordinal-08">eighth</term>-      <term name="long-ordinal-09">ninth</term>-      <term name="long-ordinal-10">tenth</term>+      <term name="long-ordinal-01">primul</term>+      <term name="long-ordinal-02">al doilea</term>+      <term name="long-ordinal-03">al treilea</term>+      <term name="long-ordinal-04">al patrulea</term>+      <term name="long-ordinal-05">al cincilea</term>+      <term name="long-ordinal-06">al șaselea</term>+      <term name="long-ordinal-07">al șaptelea</term>+      <term name="long-ordinal-08">al optulea</term>+      <term name="long-ordinal-09">al nouălea</term>+      <term name="long-ordinal-10">al zecelea</term>        <!-- CATEGORIES -->       <term name="anthropology">antropologie</term>@@ -89,8 +90,8 @@       <term name="geography">geografie</term>       <term name="geology">geologie</term>       <term name="history">istorie</term>-      <term name="humanities">umanioare</term>-      <term name="linguistics">linguistics</term>+      <term name="humanities">științe umaniste</term>+      <term name="linguistics">lingvistică</term>       <term name="literature">literatură</term>       <term name="math">matematică</term>       <term name="medicine">medicină</term>@@ -98,16 +99,16 @@       <term name="physics">fizică</term>       <term name="psychology">psihologie</term>       <term name="sociology">sociologie</term>-      <term name="science">ştiinţă</term>-      <term name="political_science">ştiinţe politice</term>-      <term name="social_science">ştiinţe sociale</term>+      <term name="science">știință</term>+      <term name="political_science">științe politice</term>+      <term name="social_science">științe sociale</term>       <term name="theology">teologie</term>       <term name="zoology">zoologie</term>        <!-- LONG LOCATOR FORMS -->       <term name="book">          <single>cartea</single>-         <multiple>cărţile</multiple>+         <multiple>cărțile</multiple>       </term>       <term name="chapter">          <single>capitolul</single>@@ -151,11 +152,11 @@       </term>       <term name="part">          <single>partea</single>-         <multiple>părţile</multiple>+         <multiple>părțile</multiple>       </term>       <term name="section">-         <single>secţiunea</single>-         <multiple>secţiunile</multiple>+         <single>secțiunea</single>+         <multiple>secțiunile</multiple>       </term>       <term name="sub verbo">          <single>sub verbo</single>@@ -171,31 +172,31 @@       </term>        <!-- SHORT LOCATOR FORMS -->-      <term name="book" form="short">cart</term>-      <term name="chapter" form="short">cap</term>-      <term name="column" form="short">col</term>-      <term name="figure" form="short">fig</term>-      <term name="folio" form="short">fol</term>-      <term name="issue" form="short">nr</term>-      <term name="opus" form="short">op</term>+      <term name="book" form="short">cart.</term>+      <term name="chapter" form="short">cap.</term>+      <term name="column" form="short">col.</term>+      <term name="figure" form="short">fig.</term>+      <term name="folio" form="short">fol.</term>+      <term name="issue" form="short">nr.</term>+      <term name="opus" form="short">op.</term>       <term name="page" form="short">-         <single>p</single>-         <multiple>pp</multiple>+         <single>p.</single>+         <multiple>pp.</multiple>       </term>-      <term name="paragraph" form="short">par</term>-      <term name="part" form="short">part</term>-      <term name="section" form="short">sec</term>+      <term name="paragraph" form="short">par.</term>+      <term name="part" form="short">part.</term>+      <term name="section" form="short">sec.</term>       <term name="sub verbo" form="short">          <single>s.v.</single>          <multiple>s.vv.</multiple>       </term>       <term name="verse" form="short">-         <single>v</single>-         <multiple>vv</multiple>+         <single>v.</single>+         <multiple>vv.</multiple>       </term>       <term name="volume" form="short">-         <single>vol</single>-         <multiple>vol</multiple>+         <single>vol.</single>+         <multiple>vol.</multiple>       </term>        <!-- SYMBOL LOCATOR FORMS -->@@ -219,53 +220,53 @@       </term>       <term name="editorial-director">          <single>editor</single>-         <multiple>editors</multiple>+         <multiple>editori</multiple>       </term>       <term name="translator">          <single>traducător</single>          <multiple>traducători</multiple>       </term>       <term name="editortranslator">-         <single>editor &amp; translator</single>-         <multiple>editors &amp; translators</multiple>+         <single>editor &amp; traducător</single>+         <multiple>editori &amp; traducători</multiple>       </term>        <!-- SHORT ROLE FORMS -->       <term name="author" form="short">-         <single>aut</single>-         <multiple>aut</multiple>+         <single>aut.</single>+         <multiple>aut.</multiple>       </term>       <term name="editor" form="short">-         <single>ed</single>-         <multiple>ed</multiple>+         <single>ed.</single>+         <multiple>ed.</multiple>       </term>       <term name="editorial-director" form="short">          <single>ed.</single>-         <multiple>eds.</multiple>+         <multiple>ed.</multiple>       </term>       <term name="translator" form="short">-         <single>trad</single>-         <multiple>trad</multiple>+         <single>trad.</single>+         <multiple>trad.</multiple>       </term>       <term name="editortranslator" form="short">-         <single>ed. &amp; tran.</single>-         <multiple>eds. &amp; trans.</multiple>+         <single>ed. &amp; trad.</single>+         <multiple>ed. &amp; trad.</multiple>       </term>        <!-- VERB ROLE FORMS -->-      <term name="editor" form="verb">ediţie de</term>-      <term name="editorial-director" form="verb">edited by</term>+      <term name="editor" form="verb">ediție de</term>+      <term name="editorial-director" form="verb">ediție de</term>       <term name="translator" form="verb">traducere de</term>-      <term name="editortranslator" form="verb">edited &amp; translated by</term>+      <term name="editortranslator" form="verb">ediție &amp; traducere de</term>       <term name="recipient" form="verb">în</term>       <term name="interviewer" form="verb">interviu de</term>        <!-- SHORT VERB ROLE FORMS -->-      <term name="container-author" form="verb-short">by</term>-      <term name="editor" form="verb-short">ed</term>+      <term name="container-author" form="verb-short">de</term>+      <term name="editor" form="verb-short">ed.</term>       <term name="editorial-director" form="verb-short">ed.</term>-      <term name="translator" form="verb-short">trad</term>-      <term name="editortranslator" form="verb-short">ed. &amp; trans. by</term>+      <term name="translator" form="verb-short">trad.</term>+      <term name="editortranslator" form="verb-short">ed. &amp; trad. de</term>        <!-- LONG MONTH FORMS -->       <term name="month-01">ianuarie</term>@@ -282,23 +283,23 @@       <term name="month-12">decembrie</term>        <!-- SHORT MONTH FORMS -->-      <term name="month-01" form="short">ian</term>-      <term name="month-02" form="short">feb</term>-      <term name="month-03" form="short">mar</term>-      <term name="month-04" form="short">apr</term>+      <term name="month-01" form="short">ian.</term>+      <term name="month-02" form="short">feb.</term>+      <term name="month-03" form="short">mar.</term>+      <term name="month-04" form="short">apr.</term>       <term name="month-05" form="short">mai</term>-      <term name="month-06" form="short">iun</term>-      <term name="month-07" form="short">iul</term>-      <term name="month-08" form="short">aug</term>-      <term name="month-09" form="short">sep</term>-      <term name="month-10" form="short">oct</term>-      <term name="month-11" form="short">nov</term>-      <term name="month-12" form="short">dec</term>+      <term name="month-06" form="short">iun.</term>+      <term name="month-07" form="short">iul.</term>+      <term name="month-08" form="short">aug.</term>+      <term name="month-09" form="short">sep.</term>+      <term name="month-10" form="short">oct.</term>+      <term name="month-11" form="short">nov.</term>+      <term name="month-12" form="short">dec.</term>        <!-- SEASONS -->-      <term name="season-01">Spring</term>-      <term name="season-02">Summer</term>-      <term name="season-03">Autumn</term>-      <term name="season-04">Winter</term>+      <term name="season-01">primăvara</term>+      <term name="season-02">vara</term>+      <term name="season-03">toamna</term>+      <term name="season-04">iarna</term>    </terms> </locale>
locales/locales-ru-RU.xml view
@@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="ru">+<!-- Translation by Alexei Kouprianov alexei.kouprianov@gmail.com -->    <style-options punctuation-in-quote="false"/>    <date form="text">       <date-part name="day" suffix=" "/>@@ -12,34 +13,35 @@       <date-part name="year"/>    </date>    <terms>-      <term name="accessed">вызвано</term>+      <term name="accessed">просмотрено</term>       <term name="and">и</term>-      <term name="and others">and others</term>-      <term name="anonymous">anonymous</term>-      <term name="anonymous" form="short">anon</term>-      <term name="at">at</term>-      <term name="by">by</term>+      <term name="and others">и др.</term>+      <term name="anonymous">аноним</term>+      <term name="anonymous" form="short">анон.</term>+      <term name="at">на</term>+      <term name="by" />       <term name="circa">circa</term>-      <term name="circa" form="short">c.</term>-      <term name="cited">cited</term>+      <term name="circa" form="short">ca.</term>+      <term name="cited">цитируется по</term>+      <term name="cited" form="short">цит. по</term>       <term name="edition">-         <single>edition</single>-         <multiple>editions</multiple>+         <single>издание</single>+         <multiple>издания</multiple>       </term>-      <term name="edition" form="short">ed</term>+      <term name="edition" form="short">изд.</term>       <term name="et-al">и др.</term>-      <term name="forthcoming">грядущие</term>+      <term name="forthcoming">ожидается</term>       <term name="from">от</term>-      <term name="ibid">так же</term>+      <term name="ibid">там же</term>       <term name="in">в</term>-      <term name="in press">in press</term>-      <term name="internet">internet</term>-      <term name="interview">interview</term>-      <term name="letter">letter</term>-      <term name="no date">no date</term>-      <term name="no date" form="short">нет даты</term>+      <term name="in press">в печати</term>+      <term name="internet">Интернет</term>+      <term name="interview">интервью</term>+      <term name="letter">письмо</term>+      <term name="no date">без даты</term>+      <term name="no date" form="short">б. д.</term>       <term name="online">online</term>-      <term name="presented at">presented at the</term>+      <term name="presented at">представлено на</term>       <term name="reference">          <single>reference</single>          <multiple>references</multiple>@@ -51,98 +53,98 @@       <term name="retrieved">извлечено</term>        <!-- ANNO DOMINI; BEFORE CHRIST -->-      <term name="ad">AD</term>-      <term name="bc">BC</term>+      <term name="ad">н. э.</term>+      <term name="bc">до н. э.</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>+      <term name="open-inner-quote">„</term>+      <term name="close-inner-quote">“</term>        <!-- ORDINALS -->-      <term name="ordinal-01">st</term>-      <term name="ordinal-02">nd</term>-      <term name="ordinal-03">rd</term>-      <term name="ordinal-04">th</term>+      <term name="ordinal-01">й</term>+      <term name="ordinal-02">й</term>+      <term name="ordinal-03">й</term>+      <term name="ordinal-04">й</term>        <!-- LONG ORDINALS -->-      <term name="long-ordinal-01">first</term>-      <term name="long-ordinal-02">second</term>-      <term name="long-ordinal-03">third</term>-      <term name="long-ordinal-04">fourth</term>-      <term name="long-ordinal-05">fifth</term>-      <term name="long-ordinal-06">sixth</term>-      <term name="long-ordinal-07">seventh</term>-      <term name="long-ordinal-08">eighth</term>-      <term name="long-ordinal-09">ninth</term>-      <term name="long-ordinal-10">tenth</term>+      <term name="long-ordinal-01">первый</term>+      <term name="long-ordinal-02">второй</term>+      <term name="long-ordinal-03">третий</term>+      <term name="long-ordinal-04">четвертый</term>+      <term name="long-ordinal-05">пятый</term>+      <term name="long-ordinal-06">шестой</term>+      <term name="long-ordinal-07">седьмой</term>+      <term name="long-ordinal-08">восьмой</term>+      <term name="long-ordinal-09">девятый</term>+      <term name="long-ordinal-10">десятый</term>        <!-- CATEGORIES -->-      <term name="anthropology">anthropology</term>-      <term name="astronomy">astronomy</term>-      <term name="biology">biology</term>-      <term name="botany">botany</term>-      <term name="chemistry">chemistry</term>-      <term name="engineering">engineering</term>-      <term name="generic-base">generic base</term>-      <term name="geography">geography</term>-      <term name="geology">geology</term>-      <term name="history">history</term>-      <term name="humanities">humanities</term>-      <term name="linguistics">linguistics</term>-      <term name="literature">literature</term>-      <term name="math">math</term>-      <term name="medicine">medicine</term>-      <term name="philosophy">philosophy</term>-      <term name="physics">physics</term>-      <term name="psychology">psychology</term>-      <term name="sociology">sociology</term>-      <term name="science">science</term>-      <term name="political_science">political science</term>-      <term name="social_science">social science</term>-      <term name="theology">theology</term>-      <term name="zoology">zoology</term>+      <term name="anthropology">антропология</term>+      <term name="astronomy">астрономия</term>+      <term name="biology">биология</term>+      <term name="botany">ботаника</term>+      <term name="chemistry">химия</term>+      <term name="engineering">инженерное дело</term>+      <term name="generic-base">общий</term>+      <term name="geography">география</term>+      <term name="geology">геология</term>+      <term name="history">история</term>+      <term name="humanities">гуманитарные науки</term>+      <term name="linguistics">лингвистика</term>+      <term name="literature">литературоведение</term>+      <term name="math">математика</term>+      <term name="medicine">медицина</term>+      <term name="philosophy">философия</term>+      <term name="physics">физика</term>+      <term name="psychology">психология</term>+      <term name="sociology">социология</term>+      <term name="science">естественные науки</term>+      <term name="political_science">политические науки</term>+      <term name="social_science">социальные науки</term>+      <term name="theology">теология</term>+      <term name="zoology">зоология</term>        <!-- LONG LOCATOR FORMS -->       <term name="book">-         <single>book</single>-         <multiple>books</multiple>+         <single>книга</single>+         <multiple>книги</multiple>       </term>       <term name="chapter">-         <single>chapter</single>-         <multiple>chapters</multiple>+         <single>глава</single>+         <multiple>главы</multiple>       </term>       <term name="column">-         <single>column</single>-         <multiple>columns</multiple>+         <single>столбец</single>+         <multiple>столбцы</multiple>       </term>       <term name="figure">-         <single>figure</single>-         <multiple>figures</multiple>+         <single>рисунок</single>+         <multiple>рисунки</multiple>       </term>       <term name="folio">-         <single>folio</single>-         <multiple>folios</multiple>+         <single>лист</single>+         <multiple>листы</multiple>       </term>       <term name="issue">-         <single>number</single>-         <multiple>numbers</multiple>+         <single>выпуск</single>+         <multiple>выпуски</multiple>       </term>       <term name="line">-         <single>линия</single>-         <multiple>линии</multiple>+         <single>строка</single>+         <multiple>строки</multiple>       </term>       <term name="note">-         <single>note</single>-         <multiple>notes</multiple>+         <single>примечание</single>+         <multiple>примечания</multiple>       </term>       <term name="opus">-         <single>opus</single>-         <multiple>opera</multiple>+         <single>сочинение</single>+         <multiple>сочинения</multiple>       </term>       <term name="page">-         <single>страницы</single>+         <single>страница</single>          <multiple>страницы</multiple>       </term>       <term name="paragraph">@@ -150,52 +152,52 @@          <multiple>параграфы</multiple>       </term>       <term name="part">-         <single>part</single>-         <multiple>parts</multiple>+         <single>часть</single>+         <multiple>части</multiple>       </term>       <term name="section">-         <single>section</single>-         <multiple>sections</multiple>+         <single>раздел</single>+         <multiple>разделы</multiple>       </term>       <term name="sub verbo">-         <single>sub verbo</single>-         <multiple>sub verbis</multiple>+         <single>смотри</single>+         <multiple>смотри</multiple>       </term>       <term name="verse">-         <single>verse</single>-         <multiple>verses</multiple>+         <single>стих</single>+         <multiple>стихи</multiple>       </term>       <term name="volume">-         <single>volume</single>-         <multiple>volumes</multiple>+         <single>том</single>+         <multiple>тома</multiple>       </term>        <!-- SHORT LOCATOR FORMS -->-      <term name="book" form="short">bk</term>-      <term name="chapter" form="short">chap</term>-      <term name="column" form="short">col</term>-      <term name="figure" form="short">fig</term>-      <term name="folio" form="short">f</term>-      <term name="issue" form="short">ном</term>-      <term name="opus" form="short">op</term>+      <term name="book" form="short">кн.</term>+      <term name="chapter" form="short">гл.</term>+      <term name="column" form="short">стб.</term>+      <term name="figure" form="short">рис.</term>+      <term name="folio" form="short">л.</term>+      <term name="issue" form="short">№</term>+      <term name="opus" form="short">соч.</term>       <term name="page" form="short">-         <single>стр-а</single>-         <multiple>стр-ы</multiple>+         <single>с.</single>+         <multiple>с.</multiple>       </term>-      <term name="paragraph" form="short">para</term>-      <term name="part" form="short">pt</term>-      <term name="section" form="short">sec</term>+      <term name="paragraph" form="short">пара.</term>+      <term name="part" form="short">ч.</term>+      <term name="section" form="short">разд.</term>       <term name="sub verbo" form="short">-         <single>s.v.</single>-         <multiple>s.vv.</multiple>+         <single>см.</single>+         <multiple>см.</multiple>       </term>       <term name="verse" form="short">-         <single>v</single>-         <multiple>vv</multiple>+         <single>ст.</single>+         <multiple>ст.</multiple>       </term>       <term name="volume" form="short">-         <single>vol</single>-         <multiple>vols</multiple>+         <single>т.</single>+         <multiple>тт.</multiple>       </term>        <!-- SYMBOL LOCATOR FORMS -->@@ -218,16 +220,16 @@          <multiple>редакторы</multiple>       </term>       <term name="editorial-director">-         <single>editor</single>-         <multiple>editors</multiple>+         <single>ответственный редактор</single>+         <multiple>ответственные редакторы</multiple>       </term>       <term name="translator">          <single>переводчик</single>          <multiple>переводчики</multiple>       </term>       <term name="editortranslator">-         <single>editor &amp; translator</single>-         <multiple>editors &amp; translators</multiple>+         <single>редактор и переводчик</single>+         <multiple>редакторы и переводчики</multiple>       </term>        <!-- SHORT ROLE FORMS -->@@ -236,69 +238,69 @@          <multiple/>       </term>       <term name="editor" form="short">-         <single>ред-р</single>-         <multiple>ред-ры</multiple>+         <single>ред.</single>+         <multiple>ред.</multiple>       </term>       <term name="editorial-director" form="short">-         <single>ed.</single>-         <multiple>eds.</multiple>+         <single>отв. ред.</single>+         <multiple>отв. ред.</multiple>       </term>       <term name="translator" form="short">-         <single>перев-к</single>-         <multiple>перев-и</multiple>+         <single>перев.</single>+         <multiple>перев.</multiple>       </term>       <term name="editortranslator" form="short">-         <single>ed. &amp; tran.</single>-         <multiple>eds. &amp; trans.</multiple>+         <single>ред. и перев.</single>+         <multiple>ред. и перев.</multiple>       </term>        <!-- VERB ROLE FORMS -->       <term name="editor" form="verb">отредактировано</term>-      <term name="editorial-director" form="verb">edited by</term>+      <term name="editorial-director" form="verb">отредактировано</term>       <term name="translator" form="verb">переведено</term>-      <term name="editortranslator" form="verb">edited &amp; translated by</term>-      <term name="recipient" form="verb">to</term>-      <term name="interviewer" form="verb">interview by</term>+      <term name="editortranslator" form="verb">отредактировано и переведено</term>+      <term name="recipient" form="verb">к</term>+      <term name="interviewer" form="verb">интервью</term>        <!-- SHORT VERB ROLE FORMS -->-      <term name="container-author" form="verb-short">by</term>-      <term name="editor" form="verb-short">ред</term>-      <term name="editorial-director" form="verb-short">ed.</term>-      <term name="translator" form="verb-short">перев</term>-      <term name="editortranslator" form="verb-short">ed. &amp; trans. by</term>+      <term name="container-author" form="verb-short" />+      <term name="editor" form="verb-short">ред.</term>+      <term name="editorial-director" form="verb-short">отв. ред.</term>+      <term name="translator" form="verb-short">перев.</term>+      <term name="editortranslator" form="verb-short">ред. и перев.</term>        <!-- LONG MONTH FORMS -->-      <term name="month-01">Январь</term>-      <term name="month-02">Февраль</term>-      <term name="month-03">Март</term>-      <term name="month-04">Апрель</term>-      <term name="month-05">Май</term>-      <term name="month-06">Июнь</term>-      <term name="month-07">Июль</term>-      <term name="month-08">Август</term>-      <term name="month-09">Сентябрь</term>-      <term name="month-10">Октябрь</term>-      <term name="month-11">Ноябрь</term>-      <term name="month-12">Декабрь</term>+      <term name="month-01">январь</term>+      <term name="month-02">февраль</term>+      <term name="month-03">март</term>+      <term name="month-04">апрель</term>+      <term name="month-05">май</term>+      <term name="month-06">июнь</term>+      <term name="month-07">июль</term>+      <term name="month-08">август</term>+      <term name="month-09">сентябрь</term>+      <term name="month-10">октябрь</term>+      <term name="month-11">ноябрь</term>+      <term name="month-12">декабрь</term>        <!-- SHORT MONTH FORMS -->-      <term name="month-01" form="short">Янв</term>-      <term name="month-02" form="short">Фев</term>-      <term name="month-03" form="short">Мар</term>-      <term name="month-04" form="short">Апр</term>-      <term name="month-05" form="short">Май</term>-      <term name="month-06" form="short">Июн</term>-      <term name="month-07" form="short">Июл</term>-      <term name="month-08" form="short">Авг</term>-      <term name="month-09" form="short">Сен</term>-      <term name="month-10" form="short">Окт</term>-      <term name="month-11" form="short">Ноя</term>-      <term name="month-12" form="short">Дек</term>+      <term name="month-01" form="short">янв.</term>+      <term name="month-02" form="short">фев.</term>+      <term name="month-03" form="short">мар.</term>+      <term name="month-04" form="short">апр.</term>+      <term name="month-05" form="short">май</term>+      <term name="month-06" form="short">июн.</term>+      <term name="month-07" form="short">июл.</term>+      <term name="month-08" form="short">авг.</term>+      <term name="month-09" form="short">сен.</term>+      <term name="month-10" form="short">окт.</term>+      <term name="month-11" form="short">ноя.</term>+      <term name="month-12" form="short">дек.</term>        <!-- SEASONS -->-      <term name="season-01">Spring</term>-      <term name="season-02">Summer</term>-      <term name="season-03">Autumn</term>-      <term name="season-04">Winter</term>+      <term name="season-01">весна</term>+      <term name="season-02">лета</term>+      <term name="season-03">осень</term>+      <term name="season-04">зима</term>    </terms> </locale>
locales/locales-sl-SI.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>+      <term name="close-quote">“</term>+      <term name="open-inner-quote">‚</term>+      <term name="close-inner-quote">‘</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-sr-RS.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">„</term>+      <term name="close-quote">“</term>+      <term name="open-inner-quote">‚</term>+      <term name="close-inner-quote">‘</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-sv-SE.xml view
@@ -55,9 +55,10 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">”</term>       <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>+      <term name="open-inner-quote">’</term>       <term name="close-inner-quote">’</term>        <!-- ORDINALS -->
locales/locales-tr-TR.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>+      <term name="open-inner-quote">‹</term>+      <term name="close-inner-quote">›</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-uk-UA.xml view
@@ -55,8 +55,10 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <!-- (Single quote added without authority) -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>       <term name="open-inner-quote">‘</term>       <term name="close-inner-quote">’</term> 
locales/locales-vi-VN.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">«</term>+      <term name="close-quote">»</term>+      <term name="open-inner-quote">‹</term>+      <term name="close-inner-quote">›</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
locales/locales-zh-TW.xml view
@@ -55,10 +55,11 @@       <term name="bc">BC</term>        <!-- QUOTES -->-      <term name="open-quote">“</term>-      <term name="close-quote">”</term>-      <term name="open-inner-quote">‘</term>-      <term name="close-inner-quote">’</term>+	  <!-- Source: http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks -->+      <term name="open-quote">「</term>+      <term name="close-quote">」</term>+      <term name="open-inner-quote">『</term>+      <term name="close-inner-quote">』</term>        <!-- ORDINALS -->       <term name="ordinal-01">st</term>
src/Text/CSL.hs view
@@ -26,8 +26,12 @@        -- * Reading Bibliographic Databases       readBiblioFile+    , BibFormat (..)+    , readBiblioString     , readModsFile     , readModsCollectionFile+    , readJsonInput+    , readJsonInputString      -- ** Reference Representation     , Reference (..)@@ -74,6 +78,7 @@ import Text.CSL.Reference import Text.CSL.Style import Text.CSL.Input.Bibutils+import Text.CSL.Input.Json import Text.CSL.Input.MODS import Text.CSL.Output.Pandoc import Text.CSL.Output.Plain
src/Text/CSL/Eval.hs view
@@ -16,6 +16,7 @@ module Text.CSL.Eval     ( evalLayout     , evalSorting+    , rtfParser     , last'     , module Text.CSL.Eval.Common     , module Text.CSL.Eval.Output@@ -44,7 +45,7 @@ evalLayout :: Layout   -> EvalMode -> Bool -> [Locale] -> [MacroMap]            -> [Option] -> Reference -> [Output] evalLayout (Layout _ _ es) em b l m o r-    = cleanOutput result+    = cleanOutput evalOut     where       evalOut = case evalState job initSt of                   [] -> if (isSorting $ em)@@ -52,16 +53,6 @@                         else [noOutputError]                   x | title r == citeId cit ++ " not found!" -> [noBibDataError $ cit]                     | otherwise                              -> x-      addAff f x c = case f c of-                       PlainText  []    -> []-                       PlainText  p | x -> [Output (rtfParser emptyFormatting p) emptyFormatting, OSpace]-                       PlainText  p     -> [OSpace, Output (rtfParser emptyFormatting p) emptyFormatting]-                       PandocText []    -> []-                       PandocText p | x -> [OPan p, OSpace]-                       PandocText p     -> [OPan p]-      result  = case em of-                  EvalCite c -> addAff citePrefix True c ++ evalOut ++ addAff citeSuffix False c-                  _          -> evalOut       locale = case l of                  [x] -> x                  _   -> Locale [] [] [] [] []@@ -71,7 +62,7 @@                  EvalSorting c -> c                  EvalBiblio  s -> emptyCite { citePosition = s }       initSt = EvalState (mkRefMap r) (Env cit (localeTermMap locale) m-                         (localeDate locale) o []) [] em b False [] False [] [] []+                         (localeDate locale) o []) [] em b False [] [] False [] [] []  evalSorting :: EvalMode -> [Locale] -> [MacroMap] -> [Option] -> [Sort] -> Reference -> [Sorting] evalSorting m l ms opts ss r@@ -105,7 +96,7 @@ evalElement el     | Choose i ei e         <- el = evalIfThen i ei e     | Macro    s   fm       <- el = return . appendOutput fm =<< evalElements =<< getMacro s-    | Const    s   fm       <- el = return $ rtfParser fm $ unescape s+    | Const    s   fm       <- el = return $ rtfParser fm s     | Number   s f fm       <- el = formatNumber f fm =<< getStringVar s     | Variable s f fm d     <- el = return . addDelim d =<< concatMapM (getVariable f fm) s     | Group        fm d l   <- el = when' ((/=) [] <$> tryGroup l) $@@ -115,7 +106,7 @@     | Term     s f fm p     <- el = formatLabel f fm p s     | Names    s n fm d sub <- el = modify (\st -> st { contNum = [] }) >>                                     ifEmpty (evalNames False s n d)-                                            (withNames el $ evalElements sub)+                                            (withNames s el $ evalElements sub)                                             (appendOutput fm)     | Substitute (e:els)    <- el = ifEmpty (consuming $ evalElement e)                                             (getFirst els) id@@ -136,10 +127,12 @@        ifEmpty p t e = p >>= \r -> if r == [] then t else return (e r) -      withNames n f = modify (\s -> s { env = (env s)-                                        {names = n : names (env s)}}) >> f >>= \r ->-                      modify (\s -> s { env = (env s)-                                        {names = tail $ names (env s)}}) >> return r+      withNames e n f = modify (\s -> s { authSub = concat e+                                        , env = (env s)+                                          {names = n : names (env s)}}) >> f >>= \r ->+                        modify (\s -> s { authSub = []+                                        , env = (env s)+                                          {names = tail $ names (env s)}}) >> return r        getFirst        [] = return []       getFirst    (x:xs) = whenElse ((/=) []  <$> evalElement x)@@ -239,8 +232,10 @@       parser = parseText <|> parseMarkup        parseText = do+        let amper = string "&" >> notFollowedBy (char '#') >>+                    return [OStr "&" emptyFormatting]         x  <- many $ noneOf "<'\"`“‘&"-        xs <- parseQuotes <|> parseMarkup+        xs <- parseQuotes <|> parseMarkup <|> amper         r  <- manyTill anyChar eof         return (OStr x emptyFormatting : xs ++                 [Output (rtfParser emptyFormatting r) emptyFormatting])@@ -355,9 +350,12 @@     where       (a,b) = expandedRange sa sb       res   = if length a == length b-              then second (filter (/= '+')) $ unzip $-                   zipWith (\x y -> if x == y then (x,'+') else (x,y)) a b+              then second (filter (/= '+')) $ unzip $ doit a b               else (a,b)+      doit (x:xs) (y:ys) = if x == y+                           then (x,'+') : doit xs ys+                           else zip (x:xs) (y:ys)+      doit _      _      = []  chicagoRange :: String -> String -> (String, String) chicagoRange sa sb@@ -366,7 +364,7 @@           | '0':'0':_ <- sa' -> expandedRange sa sb           | _  :'0':_ <- sa' -> minimalRange  sa sb           | _  :a2:as <- sa'-          , b1:b2:bs  <- sb'+          , b1 :b2:bs <- sb'           , comp as bs       -> if a2 == b2                                 then (sa, [b2,b1])                                 else minimalRange sa sb@@ -381,12 +379,6 @@         sb' = reverse sb         comp a b = let b' = takeWhile isDigit b                    in take (length b') a == b'--unescape :: String -> String-unescape [] = []-unescape ('&':'l':'t':';':xs) = "<" ++ unescape xs-unescape ('&':'g':'t':';':xs) = ">" ++ unescape xs-unescape (x              :xs) = x    : unescape xs  last' :: [a] -> [a] last' = foldl (\_ x -> [x]) []
src/Text/CSL/Eval/Common.hs view
@@ -33,6 +33,7 @@       , mode     :: EvalMode       , disamb   :: Bool       , consume  :: Bool+      , authSub  :: String       , consumed :: [String]       , edtrans  :: Bool       , etal     :: [[Output]]
src/Text/CSL/Eval/Date.hs view
@@ -17,6 +17,9 @@  import Control.Applicative ( (<$>) ) import Control.Monad.State+import Data.Char+import Data.List+import Data.Maybe  import Text.CSL.Eval.Common import Text.CSL.Eval.Output@@ -44,10 +47,11 @@                                     al am an       updateS a b = if b /= a && b /= [] then b else a   case f of-    NoFormDate -> return . outputList fm dl . concatMap (formatDate em k tm dp) =<< mapM getDateVar s+    NoFormDate -> mapM getDateVar s >>= return . outputList fm dl .+                  concatMap (formatDate em k tm dp . concatMap parseRefDate)     _          -> do Date _ _ lfm ldl ldp _ <- getDate f                      let go dps = return . outputList (updateFM fm lfm) (if ldl /= [] then ldl else dl) .-                                  concatMap (formatDate em k tm dps)+                                  concatMap (formatDate em k tm dps . concatMap parseRefDate)                          update l x@(DatePart a b c d) =                              case filter ((==) a . dpName) l of                                (DatePart _ b' c' d':_) -> DatePart a (updateS  b b')@@ -80,12 +84,13 @@       end   a b = map (formatDatePart True  a) . return . last . diff a b $ dp       coda    b = map (formatDatePart False b) dp       diff  a b = filter (flip elem (diffDate a b) . dpName)-      diffDate (RefDate ya ma _ da _ _)-               (RefDate yb mb _ db _ _) = case () of-                                            _ | ya /= yb  -> ["year","month","day"]-                                              | ma /= mb  -> ["month","day"]-                                              | da /= db  -> ["day"]-                                              | otherwise -> ["year","month","day"]+      diffDate (RefDate ya ma sa da _ _)+               (RefDate yb mb sb db _ _) = case () of+                                             _ | ya /= yb  -> ["year","month","day"]+                                               | ma /= mb  -> ["month","day"]+                                               | da /= db  -> ["day"]+                                               | sa /= sb  -> ["month"]+                                               | otherwise -> ["year","month","day"]        term f t = let f' = if f `elem` ["verb", "short", "verb-short", "symbol"]                           then read $ toRead f@@ -106,7 +111,7 @@           | "month" <- n, m /= [] = output (fm {suffix = []}) (formatMonth f m) ++ formatDelim           | "day"   <- n, d /= [] = output (fm {suffix = []}) (formatDay   f d) ++ formatDelim           | "month" <- n, m == []-                        , e /= [] = output (fm {suffix = []}) $ term f ("season-0" ++ e)+                        , e /= [] = output (fm {suffix = []}) (term f $ "season-0" ++ e) ++ formatDelim           where             formatDelim = if rd == "-" then [OPan [EnDash]] else [OPan [Str rd]] @@ -168,3 +173,36 @@     where       num    = readNum s       term t = maybe [] fst $ lookup ("long-ordinal-" ++ t, Long) tm+++parseRefDate :: RefDate -> [RefDate]+parseRefDate r@(RefDate _ _ _ _ o c)+    = if null o then return r+      else let (a,b) = break (== '-') o+           in  if null b then return (parseRaw o) else [parseRaw a, parseRaw b]+    where+      parseRaw str =+          case words $ check str of+            [y']       | and (map isDigit y') -> RefDate y' [] [] [] o c+            [s',y']    | and (map isDigit y')+                       , and (map isDigit s') -> RefDate y' s' [] [] o c+            [s',y']    | s' `elem'` seasons   -> RefDate y' [] (select s' seasons) [] o []+            [s',y']    | s' `elem'` months    -> RefDate y' (select s'  months) [] [] o c+            [s',d',y'] | and (map isDigit s')+                       , and (map isDigit y')+                       , and (map isDigit d') -> RefDate y' s' [] d' o c+            [s',d',y'] | s' `elem'` months+                       , and (map isDigit y')+                       , and (map isDigit d') -> RefDate y' (select s'  months) [] d' o c+            [s',d',y'] | s' `elem'` months+                       , and (map isDigit y')+                       , and (map isDigit d') -> RefDate y' (select s'  months) [] d' o c+            _                                 -> r+      check []     = []+      check (x:xs) = if x `elem` ",/-" then ' ' : check xs else x : check xs+      select     x = show . (+ 1) . fromJust . elemIndex' x+      elem'      x = elem      (map toLower $ take 3 x)+      elemIndex' x = elemIndex (map toLower $ take 3 x)++      months   = ["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"]+      seasons  = ["spr","sum","fal","win"]
src/Text/CSL/Eval/Names.hs view
@@ -17,12 +17,13 @@  import Control.Applicative ( (<$>) ) import Control.Monad.State-import Data.Char ( toUpper, isLower, isSpace )-import Data.List ( nub )+import Data.Char  ( toUpper, isLower, isSpace )+import Data.List  ( nub )+import Data.Maybe ( isJust )  import Text.CSL.Eval.Common import Text.CSL.Eval.Output-import Text.CSL.Output.Plain+import Text.CSL.Output.Plain ( (<>) ) import Text.CSL.Parser ( toRead ) import Text.CSL.Reference import Text.CSL.Style@@ -45,6 +46,7 @@         k   <- getStringVar "ref-id"         p   <- gets (citePosition . cite . env)         ops <- gets (options . env)+        aus <- gets authSub         r   <- if s == "author" && ags /= [] && p == "subsequent" &&                   isOptionSet "subsequent-author-substitute" ops                then return $ output emptyFormatting $@@ -54,8 +56,9 @@                        fb  <- agents "subsequent" s ags                        put st                        if res /= []-                          then return . return . OContrib k s res fb =<< gets etal-                          else return []+                          then let role = if aus == "author" then aus ++ "sub" else s+                               in  return . return . OContrib k role res fb =<< gets etal+                          else     return []         r'  <- evalNames skipEdTrans xs nl d         num <- gets contNum         return $ if r /= [] && r' /= []@@ -235,52 +238,61 @@     | Short     <- f = return $ OName (show n)  shortName       disambdata fm     | otherwise      = return $ OName (show n) (longName given) disambdata fm     where+      when_ c o = if c /= [] then o else []+      addAffixes s sf ns = [Output ((OStr s (form sf) { prefix = [], suffix = [] }) : ns) $+                                   emptyFormatting { prefix = prefix (form sf)+                                                   , suffix = suffix (form sf)}]+       form    s = case filter (\(NamePart n' _) -> n' == s) np of-                    NamePart _ fm':_ -> fm' { prefix = []-                                            , suffix = [] }+                    NamePart _ fm':_ -> fm'                     _                -> emptyFormatting        hasHyphen = not . null . filter (== '-')       hyphen    = if getOptionVal "initialize-with-hyphen" ops == "false"                   then getOptionVal "initialize-with" ops                   else filter (not . isSpace) $ getOptionVal "initialize-with" ops  ++ "-"-      initial x = if getOptionVal "initialize-with" ops /= [] && (not . and . map isLower $ x)-                  then addIn x $ getOptionVal "initialize-with" ops+      initial x = if isJust (lookup "initialize-with" ops)+                  then if not . and . map isLower $ x+                       then addIn x $ getOptionVal "initialize-with" ops+                       else " " ++ case x of+                                     _:'\'':[] -> x+                                     _         -> x ++ " "                   else " " ++ x       addIn x i = if hasHyphen x                   then head (       takeWhile (/= '-') x) : hyphen ++                        head (tail $ dropWhile (/= '-') x) : i                   else head x : i -      sortSepar = if getOptionVal "sort-separator" ops == []-                  then [OStr "," (form "family"),OSpace]-                  else [OStr (getOptionVal "sort-separator" ops) (form "family")]-      dropping  = if    droppingPart n /= [] then [OStr (   droppingPart n) (form "family")] else []-      nonDrop   = if nonDroppingPart n /= [] then [OStr (nonDroppingPart n) (form "family")] else []+      sortSep g s = when_ g $ separator ++ addAffixes (g <+> s) "given" []+      separator   = if getOptionVal "sort-separator" ops == []+                    then oStr "," ++ [OSpace]+                    else oStr (getOptionVal "sort-separator" ops)        suff      = if commaSuffix n && nameSuffix n /= []                   then suffCom                   else suffNoCom-      when_ c o = if c /= [] then o else []-      suffCom   = when_ (nameSuffix n) [OStr (", " ++ nameSuffix n) fm]-      suffNoCom = when_ (nameSuffix n) [OSpace,OStr (nameSuffix n) fm]-      given     = when_ (givenName  n) [OStr (unwords' . map initial $ givenName n) (form "given")]-      givenLong = when_ (givenName  n) [OStr (unwords' $ givenName n) (form "given")]-      givenInit = when_ (givenName  n) [OStr (unwords' . map initial $ givenName n) (form "given")]-      family    = when_ (familyName n) [OStr (familyName n) (form "family")]+      suffCom   = when_ (nameSuffix n) $ separator ++ [        OStr (nameSuffix n) fm]+      suffNoCom = when_ (nameSuffix n) $              [OSpace, OStr (nameSuffix n) fm] -      shortName = nonDrop <++> family+      given     = when_ (givenName  n) . unwords . words . concatMap initial $ givenName n+      givenLong = when_ (givenName  n) . unwords' $ givenName n+      family    = familyName n++      shortName = [OStr (nonDroppingPart n <+> family) (form "family")]       longName g = if isSorting m-                   then case getOptionVal "demote-non-dropping-particle" ops of-                          "never"     -> nonDrop <++> family <++> dropping <++> g ++ suffCom-                          _           -> family <++> dropping <++> nonDrop <++> g ++ suffCom+                   then let firstPart = case getOptionVal "demote-non-dropping-particle" ops of+                                           "never" -> nonDroppingPart n <+> family  <+> droppingPart n+                                           _       -> family  <+> droppingPart n <+> nonDroppingPart n+                        in [OStr firstPart (form "family")] <++> [OStr g (form "given")] ++ suffCom                    else if (b && getOptionVal "name-as-sort-order" ops == "first") ||                            getOptionVal "name-as-sort-order" ops == "all"-                        then case getOptionVal "demote-non-dropping-particle" ops of-                               "never"     -> nonDrop <++> family ++ sortSepar ++ g <++> dropping ++ suffCom-                               "sort-only" -> nonDrop <++> family ++ sortSepar ++ g <++> dropping ++ suffCom-                               _           -> family ++ sortSepar ++ g <++> dropping <++> nonDrop ++ suffCom-                        else g <++> dropping <++> nonDrop <++> family ++ suff+                        then let (fam,par) = case getOptionVal "demote-non-dropping-particle" ops of+                                               "never"     -> (nonDroppingPart n <+> family, droppingPart n)+                                               "sort-only" -> (nonDroppingPart n <+> family, droppingPart n)+                                               _           -> (family, droppingPart n <+> nonDroppingPart n)+                             in OStr fam (form "family") : sortSep g par ++ suffCom+                          else oStr' g (form "given") <++>+                               addAffixes (droppingPart n <+> nonDroppingPart n <+> family) "family" suff        disWithGiven = getOptionVal "disambiguate-add-givenname" ops == "true"       initialize   = not . null . getOptionVal "initialize-with" $ ops@@ -288,15 +300,15 @@       givenRule    = getOptionVal "givenname-disambiguation-rule" ops       disambdata   = case () of                        _ | "all-names-with-initials"    <- givenRule-                         , disWithGiven, Short <- f, initialize    -> [longName givenInit]+                         , disWithGiven, Short <- f, initialize    -> [longName given]                          | "primary-name-with-initials" <- givenRule-                         , disWithGiven, Short <- f, initialize, b -> [longName givenInit]+                         , disWithGiven, Short <- f, initialize, b -> [longName given]                          | disWithGiven, Short <- f, b-                         , "primary-name" <- givenRule -> [longName givenInit, longName givenLong]+                         , "primary-name" <- givenRule -> [longName given, longName givenLong]                          | disWithGiven, Short <- f-                         , "all-names"    <- givenRule -> [longName givenInit, longName givenLong]+                         , "all-names"    <- givenRule -> [longName given, longName givenLong]                          | disWithGiven, Short <- f-                         , "by-cite"      <- givenRule -> [longName givenInit, longName givenLong]+                         , "by-cite"      <- givenRule -> [longName given, longName givenLong]                          | disWithGiven, isLong        -> [longName givenLong]                          | otherwise                   -> [] @@ -326,3 +338,10 @@       form  g t b = return . output fm =<< g . period <$> getTerm (b && p) f t       period      = if stripPeriods fm then filter (/= '.') else id       capital   x = toUpper (head x) : (tail x)++(<+>) :: String -> String -> String+[] <+> ss = ss+s  <+> [] = s+s  <+> ss = if last s == '\''+            then init s ++ "’" ++ ss+            else      s ++ " " ++ ss
src/Text/CSL/Eval/Output.hs view
@@ -15,6 +15,7 @@  module Text.CSL.Eval.Output where +import Text.CSL.Output.Plain import Text.CSL.Style  output :: Formatting -> String -> [Output]@@ -46,7 +47,12 @@     where       check x xs           | ONull <- x = xs-          | otherwise  = x : ODel d : xs+          | otherwise  = let text = renderPlainStrict $ formatOutputList [x]+                         in  if d /= [] && text /= []+                             then if head d == last text && head d `elem` ".,;:!?"+                                  then x : ODel (tail d) : xs+                                  else x : ODel       d  : xs+                             else      x : ODel       d  : xs  noOutputError :: Output noOutputError = OStr "[CSL STYLE ERROR: reference with no printed form.]" emptyFormatting@@ -54,6 +60,13 @@ noBibDataError :: Cite -> Output noBibDataError c = OStr ("[CSL BIBLIOGRAPHIC DATA ERROR: reference " ++ show (citeId c) ++ " not found.]")                    emptyFormatting++oStr :: String -> [Output]+oStr s = oStr' s emptyFormatting++oStr' :: String -> Formatting -> [Output]+oStr' [] _ = []+oStr' s  f = [OStr s f]  (<++>) :: [Output] -> [Output] -> [Output] [] <++> o  = o
src/Text/CSL/Input/Bibutils.hs view
@@ -13,10 +13,13 @@  module Text.CSL.Input.Bibutils     ( readBiblioFile+    , readBiblioString+    , BibFormat (..)     ) where  import Data.Char import System.FilePath ( takeExtension )+import Text.CSL.Pickle import Text.CSL.Reference import Text.CSL.Input.Json import Text.CSL.Input.MODS@@ -40,8 +43,7 @@ readBiblioFile f     = case getExt f of         ".mods"    -> readBiblioFile' f mods_in-        ".bib"     -> readBiblioFile' f bibtex_in-        ".bbx"     -> readBiblioFile' f biblatex_in+        ".bib"     -> readBiblioFile' f biblatex_in         ".ris"     -> readBiblioFile' f ris_in         ".enl"     -> readBiblioFile' f endnote_in         ".xml"     -> readBiblioFile' f endnotexml_in@@ -60,10 +62,44 @@                                     "citeproc-hs was not compiled with bibutils support." #endif -getExt :: String -> String-getExt = takeExtension . map toLower+data BibFormat+    = Mods+    | Json+#ifdef USE_BIBUTILS+    | Bibtex+    | BibLatex+    | Ris+    | Endnote+    | EndnotXml+    | Isi+    | Medline+    | Copac+#endif +readBiblioString :: BibFormat -> String -> IO [Reference]+readBiblioString b s+    | Mods      <- b = return $ readXmlString xpModsCollection s+    | Json      <- b = return $ readJsonInputString s #ifdef USE_BIBUTILS+    | Bibtex    <- b = go bibtex_in+    | BibLatex  <- b = go biblatex_in+    | Ris       <- b = go ris_in+    | Endnote   <- b = go endnote_in+    | EndnotXml <- b = go endnotexml_in+    | Isi       <- b = go isi_in+    | Medline   <- b = go medline_in+    | Copac     <- b = go copac_in+#endif+    | otherwise      = error "in readBiblioString"+#ifdef USE_BIBUTILS+    where+      go f = withTempDir "citeproc" $ \tdir -> do+               let tfile = tdir </> "bibutils-tmp.biblio"+               writeFile tfile s+               readBiblioFile' tfile f+#endif++#ifdef USE_BIBUTILS readBiblioFile' :: FilePath -> BiblioIn -> IO [Reference] readBiblioFile' fin bin     | bin == mods_in = readModsCollectionFile fin@@ -97,3 +133,6 @@                then createTempDir (num + 1) baseName                else ioError e #endif++getExt :: String -> String+getExt = takeExtension . map toLower
src/Text/CSL/Input/Json.hs view
@@ -9,116 +9,63 @@ -- Stability   :  unstable -- Portability :  unportable ----- A module for reading Frank's citeproc-js testsuite.+-- A module for reading Json CSL data. -- ----------------------------------------------------------------------------- -module Text.CSL.Input.Json-    ( toTest-    , runTS-    , test, test',test_-    , runTest-    , Test (..)-    , mapJSArray-    , readJsonInput-    ) where+module Text.CSL.Input.Json where  import Control.Arrow import Control.Monad.State import Data.Generics import Data.Char (toLower, toUpper)-import Foreign-import Data.IORef import Data.List-import Data.Maybe (isJust) import Data.Ratio-import Data.Time-import System.Directory-import System.Locale -import Text.ParserCombinators.Parsec- import Text.JSON.Generic import Text.JSON.String ( runGetJSON, readJSTopType ) -import Paths_citeproc_hs ( getDataFileName )-import Text.CSL.Output.Pandoc-import Text.CSL.Output.Plain import Text.CSL.Reference-import Text.CSL.Pickle ( readXmlString-                       , readXmlFile      )-import Text.CSL.Parser ( xpStyle, xpLocale, langBase)-import Text.CSL.Proc import Text.CSL.Style-import Text.Pandoc.Definition -data Test-    = Test-      { testMode      :: String-      , testInput     :: [Reference]-      , testCSL       :: Style-      , testResult    :: String-      , testBibSect   :: BibOpts-      , testCitItems  :: Maybe Citations-      , testCitations :: Maybe Citations-      } deriving ( Show )--toTest :: JSValue -> Test-toTest ob = Test mode input style result bibsection cites cites'-    where-      getObj f = case procJSObject f ob of-                   JSObject o -> fromJSObject o-                   _          -> error "error #217"-      object  = getObj id-      objectI = getObj editJsonInput-      objectC = getObj editJsonCiteItems--      look s = case lookup s object of-                 Just (JSString x) -> fromJSString x-                 _                 -> error $ "in test " ++ s ++ " section."-      style  = readXmlString xpStyle $ look "csl"-      mode   = look "mode"-      result = look "result"+readJsonInput :: FilePath -> IO [Reference]+readJsonInput f = readJsonInputString `fmap` readFile f -      bibsection = case lookup "bibsection" objectI of-                     Just (JSObject o) -> getBibOpts $ fromJSObject o-                     _                 -> Select [] []+readJsonInputString :: String -> [Reference]+readJsonInputString s+    = let jrefs  =  procJSObject editJsonInput $ readJsonString s+          refs r = case readJSData r of+                     Ok ref   -> ref+                     Error er -> error ("readJSData: " ++ er)+      in case jrefs of+           JSObject o -> map (refs . snd) $ fromJSObject o+           JSArray ar -> map (refs      ) $ ar+           _          -> error $ "citeproc: error in reading the Json bibliographic data." -      cites  = case lookup "citation_items" objectC of-                 Just (JSArray cs) -> Just $ map readCite cs-                 _                 -> Nothing-      cites'  = case lookup "citations" objectC of-                 Just (JSArray cs) -> Just $ map readJsonCitations cs-                 _                 -> Nothing-      readCite c = case readJSData c of-                     Ok cite  -> cite-                     Error er -> error ("citationItems: " ++ er)+readJsonFile :: FilePath -> IO JSValue+readJsonFile f = readJsonString `fmap` readFile f -      refs r = case readJSData r of-                 Ok ref   -> ref-                 Error er -> error ("readJSData: " ++ er)+readJsonString :: String -> JSValue+readJsonString =+  let rmCom = unlines . filter (\x -> not (" *" `isPrefixOf` x || "/*" `isPrefixOf` x)) . lines+  in  either error id . runGetJSON readJSTopType . rmCom -      input  = case lookup "input" objectI of-                 Just (JSArray ar) -> map refs ar-                 _                 -> error $ "in test input section."-      getFieldValue o-          | JSObject os <- o-          , [("field",JSString f),("value",JSString v)] <- fromJSObject os-                       = (fromJSString f, fromJSString v)-          | otherwise  = error "bibsection: could not parse fields and values"-      getBibOpts o = let getSec s = case lookup s o of-                                      Just (JSArray ar) -> map getFieldValue ar-                                      _                 -> []-                         select  = getSec "select"-                         include = getSec "include"-                         exclude = getSec "exclude"-                         quash   = getSec "quash"-                     in case () of-                          _ | select  /= [] -> Select  select  quash-                            | include /= [] -> Include include quash-                            | exclude /= [] -> Exclude exclude quash-                            | quash   /= [] -> Select  []      quash-                            | otherwise     -> Select  []      []+readJsonCitations :: JSValue -> [Cite]+readJsonCitations jv+    | JSArray (JSObject o:_) <- jv+    , Just    (JSArray   ar) <- lookup "citationItems" (fromJSObject o )+    , Just    (JSObject  o') <- lookup "properties"    (fromJSObject o )+    , idx                    <- lookup "noteIndex"     (fromJSObject o')+                = map (readCite $ readCitNum $ fmap toString idx) ar+    | otherwise = error ("error in reading CITATIONS:\n" ++ show jv)+    where+      readCitNum j+          | Just (JSString js) <- j = fromJSString js+          | otherwise               = []+      readCite :: String -> JSValue -> Cite+      readCite n c = case readJSData c of+                       Ok cite  -> cite { citeNoteNumber = n }+                       Error er -> error ("citations: " ++ er)  editJsonCiteItems :: (String, JSValue) -> (String, JSValue) editJsonCiteItems (s,j)@@ -192,23 +139,6 @@                                                           ,JSObject . toJSObject        $ zipDate y']                         _                              -> [JSObject . toJSObject $ rest []] -readJsonCitations :: JSValue -> [Cite]-readJsonCitations jv-    | JSArray (JSObject o:_) <- jv-    , Just    (JSArray   ar) <- lookup "citationItems" (fromJSObject o )-    , Just    (JSObject  o') <- lookup "properties"    (fromJSObject o )-    , idx                    <- lookup "noteIndex"     (fromJSObject o')-                = map (readCite $ readCitNum $ fmap toString idx) ar-    | otherwise = error ("error in reading CITATIONS:\n" ++ show jv)-    where-      readCitNum j-          | Just (JSString js) <- j = fromJSString js-          | otherwise               = []-      readCite :: String -> JSValue -> Cite-      readCite n c = case readJSData c of-                       Ok cite  -> cite { citeNoteNumber = n }-                       Error er -> error ("citations: " ++ er)- toString :: JSValue -> JSValue toString x     | JSString    js <- x = JSString js@@ -290,186 +220,3 @@       emptyRefDate = toJSON $ RefDate [] [] [] [] [] []       emptyPerson  = toJSON $ Agent   [] [] [] [] [] [] False       emptyCite'   = toJSON $ emptyCite--readJsonFile :: FilePath -> IO JSValue-readJsonFile f = readJsonString `fmap` readFile f--readJsonString :: String -> JSValue-readJsonString =-  let rmCom = unlines . filter (\x -> not (" *" `isPrefixOf` x || "/*" `isPrefixOf` x)) . lines-  in  either error id . runGetJSON readJSTopType . rmCom--readJsonInput :: FilePath -> IO [Reference]-readJsonInput f = do-  js <- readJsonFile f-  let jrefs  =  procJSObject editJsonInput js-      refs r = case readJSData r of-                 Ok ref   -> ref-                 Error er -> error ("readJSData: " ++ er)-  case jrefs of-    JSObject o -> return . map (refs . snd) $ fromJSObject o-    JSArray ar -> return . map (refs      ) $ ar-    _          -> error $ "citeproc: error in reading the Json bibliographic data."--readTestFile :: FilePath -> IO JSValue-readTestFile f = do-  s <- readFile f-  let fields = ["CSL","RESULT","MODE","INPUT","CITATION-ITEMS","CITATIONS","BIBSECTION","BIBENTRIES"]-      format = map (toLower . \x -> if x == '-' then '_' else x)-  return . toJson . zip (map format fields) . map (fieldsParser s) $ fields--toJson :: [(String,String)] -> JSValue-toJson = JSObject . toJSObject . map getIt-    where-      getIt (s,j)-          | s `elem` ["result","csl","mode"] = (,) s . JSString $ toJSString j-          | s `elem` ["bibentries"]          = (,) s . JSBool   $ False-          | j == []                          = (,) s . JSBool   $ False-          | otherwise                        = (,) s . either error id . resultToEither $ decode j--fieldsParser :: String -> String -> String-fieldsParser s f = either (const []) id $ parse (fieldParser f) "" s--fieldParser :: String -> Parser String-fieldParser s = manyTill anyChar (try $ fieldMarkS) >>-                manyTill anyChar (try $ fieldMarkE)-    where-      fieldMarkS = string   ">>" >> many (oneOf "= ") >> string s >> many (oneOf "= ") >> string ">>\n"-      fieldMarkE = string "\n<<" >> many (oneOf "= ") >> string s >> many (oneOf "= ") >> string "<<\n"--pandocBib :: [String] -> String-pandocBib [] = []-pandocBib s-    = "<div class=\"csl-bib-body\">\n" ++-      concatMap (\x -> "  " ++ "<div class=\"csl-entry\">" ++ x ++ "</div>\n") s ++-      "</div>"--pandocToHTML :: [Inline] -> String-pandocToHTML [] = []-pandocToHTML (i:xs)-    | Str          s <- i = (entityToChar $ check s) ++ pandocToHTML xs-    | Emph        is <- i = "<i>" ++ pandocToHTML is ++ "</i>" ++ pandocToHTML xs-    | SmallCaps   is <- i = "<span style=\"font-variant:small-caps;\">" ++ pandocToHTML is ++ "</span>" ++ pandocToHTML xs-    | Strong      is <- i = "<b>" ++ pandocToHTML is ++ "</b>" ++ pandocToHTML xs-    | Superscript is <- i = "<sup>" ++ pandocToHTML is ++ "</sup>" ++ pandocToHTML xs-    | Subscript   is <- i = "<sub>" ++ pandocToHTML is ++ "</sub>" ++ pandocToHTML xs-    | Space          <- i = " " ++ pandocToHTML xs-    | EnDash         <- i = "–" ++ pandocToHTML xs-    | Ellipses       <- i = "…" ++ pandocToHTML xs-    | Quoted    t is <- i = case t of-                              DoubleQuote -> "“" ++ pandocToHTML is ++ "”" ++ pandocToHTML xs-                              SingleQuote -> "‘" ++ pandocToHTML is ++ "’" ++ pandocToHTML xs-    | Link     is x  <- i = case snd x of-                              "emph"     -> "<span style=\"font-style:normal;\">" ++-                                            pandocToHTML is ++ "</span>" ++ pandocToHTML xs-                              "strong"   -> "<span style=\"font-weight:normal;\">" ++-                                            pandocToHTML is ++ "</span>" ++ pandocToHTML xs-                              "nodecor"  -> "<span style=\"font-variant:normal;\">" ++-                                            pandocToHTML is ++ "</span>" ++ pandocToHTML xs-                              "baseline" -> "<span style=\"baseline\">" ++-                                            pandocToHTML is ++ "</span>" ++ pandocToHTML xs-                              _          -> pandocToHTML is ++ pandocToHTML xs--    | otherwise           = []-    where-      check ('&':[]) = "&amp;"-      check ('<':ys) = "&lt;" ++ check ys-      check ('>':ys) = "&gt;" ++ check ys-      check (y  :ys) = y : check ys-      check []       = []--unlines' :: [String] -> String-unlines'    []     = []-unlines' (x:[])    = x-unlines' (x:xs)    = x ++ "\n" ++ unlines' xs--localeCache :: IORef [(String, Locale)]-localeCache = unsafePerformIO $ newIORef []--getCachedLocale :: String -> IO [Locale]-getCachedLocale n = maybe [] return `fmap` lookup n `fmap` readIORef localeCache--putCachedLocale :: String -> Locale -> IO ()-putCachedLocale n t = modifyIORef localeCache $ \l -> (n, t) : l--runTest :: Test -> IO (Bool,String)-runTest t = do-  let locale = case styleDefaultLocale $ testCSL t of-                 x | length x == 2 -> maybe (error $ x ++ " doesn't seem a valid locale")-                                      id (lookup x langBase)-                   | otherwise     -> take 5 x-  ls' <- getCachedLocale locale-  ls  <- case ls' of-           [] -> do l <- getDataFileName ("locales/locales-" ++ locale ++ ".xml")-                    r <- readXmlFile xpLocale l-                    putCachedLocale locale r-                    return r-           [x] -> return x-           _   -> return $ Locale [] [] [] [] []-  let opts   = procOpts { bibOpts = testBibSect t}-      style' = testCSL t-      style  = style' {styleLocale = mergeLocales (styleDefaultLocale style') ls $ styleLocale style'}-      cites  = case (testCitations t, testCitItems t) of-                 (Just cs, _      ) -> cs-                 (_,       Just cs) -> cs-                 _                  -> [map (\r -> emptyCite { citeId = refId r }) $ testInput t]-      (BD cits bib) = citeproc opts style (testInput t) cites-      fixCits = if isJust (testCitations t)-                then flip (zipWith $ \c n -> ">>[" ++ show n ++ "] " ++ c) ([0..] :: [Int])-                else id-      output = case testMode t of-                 "citation" -> unlines'  . fixCits . map (pandocToHTML . renderPandoc_ style) $ cits-                 _          -> pandocBib . map (pandocToHTML . renderPandoc_ style) $ bib-  return (output == testResult t, output)--test :: FilePath -> IO Bool-test = doTest readJsonFile 0--test' :: Int -> FilePath -> IO Bool-test' = doTest readJsonFile--test_ :: Int -> FilePath -> IO Bool-test_ = doTest readTestFile--doTest :: (FilePath -> IO JSValue) -> Int -> FilePath -> IO Bool-doTest rf v f = do-  when (v >= 2) $ putStrLn f-  t <- toTest `fmap` rf f-  (r,o) <- runTest t-  if r then return ()-       else do let putStrLn' = when (v >= 1) . putStrLn-               putStrLn  $ (tail .  takeWhile (/= '.') . dropWhile (/= '_')) f ++ " failed!"-               putStrLn' "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"-               putStrLn' $ f ++ " failed!"-               putStrLn' "Expected:"-               putStrLn' $ (testResult t)-               putStrLn' "\nGot:"-               putStrLn' $ o-               when (v >= 3) $ putStrLn (show t)-               putStrLn' "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"-  return r--runTS :: [String] -> Int -> FilePath -> IO ()-runTS gs v f = do-  st <- getCurrentTime-  putStrLn $ (++) (formatTime defaultTimeLocale "%H:%M:%S" st) $ " <--------------START"-  dc  <- sort `fmap` filter (isInfixOf ".json") `fmap` getDirectoryContents f-  let groupTests = map (head . map fst &&& map snd) .-                   groupBy (\x y -> fst x == fst y) .-                   map (takeWhile (/= '_') &&& tail . dropWhile (/= '_'))-      runGroups g = do putStrLn   "------------------------------------------------------------"-                       putStrLn $ "GROUP \"" ++ fst g ++ "\" has " ++ show (length $ snd g) ++ " tests to run"-                       putStrLn   "------------------------------------------------------------"-                       r' <- mapM (test' v . (++) (f ++ fst g ++ "_")) $ snd g-                       return r'-      filterGroup = if gs /= [] then filter (flip elem gs . fst) else id-  r <- mapM runGroups $ filterGroup $ groupTests dc-  putStrLn " ------------------------------------------------------------"-  putStrLn "| TEST SUMMARY:"-  putStrLn "------------------------------------------------------------"-  putStrLn $ "\t" ++ (show $ sum $ map length r) ++ " tests in " ++ (show $ length r) ++ " groups"-  putStrLn $ "\t" ++ (show $ sum $ map (length . filter id ) r) ++ " successes"-  putStrLn $ "\t" ++ (show $ sum $ map (length . filter not) r) ++ " failures"-  et <- getCurrentTime-  putStrLn $ (++) (formatTime defaultTimeLocale "%H:%M:%S" et) $ " <--------------END"-  putStrLn $ "Time: " ++ show (diffUTCTime et st)
src/Text/CSL/Input/MODS.hs view
@@ -44,11 +44,11 @@ xpReference :: PU Reference xpReference     = xpWrap ( \ ( ref-                , (ck,ty,ti)+                , (ck,ty,ti,i,d)                 ,((au,ed,tr),(re,it,pu'),(co,ce))                 ,((di',pg,vl,is),(nu,sc,ch))                 , (di,pu,pp)-                , (ac,uri)+                , ((ac,uri),no)                  ) ->                ref { refId            = ck `betterThen` take 10 (concat $ words ti)                    , refType          = if refType ref /= NoType then refType ref else ty@@ -63,7 +63,10 @@                    , publisherPlace   = pp `betterThen` publisherPlace   ref                    , containerAuthor  = containerAuthor  ref                    , url              = uri+                   , note             = no                    , accessed         = ac+                   , isbn             = i+                   , doi              = d                    , issued           = issued        ref `betterThen` di `betterThen` di'                    , page             = page          ref `betterThen` pg                    , volume           = volume        ref `betterThen` vl@@ -76,18 +79,19 @@                                            `betterThen` (foldr (<+>) [] . map show $ pu')                    }              , \r -> (  r-                     , (refId     r, refType          r, title          r)+                     , (refId     r, refType          r, title          r, isbn r, doi r)                      ,((author    r, editor           r, translator     r)                       ,(recipient r, interviewer      r, emptyAgents     )                       ,(composer  r, collectionEditor r))-                     ,((issued  r, page  r, volume r, issue r)-                      ,(number  r, section   r, chapterNumber r))+                     ,((issued    r, page  r, volume r, issue r)+                      ,(number    r, section   r, chapterNumber r))                      , (issued    r, emptyAgents, publisherPlace r)-                     , (accessed  r, url              r)+                     ,((accessed  r, url r), note r)                      )) $       xp6Tuple (xpDefault emptyReference xpRelatedItem)-               (xpTriple  xpCiteKey xpRefType xpTitle )-                xpAgents xpPart xpOrigin xpUrl+               (xp5Tuple  xpCiteKey xpRefType xpTitle xpIsbn xpDoi)+                xpAgents xpPart xpOrigin+                (xpPair xpUrl xpNote)  xpCiteKey :: PU String xpCiteKey@@ -221,10 +225,11 @@     | otherwise                 = parse gn  ""         False     where       parse g s b = Agent (getGiven g) (getDrop g) (getNonDrop fn) (getFamily fn) s [] b-      getDrop     = unwords . filter (and . map isLower)-      getGiven    = filter (not . and . map isLower)-      getNonDrop  = getDrop . words-      getFamily   = unwords . getGiven . words+      setInit   s = if length s == 1 then s ++ "." else s+      getDrop     = unwords     . reverse . takeWhile (and . map isLower) . reverse+      getGiven    = map setInit . reverse . dropWhile (and . map isLower) . reverse+      getNonDrop  = unwords . takeWhile (and . map isLower) . words+      getFamily   = unwords . dropWhile (and . map isLower) . words  xpNameData :: PU ([String],String) xpNameData@@ -294,6 +299,19 @@       xpPair (xpWrap (readDate,show) $               xpDefault [] $ xpAttr "dateLastAccessed" xpText)              (xpDefault [] $ xpElem "url"              xpText)++xpIsbn :: PU String+xpIsbn = xpDefault [] $ xpIdentifier "isbn"++xpDoi :: PU String+xpDoi = xpDefault [] $ xpIdentifier "doi"++xpIdentifier :: String -> PU String+xpIdentifier i+    = xpIElem "identifier" $ xpAddFixedAttr "type" i xpText++xpNote :: PU (String)+xpNote = xpDefault [] $ xpIElem "note" xpText  readDate :: String -> [RefDate] readDate s = if takeWhile isDigit s /= []
src/Text/CSL/Parser.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE PatternGuards, CPP #-}+{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- |@@ -16,12 +17,20 @@  module Text.CSL.Parser where -import Paths_citeproc_hs ( getDataFileName ) import Text.CSL.Reference ( readNum ) import Text.CSL.Style import Text.CSL.Pickle+#ifdef EMBED_DATA_FILES+import Data.FileEmbed+import qualified Data.ByteString as BS+import Data.ByteString.UTF8 ( toString )+#else+import Paths_citeproc_hs ( getDataFileName )+import System.Directory  ( doesFileExist   )+#endif  import Data.Char        ( isUpper, toUpper, toLower )+import Data.Maybe       ( catMaybes                 )  #ifdef USE_NETWORK import Network.HTTP ( getResponseBody, mkRequest, RequestMethod(..) )@@ -49,14 +58,37 @@   l <- readLocaleFile (styleDefaultLocale s)   return s { styleLocale = mergeLocales (styleDefaultLocale s) l (styleLocale s)} ++#ifdef EMBED_DATA_FILES+localeFiles :: [(FilePath, BS.ByteString)]+localeFiles = $(embedDir "locales/")+#endif+ readLocaleFile :: String -> IO Locale readLocaleFile s = do+#ifdef EMBED_DATA_FILES   f <- case s of+         x | length x == 2 -> let fn = ("locales-" +++                                        maybe (error $ x ++ " doesn't seem a valid locale")+                                        id (lookup x langBase) ++ ".xml")+                              in case lookup fn localeFiles of+                                   Just x' -> return x'+                                   _       -> error "could not load the locale file"+            | otherwise     -> case lookup ("locales-" ++ take 5 x ++ ".xml") localeFiles of+                                 Just x' -> return x'+                                 _       -> error "could not load the locale file"+  return $ readXmlString xpLocale (toString f)+#else+  f <- case s of          x | length x == 2 -> getDataFileName ("locales/locales-" ++                                                maybe (error $ x ++ " doesn't seem a valid locale")                                                id (lookup x langBase) ++ ".xml")            | otherwise     -> getDataFileName ("locales/locales-" ++ take 5 x ++ ".xml")-  readXmlFile xpLocale f+  b <- doesFileExist f+  if b+     then readXmlFile xpLocale f+     else readLocaleFile $ take 2 s+#endif  instance XmlPickler Layout where     xpickle = xpWrap (uncurry3 Layout, \(Layout f d e) -> (f,d,e)) $@@ -290,27 +322,32 @@ xpNameFormat :: PU [Option] xpNameFormat     = xpWrap (\(a,b,c,d,e) ->-                  filter ((/=) [] . snd) $ [("and",a)-                                           ,("delimiter-precedes-last",b)-                                           ,("sort-separator",c)-                                           ,("initialize-with",d)-                                           ,("name-as-sort-order",e)], const ([],[],[],[],[])) $-      xp5Tuple (xpAttrText' "and")-               (xpAttrText' "delimiter-precedes-last")-               (xpAttrText' "sort-separator")-               (xpAttrText' "initialize-with")-               (xpAttrText' "name-as-sort-order")+                  catMaybes [ checkOpt "and"                     a+                            , checkOpt "delimiter-precedes-last" b+                            , checkOpt "sort-separator"          c+                            , checkOpt "initialize-with"         d+                            , checkOpt "name-as-sort-order"      e+                            ] , const (Nothing, Nothing, Nothing, Nothing, Nothing)) $+      xp5Tuple (getOpt "and")+               (getOpt "delimiter-precedes-last")+               (getOpt "sort-separator")+               (getOpt "initialize-with")+               (getOpt "name-as-sort-order") +    where+      getOpt n = xpOption $ xpAttr n xpText+      checkOpt _ Nothing  = Nothing+      checkOpt n (Just s) = Just (n,s)  xpNameAttrs :: PU NameAttrs xpNameAttrs     = xpWrap (\((a,b,c,d,e),(f,g)) ->-                  filter ((/=) [] . snd) $ [("et-al-min",a)-                                           ,("et-al-use-first",b)-                                           ,("et-al-subsequent-min",c)-                                           ,("et-al-subsequent-use-first",d)-                                           ,("et-al-use-last",e)-                                           ,("delimiter-precedes-et-al",f)] ++ g+                  filter ((/=) [] . snd) [("et-al-min",a)+                                         ,("et-al-use-first",b)+                                         ,("et-al-subsequent-min",c)+                                         ,("et-al-subsequent-use-first",d)+                                         ,("et-al-use-last",e)+                                         ,("delimiter-precedes-et-al",f)] ++ g              , const (([],[],[],[],[]),([],[]))) $       xpPair (xp5Tuple (xpAttrText' "et-al-min")                        (xpAttrText' "et-al-use-first")@@ -419,9 +456,10 @@     = xpWrap ( \((a,n,fm),d,sb)     -> Names (words a) n fm d sb              , \(Names a n fm d sb) -> ((unwords a,n,fm),d,sb)) $       xpElem "names" $ xpTriple names xpDelimiter xpickle-    where names   = xpTriple (xpAttrText "variable") xpName xpickle-          xpName  = xpChoice xpZero xpickle check-          check l = if any isName l then xpLift l else xpZero+    where names    = xpTriple (xpAttrText "variable") xpName xpickle+          xpName   = xpChoice xpZero xpickle check+          check [] = xpLift [Name NotSet emptyFormatting [] [] []]+          check  l = if any isName l then xpLift l else xpZero  xpShortNames :: PU Element xpShortNames
src/Text/CSL/Pickle.hs view
@@ -274,7 +274,7 @@ 	= do 	  t <- getCont st 	  s <- getText t-	  return (Just s, dropCont st)+	  return (Just (unescape s), dropCont st)  xpText0 :: PU String xpText0@@ -376,6 +376,13 @@  uncurry5 :: (a -> b -> c -> d -> e -> f) -> (a, b, c, d, e) -> f uncurry5 f (a,b,c,d,e) = f a b c d e++unescape :: String -> String+unescape [] = []+unescape ('&':'l':'t':    ';':xs) = "<" ++ unescape xs+unescape ('&':'g':'t':    ';':xs) = ">" ++ unescape xs+unescape ('&':'a':'m':'p':';':xs) = "&" ++ unescape xs+unescape (x:                  xs) = x    : unescape xs  readXmlString :: Show a => PU a -> String -> a readXmlString xp str =
src/Text/CSL/Proc.hs view
@@ -171,8 +171,8 @@     | otherwise = formatCits id cs     where       formatAuth   = formatOutput . localMod-      formatCits g = formatOutputList . appendOutput formatting .-                     addAffixes f . addDelim d . map localMod . g+      formatCits g = formatOutputList . appendOutput formatting . addAffixes f .+                     addDelim d . map (fst &&& localMod >>> uncurry format) . g       formatting   = if co /= []                      then emptyFormatting                      else unsetAffixes f@@ -183,6 +183,19 @@                                      then flip (,) o c { authorInText   = False                                                        , suppressAuthor = True }                                      else flip (,) o c+      format c x = if isNumStyle [x]+                   then x+                   else flip Output emptyFormatting $+                             addCiteAff citePrefix True  c ++ [x] +++                             addCiteAff citeSuffix False c+      addCiteAff g x c =+          case g c of+            PlainText  []    -> []+            PlainText  p | x -> [Output (rtfParser emptyFormatting p) emptyFormatting, OSpace]+            PlainText  p     -> [OSpace, Output (rtfParser emptyFormatting p) emptyFormatting]+            PandocText []    -> []+            PandocText p | x -> [OPan p, OSpace]+            PandocText p     -> [OPan p]  addAffixes :: Formatting -> [Output] -> [Output] addAffixes f os@@ -217,9 +230,17 @@                   x  -> case trim x of                           [] -> ONull                           x' -> Output x' emptyFormatting+      hasOutput o+          | Output [] _ <- o = [False]+          | ODel      _ <- o = [False]+          | OSpace      <- o = [False]+          | ONull       <- o = [False]+          | otherwise        = [True]       trim [] = []       trim (o:os)-          | Output ot f <- o  = Output (trim ot) f : os+          | Output ot f <- o  = if or (query hasOutput ot)+                                then Output (trim ot) f : os+                                else Output       ot  f : trim os           | ODel _      <- o  = trim os           | OSpace      <- o  = trim os           | OStr    x f <- o  = OStr x (if isPunct (prefix f)@@ -235,6 +256,8 @@                                       , OSpace, o] emptyFormatting           | OContrib _ "author"                   _ _ _ <- o = o+          | OContrib _ "authorsub"+                  _ _ _ <- o = o           | Output ot f <- o = Output (cleanOutput $ map contribOnly ot) f           | otherwise        = ONull       rmContrib [] = []@@ -243,9 +266,18 @@       rmContrib (o:os)           | Output ot f <- o = Output (rmContrib ot) f : rmContrib os           | OContrib _ "author"-                  _ _ _ <- o =     rmContrib os-          | otherwise        = o : rmContrib os-      isNumStyle = null . query authorOrDate+                  _ _ _ <- o =        rmContrib os+          | OContrib _ "authorsub"+                  _ _ _ <- o =        rmContrib os+          | otherwise        = o :    rmContrib os+      getRefTerm :: TermMap -> String+      getRefTerm t+          | (("reference", Long), (x,_)) <- t = capitalize x+          | otherwise                         = []++isNumStyle :: [Output] -> Bool+isNumStyle = null . query authorOrDate+    where       authorOrDate o           | OContrib {} <- o = ['a']           | OYear    {} <- o = ['a']@@ -253,7 +285,3 @@           | OStr     {} <- o = ['a']           | OPan     {} <- o = ['a']           | otherwise        = []-      getRefTerm :: TermMap -> String-      getRefTerm t-          | (("reference", Long), (x,_)) <- t = capitalize x-          | otherwise                         = []
+ src/Text/CSL/Test.hs view
@@ -0,0 +1,297 @@+{-# LANGUAGE PatternGuards, CPP #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  Text.CSL.Test+-- Copyright   :  (c) Andrea Rossato+-- License     :  BSD-style (see LICENSE)+--+-- Maintainer  :  Andrea Rossato <andrea.rossato@unitn.it>+-- Stability   :  unstable+-- Portability :  unportable+--+-- A module for reading Frank's citeproc-js testsuite.+--+-----------------------------------------------------------------------------++module Text.CSL.Test+    ( toTest+    , runTS+    , test, test',test_+    , runTest+    , Test (..)+    ) where++import Control.Arrow+import Control.Monad.State+import Data.Char (toLower)+import Data.List+import Data.Maybe (isJust)+import Data.Time+import System.Directory+import System.Locale++import Text.ParserCombinators.Parsec++import Text.JSON.Generic++import Text.CSL.Input.Json+import Text.CSL.Output.Pandoc+import Text.CSL.Output.Plain+import Text.CSL.Reference+import Text.CSL.Pickle ( readXmlString )+import Text.CSL.Parser ( xpStyle, xpLocale, langBase )+import Text.CSL.Proc+import Text.CSL.Style+import Text.Pandoc.Definition+#ifdef EMBED_DATA_FILES+import qualified Data.ByteString.UTF8 as BS ( toString )+import Text.CSL.Parser ( localeFiles )+#else+import Foreign+import Data.IORef+import Paths_citeproc_hs ( getDataFileName )+import Text.CSL.Parser ( readLocaleFile )+import Text.CSL.Pickle ( readXmlFile )+#endif++data Test+    = Test+      { testMode      :: String+      , testInput     :: [Reference]+      , testCSL       :: Style+      , testResult    :: String+      , testBibSect   :: BibOpts+      , testCitItems  :: Maybe Citations+      , testCitations :: Maybe Citations+      } deriving ( Show )++toTest :: JSValue -> Test+toTest ob = Test mode input style result bibsection cites cites'+    where+      getObj f = case procJSObject f ob of+                   JSObject o -> fromJSObject o+                   _          -> error "error #217"+      object  = getObj id+      objectI = getObj editJsonInput+      objectC = getObj editJsonCiteItems++      look s = case lookup s object of+                 Just (JSString x) -> fromJSString x+                 _                 -> error $ "in test " ++ s ++ " section."+      style  = readXmlString xpStyle $ look "csl"+      mode   = look "mode"+      result = look "result"++      bibsection = case lookup "bibsection" objectI of+                     Just (JSObject o) -> getBibOpts $ fromJSObject o+                     _                 -> Select [] []++      cites  = case lookup "citation_items" objectC of+                 Just (JSArray cs) -> Just $ map readCite cs+                 _                 -> Nothing+      cites'  = case lookup "citations" objectC of+                 Just (JSArray cs) -> Just $ map readJsonCitations cs+                 _                 -> Nothing+      readCite c = case readJSData c of+                     Ok cite  -> cite+                     Error er -> error ("citationItems: " ++ er)++      refs r = case readJSData r of+                 Ok ref   -> ref+                 Error er -> error ("readJSData: " ++ er)++      input  = case lookup "input" objectI of+                 Just (JSArray ar) -> map refs ar+                 _                 -> error $ "in test input section."+      getFieldValue o+          | JSObject os <- o+          , [("field",JSString f),("value",JSString v)] <- fromJSObject os+                       = (fromJSString f, fromJSString v)+          | otherwise  = error "bibsection: could not parse fields and values"+      getBibOpts o = let getSec s = case lookup s o of+                                      Just (JSArray ar) -> map getFieldValue ar+                                      _                 -> []+                         select  = getSec "select"+                         include = getSec "include"+                         exclude = getSec "exclude"+                         quash   = getSec "quash"+                     in case () of+                          _ | select  /= [] -> Select  select  quash+                            | include /= [] -> Include include quash+                            | exclude /= [] -> Exclude exclude quash+                            | quash   /= [] -> Select  []      quash+                            | otherwise     -> Select  []      []++readTestFile :: FilePath -> IO JSValue+readTestFile f = do+  s <- readFile f+  let fields = ["CSL","RESULT","MODE","INPUT","CITATION-ITEMS","CITATIONS","BIBSECTION","BIBENTRIES"]+      format = map (toLower . \x -> if x == '-' then '_' else x)+  return . toJson . zip (map format fields) . map (fieldsParser s) $ fields++toJson :: [(String,String)] -> JSValue+toJson = JSObject . toJSObject . map getIt+    where+      getIt (s,j)+          | s `elem` ["result","csl","mode"] = (,) s . JSString $ toJSString j+          | s `elem` ["bibentries"]          = (,) s . JSBool   $ False+          | j == []                          = (,) s . JSBool   $ False+          | otherwise                        = (,) s . either error id . resultToEither $ decode j++fieldsParser :: String -> String -> String+fieldsParser s f = either (const []) id $ parse (fieldParser f) "" s++fieldParser :: String -> Parser String+fieldParser s = manyTill anyChar (try $ fieldMarkS) >>+                manyTill anyChar (try $ fieldMarkE)+    where+      fieldMarkS = string   ">>" >> many (oneOf "= ") >> string s >> many (oneOf "= ") >> string ">>\n"+      fieldMarkE = string "\n<<" >> many (oneOf "= ") >> string s >> many (oneOf "= ") >> string "<<\n"++pandocBib :: [String] -> String+pandocBib [] = []+pandocBib s+    = "<div class=\"csl-bib-body\">\n" +++      concatMap (\x -> "  " ++ "<div class=\"csl-entry\">" ++ x ++ "</div>\n") s +++      "</div>"++pandocToHTML :: [Inline] -> String+pandocToHTML [] = []+pandocToHTML (i:xs)+    | Str          s <- i = (check . entityToChar $ s) ++ pandocToHTML xs+    | Emph        is <- i = "<i>" ++ pandocToHTML is ++ "</i>" ++ pandocToHTML xs+    | SmallCaps   is <- i = "<span style=\"font-variant:small-caps;\">" ++ pandocToHTML is ++ "</span>" ++ pandocToHTML xs+    | Strong      is <- i = "<b>" ++ pandocToHTML is ++ "</b>" ++ pandocToHTML xs+    | Superscript is <- i = "<sup>" ++ pandocToHTML is ++ "</sup>" ++ pandocToHTML xs+    | Subscript   is <- i = "<sub>" ++ pandocToHTML is ++ "</sub>" ++ pandocToHTML xs+    | Space          <- i = " " ++ pandocToHTML xs+    | EnDash         <- i = "–" ++ pandocToHTML xs+    | Ellipses       <- i = "…" ++ pandocToHTML xs+    | Quoted    t is <- i = case t of+                              DoubleQuote -> "“" ++ pandocToHTML is ++ "”" ++ pandocToHTML xs+                              SingleQuote -> "‘" ++ pandocToHTML is ++ "’" ++ pandocToHTML xs+    | Link     is x  <- i = case snd x of+                              "emph"     -> "<span style=\"font-style:normal;\">" +++                                            pandocToHTML is ++ "</span>" ++ pandocToHTML xs+                              "strong"   -> "<span style=\"font-weight:normal;\">" +++                                            pandocToHTML is ++ "</span>" ++ pandocToHTML xs+                              "nodecor"  -> "<span style=\"font-variant:normal;\">" +++                                            pandocToHTML is ++ "</span>" ++ pandocToHTML xs+                              "baseline" -> "<span style=\"baseline\">" +++                                            pandocToHTML is ++ "</span>" ++ pandocToHTML xs+                              _          -> pandocToHTML is ++ pandocToHTML xs++    | otherwise           = []+    where+      check ('&':[]) = "&#38;"+      check ('<':ys) = "&#60;" ++ check ys+      check ('>':ys) = "&#62;" ++ check ys+      check (y  :ys) = y : check ys+      check []       = []++unlines' :: [String] -> String+unlines'    []     = []+unlines' (x:[])    = x+unlines' (x:xs)    = x ++ "\n" ++ unlines' xs++#ifndef EMBED_DATA_FILES+localeCache :: IORef [(String, Locale)]+localeCache = unsafePerformIO $ newIORef []++getCachedLocale :: String -> IO [Locale]+getCachedLocale n = maybe [] return `fmap` lookup n `fmap` readIORef localeCache++putCachedLocale :: String -> Locale -> IO ()+putCachedLocale n t = modifyIORef localeCache $ \l -> (n, t) : l+#endif++runTest :: Test -> IO (Bool,String)+runTest t = do+  let locale = case styleDefaultLocale $ testCSL t of+                 x | length x == 2 -> maybe (error $ x ++ " doesn't seem a valid locale")+                                      id (lookup x langBase)+                   | otherwise     -> take 5 x+#ifdef EMBED_DATA_FILES+  ls <- case lookup ("locales-" ++ locale ++ ".xml") localeFiles of+          Just x' -> return $ readXmlString xpLocale (BS.toString x')+          _       -> return $ Locale [] [] [] [] []+#else+  ls' <- getCachedLocale locale+  ls  <- case ls' of+           [] -> do l <- getDataFileName ("locales/locales-" ++ locale ++ ".xml")+                    b <- doesFileExist l+                    r <- if b+                         then readXmlFile xpLocale l+                         else readLocaleFile $ take 2 locale+                    putCachedLocale locale r+                    return r+           [x] -> return x+           _   -> return $ Locale [] [] [] [] []+#endif+  let opts   = procOpts { bibOpts = testBibSect t}+      style' = testCSL t+      style  = style' {styleLocale = mergeLocales (styleDefaultLocale style') ls $ styleLocale style'}+      cites  = case (testCitations t, testCitItems t) of+                 (Just cs, _      ) -> cs+                 (_,       Just cs) -> cs+                 _                  -> [map (\r -> emptyCite { citeId = refId r }) $ testInput t]+      (BD cits bib) = citeproc opts style (testInput t) cites+      fixCits = if isJust (testCitations t)+                then flip (zipWith $ \c n -> ">>[" ++ show n ++ "] " ++ c) ([0..] :: [Int])+                else id+      output = case testMode t of+                 "citation" -> unlines'  . fixCits . map (pandocToHTML . renderPandoc_ style) $ cits+                 _          -> pandocBib . map (pandocToHTML . renderPandoc_ style) $ bib+  return (output == testResult t, output)++test :: FilePath -> IO Bool+test = doTest readJsonFile 0++test' :: Int -> FilePath -> IO Bool+test' = doTest readJsonFile++test_ :: Int -> FilePath -> IO Bool+test_ = doTest readTestFile++doTest :: (FilePath -> IO JSValue) -> Int -> FilePath -> IO Bool+doTest rf v f = do+  when (v >= 2) $ putStrLn f+  t <- toTest `fmap` rf f+  (r,o) <- runTest t+  if r then return ()+       else do let putStrLn' = when (v >= 1) . putStrLn+               putStrLn  $ (tail .  takeWhile (/= '.') . dropWhile (/= '_')) f ++ " failed!"+               putStrLn' "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"+               putStrLn' $ f ++ " failed!"+               putStrLn' "Expected:"+               putStrLn' $ (testResult t)+               putStrLn' "\nGot:"+               putStrLn' $ o+               when (v >= 3) $ putStrLn (show t)+               putStrLn' "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"+  return r++runTS :: [String] -> Int -> FilePath -> IO ()+runTS gs v f = do+  st <- getCurrentTime+  putStrLn $ (++) (formatTime defaultTimeLocale "%H:%M:%S" st) $ " <--------------START"+  dc  <- sort `fmap` filter (isInfixOf ".json") `fmap` getDirectoryContents f+  let groupTests = map (head . map fst &&& map snd) .+                   groupBy (\x y -> fst x == fst y) .+                   map (takeWhile (/= '_') &&& tail . dropWhile (/= '_'))+      runGroups g = do putStrLn   "------------------------------------------------------------"+                       putStrLn $ "GROUP \"" ++ fst g ++ "\" has " ++ show (length $ snd g) ++ " tests to run"+                       putStrLn   "------------------------------------------------------------"+                       r' <- mapM (test' v . (++) (f ++ fst g ++ "_")) $ snd g+                       return r'+      filterGroup = if gs /= [] then filter (flip elem gs . fst) else id+  r <- mapM runGroups $ filterGroup $ groupTests dc+  putStrLn " ------------------------------------------------------------"+  putStrLn "| TEST SUMMARY:"+  putStrLn "------------------------------------------------------------"+  putStrLn $ "\t" ++ (show $ sum $ map length r) ++ " tests in " ++ (show $ length r) ++ " groups"+  putStrLn $ "\t" ++ (show $ sum $ map (length . filter id ) r) ++ " successes"+  putStrLn $ "\t" ++ (show $ sum $ map (length . filter not) r) ++ " failures"+  et <- getCurrentTime+  putStrLn $ (++) (formatTime defaultTimeLocale "%H:%M:%S" et) $ " <--------------END"+  putStrLn $ "Time: " ++ show (diffUTCTime et st)
test/test.hs view
@@ -1,5 +1,5 @@ import System.Environment-import Text.CSL.Input.Json+import Text.CSL.Test  -- a dir with a final slash testDir = "citeproc-test/processor-tests/machines/"