1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-12 01:50:52 +01:00

Fixed search in German, French and other languages

This commit is contained in:
squidfunk 2020-06-07 13:56:45 +02:00
parent 1df750a9fe
commit 36e1e3db8b
26 changed files with 46 additions and 27 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
{
"assets/javascripts/bundle.js": "assets/javascripts/bundle.ff925e8b.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.ff925e8b.min.js.map",
"assets/javascripts/bundle.js": "assets/javascripts/bundle.594f2bf6.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.594f2bf6.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.de50e36d.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.de50e36d.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.27c6a5e6.min.js",
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.27c6a5e6.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.c03f0417.min.js",
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.c03f0417.min.js.map",
"assets/stylesheets/main.css": "assets/stylesheets/main.b8fb47b5.min.css",
"assets/stylesheets/main.css.map": "assets/stylesheets/main.b8fb47b5.min.css.map",
"assets/stylesheets/palette.css": "assets/stylesheets/palette.36d1b78f.min.css",

View File

@ -180,7 +180,7 @@
</div>
{% block scripts %}
<script src="{{ 'assets/javascripts/vendor.de50e36d.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.ff925e8b.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.594f2bf6.min.js' | url }}"></script>
{%- set translations = {} -%}
{%- for key in [
"clipboard.copy",
@ -204,7 +204,7 @@
base: "{{ base_url }}",
features: {{ config.theme.features | tojson }},
search: Object.assign({
worker: "{{ 'assets/javascripts/worker/search.27c6a5e6.min.js' | url }}"
worker: "{{ 'assets/javascripts/worker/search.c03f0417.min.js' | url }}"
}, typeof search !== "undefined" && search)
})
</script>

View File

@ -11,7 +11,8 @@
"footer.next": "التالية",
"meta.comments": "التعليقات",
"meta.source": "المصدر",
"search.config.pipeline": "",
"search.config.lang": "ar",
"search.config.pipeline": "stemmer",
"search.placeholder": "بحث",
"search.result.placeholder": "اكتب لبدء البحث",
"search.result.none": "لا توجد نتائج",

View File

@ -10,7 +10,6 @@
"footer.next": "Προηγούμενη",
"meta.comments": "Σχόλια",
"meta.source": "Πηγή",
"search.config.pipeline": "",
"search.placeholder": "Αναζήτηση",
"search.result.placeholder": "Πληκτρολογήστε για να αρχίσει η αναζήτηση",
"search.result.none": "Δε βρέθηκαν αντίστοιχα αρχεία",

View File

@ -11,7 +11,8 @@
"footer.next": "הַבָּא",
"meta.comments": "הערות",
"meta.source": "מָקוֹר",
"search.config.pipeline": "",
"search.config.lang": "ar",
"search.config.pipeline": "stemmer",
"search.placeholder": "לחפש",
"search.result.placeholder": "הקלד כדי להתחיל לחפש",
"search.result.none": "אין מסמכים תואמים",

View File

@ -10,7 +10,8 @@
"footer.next": "आगामी",
"meta.comments": "टिप्पणियाँ",
"meta.source": "स्रोत",
"search.config.pipeline": "",
"search.config.lang": "ar"
"search.config.pipeline": "stemmer",
"search.placeholder": "खोज",
"search.result.placeholder": "खोज शुरू करने के लिए टाइप करें",
"search.result.none": "कोई मिलान डॉक्यूमेंट नहीं",

View File

@ -11,6 +11,7 @@
"meta.comments": "댓글",
"meta.source": "출처",
"search.config.lang": "ja",
"search.config.pipeline": "",
"search.placeholder": "검색",
"search.result.placeholder": "검색어를 입력하세요",
"search.result.none": "검색어와 일치하는 문서가 없습니다",

View File

@ -13,6 +13,8 @@
"meta.comments": "မှတ်ချက်များ",
"meta.source": "ရင်းမြစ်",
"nav.title": "လမ်းညွှန်",
"search.config.lang": "ar",
"search.config.pipeline": "stemmer",
"search.placeholder": "ရှာရန်",
"search.reset": "ရှင်းလင်း",
"search.result.placeholder": "ရှာဖွေခြင်းစရန် စာရိုက်ပါ",

View File

@ -11,6 +11,7 @@
"meta.comments": "Комментарии",
"meta.source": "Исходный код",
"search.config.lang": "ru",
"search.config.pipeline": "stemmer",
"search.placeholder": "Поиск",
"search.result.placeholder": "Начните печатать для поиска",
"search.result.none": "Совпадений не найдено",

View File

@ -10,7 +10,8 @@
"footer.next": "Следеће",
"meta.comments": "Коментари",
"meta.source": "Извор",
"search.config.pipeline": "",
"search.config.lang": "ru",
"search.config.pipeline": "stemmer",
"search.placeholder": "Претрага",
"search.result.placeholder": "Унесите појам претраге",
"search.result.none": "Нису пронађени документи",

View File

@ -138,11 +138,6 @@ export class Search {
this.index = lunr(function() {
pipeline = pipeline || ["trimmer", "stopWordFilter"]
/* Set up pipeline according to configuration */
this.pipeline.reset()
for (const fn of pipeline)
this.pipeline.add(lunr[fn])
/* Set up alternate search languages */
if (config.lang.length === 1 && config.lang[0] !== "en") {
this.use((lunr as any)[config.lang[0]])
@ -150,6 +145,16 @@ export class Search {
this.use((lunr as any).multiLanguage(...config.lang))
}
/* Set up pipeline according to configuration */
this.pipeline.reset()
for (const fn of pipeline)
this.pipeline.add(lunr[fn])
/* Set up search pipeline according to configuration */
this.searchPipeline.reset()
for (const fn of pipeline)
this.searchPipeline.add(lunr[fn])
/* Set up fields and reference */
this.field("title", { boost: 1000 })
this.field("text")

View File

@ -31,7 +31,8 @@
"footer.next": "التالية",
"meta.comments": "التعليقات",
"meta.source": "المصدر",
"search.config.pipeline": "",
"search.config.lang": "ar",
"search.config.pipeline": "stemmer",
"search.placeholder": "بحث",
"search.result.placeholder": "اكتب لبدء البحث",
"search.result.none": "لا توجد نتائج",

View File

@ -30,7 +30,6 @@
"footer.next": "Προηγούμενη",
"meta.comments": "Σχόλια",
"meta.source": "Πηγή",
"search.config.pipeline": "",
"search.placeholder": "Αναζήτηση",
"search.result.placeholder": "Πληκτρολογήστε για να αρχίσει η αναζήτηση",
"search.result.none": "Δε βρέθηκαν αντίστοιχα αρχεία",

View File

@ -31,7 +31,8 @@
"footer.next": "הַבָּא",
"meta.comments": "הערות",
"meta.source": "מָקוֹר",
"search.config.pipeline": "",
"search.config.lang": "ar",
"search.config.pipeline": "stemmer",
"search.placeholder": "לחפש",
"search.result.placeholder": "הקלד כדי להתחיל לחפש",
"search.result.none": "אין מסמכים תואמים",

View File

@ -30,7 +30,8 @@
"footer.next": "आगामी",
"meta.comments": "टिप्पणियाँ",
"meta.source": "स्रोत",
"search.config.pipeline": "",
"search.config.lang": "ar"
"search.config.pipeline": "stemmer",
"search.placeholder": "खोज",
"search.result.placeholder": "खोज शुरू करने के लिए टाइप करें",
"search.result.none": "कोई मिलान डॉक्यूमेंट नहीं",

View File

@ -31,6 +31,7 @@
"meta.comments": "댓글",
"meta.source": "출처",
"search.config.lang": "ja",
"search.config.pipeline": "",
"search.placeholder": "검색",
"search.result.placeholder": "검색어를 입력하세요",
"search.result.none": "검색어와 일치하는 문서가 없습니다",

View File

@ -33,6 +33,8 @@
"meta.comments": "မှတ်ချက်များ",
"meta.source": "ရင်းမြစ်",
"nav.title": "လမ်းညွှန်",
"search.config.lang": "ar",
"search.config.pipeline": "stemmer",
"search.placeholder": "ရှာရန်",
"search.reset": "ရှင်းလင်း",
"search.result.placeholder": "ရှာဖွေခြင်းစရန် စာရိုက်ပါ",

View File

@ -31,6 +31,7 @@
"meta.comments": "Комментарии",
"meta.source": "Исходный код",
"search.config.lang": "ru",
"search.config.pipeline": "stemmer",
"search.placeholder": "Поиск",
"search.result.placeholder": "Начните печатать для поиска",
"search.result.none": "Совпадений не найдено",

View File

@ -30,7 +30,8 @@
"footer.next": "Следеће",
"meta.comments": "Коментари",
"meta.source": "Извор",
"search.config.pipeline": "",
"search.config.lang": "ru",
"search.config.pipeline": "stemmer",
"search.placeholder": "Претрага",
"search.result.placeholder": "Унесите појам претраге",
"search.result.none": "Нису пронађени документи",