Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 2512 additions and 112 deletions
<template id="">
<div class='help' :class="$vuetify.breakpoint.name">
<div v-if="$store.state.currentLocale == 'nno'">
<p>Du søkjer ved å skrive inn ordet og trykkje på returtasten (<kbd>enter</kbd>) eller velje eit søkjeforslag i nedtrekksmenyen. Tast <kbd>Shift</kbd>+<kbd>7</kbd> dersom du vil hoppe tilbake til søkjefeltet etter å ha søkt.
Overskrifta i toppen av kvart søkjetreff er ei lenkje til ei ny artikkelside for det aktuelle ordet. Om du ikkje får meir enn eitt treff i kvar ordbok, viser heile artikkelen i resultatlista, og du treng ikkje trykkje på lenkja. Er det fleire treff, kan du òg sjå artikkelinnhaldet i resultatlista ved å trykkje på "Vis artikkel" i botnen av søkjetreffet. Sjå innstillingane nedanfor om du ønskjer at resultatlista alltid skal vise fullstendige artiklar.
</p><p>
Kva ordbok du får treff i, avheng av kva ordbok du har valt å søkje i, og om ordet blir brukt i begge skriftspråka. Det ligg per i dag ikkje inne koplingar mellom ordbøkene, men vi har utvikla ein meinte-du-funksjon, som vi håpar blir til hjelp for å finne dei riktige orda både i bokmål og nynorsk.</p>
<p>Du kan søkje direkte på faste uttrykk, t.d. <em>gi katten i</em>. Alternativt finn du uttrykka samla til slutt i artikkelen eller artiklane dei er knytte til. Når du skriv inn eit enkelt ord i søkjefeltet, viser nedtrekksmenyen òg dei faste uttrykka som ordet er ein del av.</p>
<h2>Søk med jokerteikn</h2>
<p>Dersom du er usikker på skrivemåten av eit ord eller ønskjer treff i meir
enn éin artikkel, kan du bruke <kbd>%</kbd> og <kbd>*</kbd> for å få treff på null, eitt eller fleire teikn.
Symbolet <kbd>_</kbd> erstattar berre eitt teikn. Du kan plassere jokerteikna fleire stader i søkjeordet.</p>
Døme:
<p>Søkjer du på «<a href="https://ordbokene.no/bm,nn/search?q=arbeid%2ar&scope=ei">arbeid*r</a>», er dei første treffa i nedtrekksmenyen «arbeider» i <em>Bokmålsordboka</em> og «arbeidar» i <em>Nynorskordboka</em>.</p>
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=inter%25es%25ant&scope=ei">inter%es%ant</a>» gjev treff på «interessant» i begge ordbøkene. </p>
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=f%C3%B8rsk%25l%C3%A6r_r&scope=ei">førsk%lær_r</a>» gjev treff på «førskolelærer» i <em>Bokmålsordboka</em> og «førskolelærar/førskulelærar» i <em>Nynorskordboka</em>.</p>
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=ku__&scope=e">ku__</a>» gjev treff på ord på fire bokstavar som startar på «ku».</p>
<h2>Kombiner søkjeord</h2>
<p>Symbolet <kbd>|</kbd> gjer det mogleg å søkje med fleire søkjeord samtidig. Det er òg mogleg å kombinere søkjeord som inneheld jokerteikn.</p>
Døme:
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=kj%C3%A6rlighet%7Ckj%C3%A6rleik&scope=ei">kjærlighet|kjærleik</a>» gjev treff på «kjærlighet» i <em>Bokmålsordboka</em> og «kjærleik» i <em>Nynorskordboka</em>.</p>
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=undervis_r%7Cl%C3%A6r_r&scope=ei">undervis_r|lær_r</a>» gjev treff på «underviser» og «lærer» i <em>Bokmålsordboka</em> og «undervisar» og «lærar» i <em>Nynorskordboka</em>.</p>
</div>
<div v-if="$store.state.currentLocale == 'nob'">
<p>Du søker ved å skrive inn ordet og trykke på returtasten (<kbd>enter</kbd>) eller velge et søkeforslag i nedtrekksmenyen. Tast <kbd>Shift</kbd>+<kbd>7</kbd> hvis du vil hoppe tilbake til søkefeltet etter å ha søkt.
Overskriften i toppen av hvert søketreff er en lenke til en ny artikkelside for det aktuelle ordet. Hvis du ikke får mer enn ett treff i hver ordbok, vises hele artikkelen i resultatlisten, og du trenger ikke trykke på lenken. Er det flere treff, kan du også vise artikkelinnholdet i resultatlisten ved å trykke på "Vis artikkel" i bunnen av søketreffet. Se innstillingene nedenfor hvis du ønsker at resultatlisten alltid skal vise fullstendige artikler.
</p><p>
Hvilken ordbok du får treff i, avhenger av hvilken ordbok du har valgt å søke i, og om ordet blir brukt i begge skriftspråkene. Det ligger per i dag ikke inne koblinger mellom ordbøkene, men vi har utviklet en mente-du-funksjon, som vi håper blir til hjelp for å finne de riktige ordene både i bokmål og nynorsk.
</p><p>Du kan søke direkte på faste uttrykk, f.eks. <em>gi katten i</em>. Alternativt finner du uttrykkene samlet til slutt i artikkelen eller artiklene de er knyttet til. Når du skriver inn et enkelt ord i søkefeltet, viser nedtrekksmenyen også de faste uttrykkene som ordet inngår i.</p>
<h2>Søk med jokertegn</h2>
<p>Dersom du er usikker på skrivemåten av et ord eller ønsker treff i mer enn én artikkel, kan du bruke <kbd>%</kbd> og <kbd>*</kbd> for å få treff på null, ett eller flere tegn.
Symbolet <kbd>_</kbd> erstatter kun ett tegn. Du kan plassere jokertegnene flere steder i søkeordet.</p>
Eksempler:
<p>Søker du på «<a href="https://ordbokene.no/bm,nn/search?q=arbeid%2ar&scope=ei">arbeid*r</a>», er de første treffene i nedtrekksmenyen «arbeider» i <em>Bokmålsordboka</em> og «arbeidar» i <em>Nynorskordboka</em>.</p>
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=inter%25es%25ant&scope=ei">inter%es%ant</a>» gir treff på «interessant» i begge ordbøkene. </p>
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=f%C3%B8rsk%25l%C3%A6r_r&scope=ei">førsk%lær_r</a>» gir treff på «førskolelærer» i <em>Bokmålsordboka</em> og «førskolelærar/førskulelærar» i <em>Nynorskordboka</em>.</p>
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=ku__&scope=e">ku__</a>» gir treff på ord på fire bokstaver som begynner med «ku».</p>
<h2>Kombiner søkeord</h2>
<p>Symbolet <kbd>|</kbd> gjør det mulig å søke med flere søkeord samtidig. Det er også mulig å kombinere søkeord som inneholder jokertegn.</p>
Eksempler:
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=kj%C3%A6rlighet%7Ckj%C3%A6rleik&scope=ei">kjærlighet|kjærleik</a>» gir treff på «kjærlighet» i <em>Bokmålsordboka</em> og «kjærleik» i <em>Nynorskordboka</em>.</p>
<p>Søket «<a href="https://ordbokene.no/bm,nn/search?q=undervis_r%7Cl%C3%A6r_r&scope=ei">undervis_r|lær_r</a>» gir treff på «underviser» og «lærer» i <em>Bokmålsordboka</em> og «undervisar» og «lærar» i <em>Nynorskordboka</em>.</p>
</div>
<div v-if="$store.state.currentLocale == 'eng'">
<p>Search the website by entering a word, press <kbd>return</kbd> or pick a search suggestion in the drop-down menu. Press <kbd>/</kbd> whenever you want to jump back to the search box.
The heading of each search result is a link to a lookup page for the article in question. If you get no more than one result in each dictionary, the entire article is shown in the list of results, and you won't need to click the link. If there are more resutls, you may expand the article content in the results list by clicking "Show article" at the bottom of the result item. You can make the articles expand by default in the settings below.
</p><p>
The dictionary from which to get search results depends on the dictionary selected, and if the word is used in both written languages. Currently, the two dictionaries are not linked at word level. Thus a ‘Did you mean’ function has been developed. The hope is that this function will be helpful in finding the right words in both Bokmål and Nynorsk. It is possible to search for fixed expressions, e.g.
<em>gi katten i</em> (not give a damn). It is also possible to find such expressions at the end of each article or the articles they are linked to. When typing a single word in the search field, the drop-down menu also shows the common expressions the word is part of.
</p>
<h2>Wildcard search</h2>
<p>If unsure of the spelling of a word or want results from more than one article, it is possible to use <kbd>%</kbd> and <kbd>*</kbd> to replace zero, one or more characters.
Underscore (<kbd>_</kbd>) replaces only one character. You may use the wilcard symbols multiple times in your search expression.</p>
Examples:
<p>The search query “<a href="https://ordbokene.no/bm,nn/search?q=arbeid%2ar&scope=ei">arbeid*r</a>”, will result in results in the drop-down menu with “arbeider” (worker) in the Bokmål dictionary and “arbeidar” (worker) in the Nynorsk Dictionary.</p>
<p>The search query “<a href="https://ordbokene.no/bm,nn/search?q=inter%25es%25ant&scope=ei">inter%es%ant</a>” returns the result “interessant” (interesting) in both dictionaries. </p>
<p>The search query “<a href="https://ordbokene.no/bm,nn/search?q=f%C3%B8rsk%25l%C3%A6r_r&scope=ei">førsk%lær_r</a>” gives resutls for “førskolelærer” (pre-school teacher) in the Bokmål dictionary and “førskolelærar/førskulelærar” (pre-school teacher) in the Nynorsk dictionary.</p>
<p>The search query «<a href="https://ordbokene.no/bm,nn/search?q=ku__&scope=e">ku__</a>» returns four letter words starting with «ku».</p>
<h2>Combine search terms</h2>
<p>The symbol <kbd>|</kbd> allows you to use in several search words at the same time. You can also combine search words that contain wildcard symbols.</p>
Examples:
<p>The search “<a href="https://ordbokene.no/bm,nn/search?q=kj%C3%A6rlighet%7Ckj%C3%A6rleik&scope=ei">kjærlighet|kjærleik</a>” yields the result “kjærlighet” in the Bokmål dictionary and “kjærleik” (love) in the Nynorsk dictionary.</p>
<p>The search “<a href="https://ordbokene.no/bm,nn/search?q=undervis_r%7Cl%C3%A6r_r&scope=ei">undervis_r|lær_r</a>” results in “underviser” (teacher) and “lærer” (teacher) in the Bokmål dictionary and “undervisar” and “lærar” in the Nynorsk dictionary.</p>
</div>
<div v-if="$store.state.currentLocale == 'ukr'">
<p>Для пошуку введіть слово і натисніть кнопку <kbd>enter</kbd> або виберіть варіант пошуку у спадному меню. Натисніть <kbd>Shift</kbd>+<kbd>7</kbd>, якщо ви хочете повернутися до поля пошуку після виконання пошуку.
Заголовок у верхній частині кожного результату пошуку - це посилання на сторінку нової статті про це слово. Якщо ви не знайдете більше одного збігу в кожному словнику, вся стаття з’явиться у списку результатів, і вам не потрібно переходити за посиланням. Якщо результатів декілька, ви також можете переглянути вміст статті у списку результатів, натиснувши "показати статтю" внизу результату пошуку. Дивіться налаштування нижче, якщо ви хочете, щоб у списку результатів завжди випадали повні статті.
</p>
<p>
У якому словнику ви отримаєте збіги, залежить від того, який словник ви вибрали для пошуку,
і чи використовується це слово в обох письмових мовах. Наразі між словниками немає посилань,
але ми розробили для вас функцію, яка, сподіваємось, допоможе знайти потрібні слова як у <em>букмолі</em>,
так і в <em>нюношку</em>.
</p>
<p>
Ви можете здійснювати пошук безпосередньо за фіксованими виразами,
напр., <em>gi katten i</em> (не заморочуватись нічим або ніким).
Крім того, ви знайдете вирази разом у статті чи статтях, з якими вони пов’язані.
Коли ви вводите в поле пошуку одне слово, у спадному меню також показуються фіксовані вирази, до
яких входить це слово.
</p>
<h2>Пошук за допомогою символів підстановки</h2>
<p>Якщо ви не впевнені в написанні слова або хочете знайти збіги в більш ніж одній статті, ви можете використовувати <kbd>%</kbd> і <kbd>*</kbd> щоб отримати збіги від нуля, одного або декількох символів.
Символ <kbd>_</kbd> замінює лише один символ. Ви можете розмістити символи підстановки в декількох місцях ключового слова.</p>
Приклади:
<p>Пошук за запитом “<a href="https://ordbokene.no/bm,nn/search?q=arbeid%2ar&scope=ei">arbeid*r</a>” покаже у спадному меню результатів слова “arbeider” (працівник) у <em>Словнику букмола</em> і “arbeidar” (працівник) у <em>Словнику нюношка</em>.</p>
<p>Пошук “<a href="https://ordbokene.no/bm,nn/search?q=f%C3%B8rsk%25l%C3%A6r_r&scope=ei">førsk%lær_r</a>” надає результати за словом “førskolelærer” (вчитель дошкільної освіти) у <em>Словнику букмола</em> та “førskolelærar/førskulelærar” (вчитель дошкільної освіти) у <em>Словнику нюношка</em>.</p>
<p>Пошук “<a href="https://ordbokene.no/bm,nn/search?q=ku__&scope=e">ku__</a>” забезпечує відповідність словами з чотирьох букв, що починаються на “ku”.</p>
<h2>Поєднайте ключові слова</h2>
<p>Символ <kbd>|</kbd> дозволяє здійснювати пошук за кількома ключовими словами одночасно. Також можливо комбінувати ключові слова, що містять символи підстановки.</p>
Приклади:
<p>Пошук “<a href="https://ordbokene.no/bm,nn/search?q=kj%C3%A6rlighet%7Ckj%C3%A6rleik&scope=ei">kjærlighet|kjærleik</a>” надає результати за словом “kjærlighet” (любов) у <em>Словнику букмола</em> і “kjærleik” (любов) у <em>Словнику нюношка</em>.</p>
<p>Пошук “<a href="https://ordbokene.no/bm,nn/search?q=undervis_r%7Cl%C3%A6r_r&scope=ei">undervis_r|lær_r</a>” надає результати за словом “underviser” (навчання) та “lærer” (вчитель) у <em>Словнику букмола</em> і “undervisar” (навчання) та “lærar” (вчитель) у <em>Словнику нюношка</em>.</p>
</div>
</div>
</template>
<style scoped>
ul.bullet > li {
list-style: disc;
margin-left: 20px;
}
a {
text-decoration: none;
}
blockquote {
margin-left:50px;
}
kbd {
border-radius: 5px !important;
background-color: var(--v-tertiary-darken1) !important;
color: var(--v-text-base) !important;
}
</style>
<!-- eslint-disable -->
<template>
<span :is="$vuetify.breakpoint.smAndDown ? 'div' : 'span'" class="inflection-wrapper" v-if="inflected">
<v-btn :lang="$parent.$parent.lang_tag_locale" :aria-controls="'inflection-canvas'+$parent.title_id" :aria-expanded="inflection_expanded ? 'true' : 'false'" v-if="!($store.state.inflectionExpanded && $route.name)" class="show-inflection" small depressed rounded @click.native="toggle" :class="$vuetify.breakpoint.name">
<span :lang="$parent.lang_tag_locale">{{inflection_expanded? $t('article.hide_inflection', $parent.content_locale):$t('article.show_inflection', $parent.content_locale)}}</span><span class = "inflection-arrow"><v-icon small right>{{this.inflection_expanded? "remove" : "add"}}</v-icon></span>
</v-btn>
<div :id="'inflection-canvas'+$parent.title_id" class="inflection-canvas">
<inflectionTable v-if="inflection_expanded || always_expand" :eng="$store.state.currentLocale == 'eng'" :ukr="$store.state.currentLocale == 'ukr'" :lemmaList="lemmas_with_word_class_and_lang" :mq="$vuetify.breakpoint.name" :context="$store.state.inflectionTableContext" :key="$store.state.currentLocale + $store.state.inflectionTableContext"/>
</div>
</span>
</template>
<script>
/* eslint-disable */
import inflectionTable from 'inflection-table'
export default {
name: 'InflectionButton',
props: {
lemmas: Array,
dictionary: String,
article_id: Number
},
computed: {
lemmas_with_word_class_and_lang: function() {
return this.lemmas.map(lemma => Object.assign({language: this.dictionary == 'bm' ? 'nob' : 'nno',
word_class: lemma.paradigm_info[0].inflection_group.split('_')[0]}, lemma))
},
inflected: function() {
return this.lemmas.reduce((acc, lemma) => acc + lemma.paradigm_info.reduce((acc2, digm) => digm.inflection_group.includes("uninfl") ? acc2 : acc2 + digm.inflection.length, 0), 0) > this.lemmas.length
},
always_expand: function() {
return !this.$parent.$parent.collapsed && this.$store.state.inflectionExpanded && this.$route.name
}
},
components: {
inflectionTable
},
data: function() {
return {
inflection_expanded: false
}
},
methods: {
toggle: function() {
if (!this.inflection_expanded) {
this.$plausible.trackEvent('inflection click', {props: {article: `${this.dictionary} ${this.article_id}`}})
}
this.inflection_expanded = !this.inflection_expanded
}
},
}
</script>
<style>
.show-inflection .v-icon {
color: var(--v-primary-base) !important;
margin-left: 4px !important;
}
@keyframes open {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
div.show-inflection {
padding-top: 10px;
}
.inflection-canvas {
overflow-x: auto;
/*position: absolute;*/
z-index: 5;
background-color: rgba(255, 255, 255, 0);
/*max-width: 100vw;*/
}
.inflection-canvas > div {
padding-top: 10px;
padding-bottom: 10px;
}
.inflection-wrapper {
color: var(--v-text-base);
font-size: 14px;
margin-top: 10px;
}
.context {
color: #545454 !important;
}
div.lemma {
display: none;
}
table {
border-collapse: collapse;
margin-top: 5px;
}
th, td {
border: solid 2px var(--v-button-darken1);
padding: 5px;
}
th {
background-color: var(--v-button-base);
}
.infl-label {
text-align: center;
vertical-align: top;
}
td.hilite {
background-color: var(--v-tertiary-base);
text-align: center
}
</style>
<template>
<v-card>
<v-list>
<v-list-group prepend-icon="help">
<template v-slot:activator>
<v-list-item-title>{{$t('menu.help')}}</v-list-item-title>
</template>
<v-list-item><Help/></v-list-item>
</v-list-group>
<v-list-item link to="/om" v-on:click="$emit('close')">
<v-list-item-icon><v-icon>info</v-icon></v-list-item-icon>
<v-list-item-title>{{$t('menu.about')}}</v-list-item-title>
<v-list-item-icon><v-icon>chevron_right</v-icon></v-list-item-icon>
</v-list-item>
<v-list-group sub prepend-icon="language">
<template v-slot:activator>
<v-list-item-title>{{$t('settings.locale.title')}}</v-list-item-title>
</template>
<v-list-item>
<v-list subheader>
<v-radio-group v-model="updateLocale" :label="$t('settings.locale.description')">
<v-radio value="nob" label="Bokmål (nob)"></v-radio>
<v-radio value="nno" label="Nynorsk (nno)"></v-radio>
<v-radio value="eng" label="English (eng)"></v-radio>
<v-radio value="ukr" label="Українська (ukr)"></v-radio>
</v-radio-group>
</v-list></v-list-item>
</v-list-group>
<v-list-group v-if="false" prepend-icon="book">
<template v-slot:activator>
<v-list-item-title>{{$t('settings.dict.title')}}</v-list-item-title>
</template>
<v-list-item>
<v-list subheader>
<v-radio-group mandatory v-model="updateDefaultDict" :label="$t('settings.dict.description')">
<v-radio value="bm,nn" :label="$t('dicts.bm,nn')"></v-radio>
<v-radio value="bm" :label="$t('dicts.bm')"></v-radio>
<v-radio value="nn" :label="$t('dicts.nn')"></v-radio>
</v-radio-group>
</v-list></v-list-item>
</v-list-group>
<v-list-group prepend-icon="settings">
<template v-slot:activator>
<v-list-item-title>{{$t('settings.title')}}</v-list-item-title>
</template>
<v-list-item><Settings/></v-list-item>
</v-list-group>
<v-list-item v-if="!$store.state.unavailable" v-on:click='$store.commit("resetStore")'>
<v-list-item-icon><v-icon>delete</v-icon></v-list-item-icon>
<v-list-item-title>{{$t("settings.reset")}}</v-list-item-title>
</v-list-item>
<v-list-group prepend-icon="mail">
<template v-slot:activator>
<v-list-item-title>{{$t('contact.title')}}</v-list-item-title>
</template>
<v-list-item><Contact @close="$emit('close')"/></v-list-item>
</v-list-group>
</v-list>
</v-card>
</template>
<script>
import Settings from './Settings.vue'
import Help from './Help.vue'
import Contact from './Contact.vue'
export default {
name: "Menu",
components: {
Settings,
Help,
Contact
},
computed: {
updateLocale: {
get () { return this.$store.state.currentLocale},
set(value) {
this.$store.commit("setLocale", {value: value, i18n: this._i18n})
}
},
updateDefaultDict: {
get () { return this.$store.state.defaultDict},
set(value) {
this.$store.commit("setDefaultDict", value)
}
}
},
}
</script>
<template>
<div v-bind:class="{'centered': bottom}">
<span color="tertiary" class = "pagination">
<v-pagination @input="update" v-model="$parent.$parent.page" :class="$vuetify.breakpoint.name" :total-visible="$vuetify.breakpoint.smAndDown && !bottom ? 5 : 8" circle :length="Math.ceil(Math.max($parent.count_bm, $parent.count_nn)/$parent.$parent.perPage)"></v-pagination>
<span class="result-counts" v-if="!bottom && $vuetify.breakpoint.smAndDown">
<span class="total-results">{{$parent.$parent.total_results()}} treff </span>
<span v-if="$parent.$parent.lang=='bm,nn'" class="dict-counts"> | {{$vuetify.breakpoint.mdAndDown? 'bokmål': 'Bokmålsordboka'}}: {{$parent.count_bm}} | {{$vuetify.breakpoint.mdAndDown? 'nynorsk': 'Nynorskordboka'}}: {{$parent.count_nn}}</span>
<span v-if="$parent.$parent.lang!='bm,nn'" class="dict-counts"> | {{$t('dicts_inline.'+$parent.lang)}}</span>
</span>
</span>
<v-btn v-if="bottom && $parent.$parent.total_results() > 6" text @click.native="to_top"><v-icon left>expand_less</v-icon>{{$t('to_top')}}</v-btn>
</div>
</template>
<script>
export default ({
name: "Pagination",
props: {
bottom: Boolean
},
methods: {
update: function(item) {
if (this.bottom) {
this.to_top()
}
this.$emit('update-page', item)
},
to_top: function() {
let first = document.getElementById("result0")
if (first) first.focus();
window.scrollTo(0,0)
}
},
})
</script>
<style scoped>
.centered {
text-align: center;
padding-bottom: 10px;
}
.centered > span {
justify-content: center;
padding-bottom: 10px
}
</style>
\ No newline at end of file
<template>
<div :class="$vuetify.breakpoint.name">
<form @submit.prevent="submit">
<v-combobox
v-model="select"
prepend-inner-icon="search"
autocapitalize = 'off'
:loading="loading"
:items="items"
append-icon=""
:search-input.sync="search"
item-text="match"
:menu-props="{maxHeight: $vuetify.breakpoint.name === 'xs' ? 190 : 500, transition: 'fade-transition', allowOverflow: true}"
return-object
rounded
clearable
:autofocus="!$route.hash && !$store.state.noMouse && $vuetify.breakpoint.mdAndUp"
hide-no-data
no-filter
auto-select-first
hide-details
:label="$t('search_placeholder') + $t(`dicts.${$parent.lang}`)"
:aria-label="$t('search_placeholder') + $t(`dicts.${$parent.lang}`)"
solo
full-width
:placeholder="$t('search_placeholder') + $t(`dicts.${$parent.lang}`)"
ref="autocomplete"
color="primary"
:dense="$vuetify.breakpoint.mdAndDown"
>
<template v-slot:prepend-inner>
<v-menu allowOverflow offsetY v-model="dictMenuOpened">
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs"
v-on="on"
plain
depressed
color = "primary"
text
@click.native="items=[]">
<v-icon left>book</v-icon>
<span v-if="$vuetify.breakpoint.mdAndUp">
{{$t(`dicts.${$parent.lang}`)}}
<v-icon right>{{ dictMenuOpened? 'expand_less' : 'expand_more'}}</v-icon>
</span><span v-if="$vuetify.breakpoint.smAndDown">{{$t(`dicts_short.${$parent.lang}`)}}</span></v-btn>
</template>
<v-list>
<v-list-item v-for="item in ['bm,nn','bm','nn'].map(l => {return {label: $t(`dicts.${l}`), tag: l}})" :key="item.tag"
active-class="v-list-item--active" @click="update_lang_form(item.tag)">
<v-list-item-icon v-if="$parent.lang == item.tag"><v-icon color="primary">radio_button_checked</v-icon></v-list-item-icon>
<v-list-item-icon v-else><v-icon>radio_button_unchecked</v-icon></v-list-item-icon>
<v-list-item-title >{{ item.label }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<v-divider vertical aria-hidden="true"/><v-icon right>search</v-icon>
</template>
<template v-slot:item="data">
<span v-if="data.item.type == 'empty' || data.item.type == 0">
Søk: <strong>{{data.item.match}}</strong> </span>
<span v-if="data.item.type == 'exact'">
<span class="searchLemma">
<strong>{{data.item.match}}</strong>
</span>
<span class="dict-parentheses" v-if="(get_lang()=='bm,nn')">
({{["bokmål","nynorsk","bokmål, nynorsk"][data.item.lang-1]}})
</span>
</span>
<span v-if="data.item.type == 'other'">
{{data.item.match}} </span>
</template>
</v-combobox>
<SearchToolbar @updatePos="update_pos"
@updateScope="update_scope" />
</form>
</div>
</template>
<script>
import SearchToolbar from './SearchToolbar.vue'
export default {
data: function() {
return {
loading: false,
items: [],
search: null,
select: this.$parent.queryString || null,
suggesting: null,
menuDialog: false,
dictMenuOpened: false
}
},
components: {
SearchToolbar
},
watch: {
search (val) {
const time = Date.now()
if (! val) {
this.items = []
} else {
this.run_query(val, time)
}
},
select(item) {
if (item) {
if (typeof item != 'string') {
this.items = []
this.suggesting = false
this.submit(item)
}
}
},
$route (to, from) {
this.select = to.query.q || ""
}
},
methods: {
hotkey(e) {
if (e.key !== "/") return;
if (this.$store.state.disableHotkey) return
if (e.altKey || e.ctrlKey || e.metaKey) return;
if (/^(?:input|textarea|select)$/i.test(e.target.tagName)) return;
e.preventDefault()
this.$refs.autocomplete.$refs.input.focus()
},
update_lang_form(lang) {
this.$emit('update-lang-form', lang)
// Submit if switching on front page
if (this.search && this.search!=this.$parent.queryString && !this.items[0]) {
this.submit({q: this.search, match: this.search, time: Date.now()})
}
else {
this.$parent.reload_params()
}
},
update_scope(scope) {
this.$emit('updateScope', scope)
},
update_pos(pos) {
this.$emit('updatePos', pos)
},
get_lang() {
return this.$parent.lang
},
run_query(q, time) {
q = q.trim()
if (this.items[0]) {
if (this.items[0].time < time) {
// Whitespace necessary in case option already exists in dropdown
this.items.splice(0,1, {q, match: q, time, type: 0})
}
}
else {
this.items.push({q, match: q, time, type: 0})
}
let words = q.split(/ |\|/)
if (words.length > 20) {
this.items = [{q, match: q, time, type: 0}]
return
}
for (let i = 0; i < words.length; i++) {
if (words[i].length > 40) {
this.items = [{q, match: q, time, type: 0}]
return
}
}
this.suggesting = true
let self = this
let params = {q, dict: self.get_lang(), n: 20, dform: 'int', meta: 'n', include: this.$parent.scope, wc: self.$parent.pos_selected}
this.$parent.api.get('api/suggest?', {params})
.then(async (response) => {
if (self.$refs.autocomplete.searchInput == q & self.suggesting) {
let suggestions = []
if (response.data.a.exact) {
suggestions = response.data.a.exact.map(item => ({q: q, match: item[0], time: time, lang: [item[1]], type: "exact"}))
}
if (response.data.a.inflect) {
let inf = response.data.a.inflect.map(item => ({q: q, match: q, inflected: item[0], time: time, type: "other"}))
suggestions = suggestions.concat(inf)
}
if (response.data.a.freetext) {
let fr = response.data.a.freetext.map(item => ({q: q, match: item[0], time: time, type: "other"}))
suggestions = suggestions.concat(fr)
}
if (suggestions.length) {
if (suggestions[0].q.toLowerCase() != suggestions[0].match.toLowerCase()) {
suggestions.unshift({q, match: q, time, type: "empty"})
}
self.items = suggestions
}
else {
self.items = [{q, match: q, time, type: "empty"}]
}
}
})
},
submit(item) {
if (!item.q) {
item = this.items[0] || {q: this.search, match: this.search, time: Date.now() }
this.items = []
}
this.$emit('submit', item)
let self = this
setTimeout(() => {
if (!self.$store.state.noMouse && this.$vuetify.breakpoint.mdAndUp) self.$refs.autocomplete.$refs.input.select()
else self.$refs.autocomplete.$refs.input.blur()
self.suggesting = false
}, 1)
}
},
mounted: function() {
document.addEventListener("keydown", this.hotkey);
}
}
</script>
<style scoped>
.searchResult {
margin-right: 5px;
}
.searchLemma {
color: var(--v-primary-base);
}
form {
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
}
.accessibility_link {
display: inline;
position: absolute;
left: -10000px;
}
.accessibility_link:focus {
position: absolute;
left: 48px;
top : 48px;
background-color: white;
padding: 10px;
z-index: 10000;
}
</style>
<template>
<section id="search_results">
<div class="flex-container" :class="$vuetify.breakpoint.name">
<ul class="hits" v-if="results_bob.length">
<li class="article_container" v-for="(result, index) in results_bob" :key="index + results_hash" tabindex="-1">
<section id="search_results" :class="$vuetify.breakpoint.name">
<div v-if="show_per_page" class="pagination-container">
<Pagination v-if="show_pagination" @update-page="$emit('update-page')"/>
<span id="per-page">
<span id="per-page-label">{{$t('per_page')}}</span>
<v-select class="per-page-select"
aria-labelledby="per-page-label"
v-model="$parent.perPage"
:items="[10, 20, 50, 100]"
@input="$parent.update_per_page"
hide-details
dense
:menu-props="{ offsetY: true }"
append-icon="expand_more"/>
</span>
</div>
<div class="flex-container" v-if="!$parent.waiting" :class="$vuetify.breakpoint.name">
<div class="hits" v-if="$vuetify.breakpoint.smAndDown">
<div class="article_container" v-for="(result, index) in results_bm.concat(results_nn)" :key="index + both_hash"
:style="'order:'+(index < results_bm.length? 2*index : ((index-results_bm.length)*2) + 1)">
<Article
:article="result"
:title_id="`result${index}`"
:queryPattern="queryPattern"
:scope="scope"
@article-click="article_link_click"
@details-click="details_click">
</Article>
</div>
</div>
<div class="hits" v-if="$vuetify.breakpoint.mdAndUp && lang!= 'nn'" v-bind:class="{'wide': lang=='bm'}">
<div class="dict-label-top"> <span role="heading" aria-level="2" class="dict-label-title"> bokmålsordboka </span><span v-if="count_bm != 1"> | <span v-if="count_bm == 0">{{$t('notifications.no_results')}}</span><span v-else>{{count_bm}} {{$t('notifications.results')}}</span></span></div>
<div class="article_container" v-for="(result, index) in results_bm" :key="index + bm_hash">
<Article
:article="result"
:title_id="`result${index}`"
:queryPattern="queryPattern"
:scope="scope"
@article-click="article_link_click"
@details-click="details_click">
</Article>
</li>
</ul>
<ul class="hits" v-if="results_nob.length">
<li class="article_container" v-for="(result, index) in results_nob" :key="index + results_hash" tabindex="-1">
</div>
</div>
<div class="hits" v-if="$vuetify.breakpoint.mdAndUp && lang!='bm'" v-bind:class="{'wide': lang=='nn'}">
<div class="dict-label-top"> <span role="heading" aria-level="2" class="dict-label-title"> nynorskordboka </span><span v-if="count_nn != 1"> | <span v-if="count_nn == 0">{{$t('notifications.no_results')}}</span><span v-else>{{count_nn}} {{$t('notifications.results')}}</span></span></div>
<div class="article_container" v-for="(result, index) in results_nn" :key="index + nn_hash">
<Article
:article="result"
:title_id="`result${index + results_bm.length}`"
:queryPattern="queryPattern"
:scope="scope"
@article-click="article_link_click"
@details-click="details_click"
:class="right_col_class_name">
@details-click="details_click">
</Article>
</li>
</ul>
</div>
</div>
</div>
<Pagination v-if="show_pagination && !$parent.waiting" @update-page="$emit('update-page')" bottom/>
<div>
</div>
</section>
</template>
<script>
import Article from './Article.vue'
import Pagination from './Pagination.vue'
export default {
name: 'SearchResults',
props: {
hits: Array,
lang: String
results_bm: Array,
results_nn: Array,
lang: String,
meta: Object,
queryPattern: String,
scope: String
},
computed: {
right_col_class_name: function() {
if (this.$vuetify.breakpoint.mdAndUp) {
if (this.results_bob.length) {
return 'righ_hand_column'
}
both_hash: function(){
return this.results_bm.concat(this.results_nn).reduce((hash, hit) => (hash + hit.article_id) % 10000, 0)
},
bm_hash: function(){
return this.results_bm.reduce((hash, hit) => (hash + hit.article_id) % 10000, 0)
},
nn_hash: function(){
return this.results_nn.reduce((hash, hit) => (hash + hit.article_id) % 10000, 0)
},
count_bm: function(){
if (this.$parent.article_info.articles.bm ){
return this.$parent.article_info.articles.bm.length
}
else {
return 0
}
return ''
},
results_bob: function(){
return this.hits.filter(hit => hit.dictionary == 'bob')
count_nn: function(){
if (this.$parent.article_info.articles.nn ){
return this.$parent.article_info.articles.nn.length
}
else {
return 0
}
},
results_nob: function(){
return this.hits.filter(hit => hit.dictionary == 'nob')
show_pagination: function() {
return !this.$parent.article && this.$parent.article_info && (this.count_bm > this.$parent.perPage || this.count_nn > this.$parent.perPage)
},
results_hash: function(){
return this.hits.reduce((hash, hit) => (hash + hit.article_id) % 10000, 0)
}
show_per_page: function() {
return this.$parent.article_info && (this.count_bm > 10 || this.count_nn > 10) && !this.$parent.article
},
},
methods: {
article_link_click: function(item) {
......@@ -58,76 +121,118 @@ export default {
},
details_click: function(item) {
this.$emit('details-click', item)
}
},
},
components: {
Article
Article,
Pagination
}
}
</script>
<style >
h2 {
<style>
.article h3 {
color: var(--v-primary-base);
margin: 0px;
padding: 20px 0px 20px 0px;
}
.hits {
margin-top:0px;
}
.flex-container {
padding-top: 0px;
display: flex;
}
.flex-container.xs, .flex-container.sm {
flex-direction: column;
.flex-container.sm, .flex-container.xs {
padding-top: 0px;
}
.flex-container > ul {
padding: 0px !important;
.hits {
min-width: 50%;
}
#search_results details.xs, #search_results details.sm {
display: none;
.hits.wide {
min-width: 50%;
}
#search_results .article_content.xs, #search_results .article_content.sm {
position: relative;
height: 100px;
overflow: hidden;
.flex-container.sm .hits, .flex-container.xs .hits {
min-width: 100%;
display: flex;
flex-direction: column;
}
.results-count {
color: var(--v-primary-base);
margin-left: 24px;
#search_results .article_content.xs > section, #search_results .article_content.sm > section {
display: none;
}
#search_results .article_content.xs h3, #search_results .article_content.sm h3 {
display: none;
}
.pagination {
display: flex;
flex-wrap: wrap;
#search_results .article_content.xs > section.definitions, #search_results .article_content.sm > section.definitions {
display: block;
}
#search_results .article_content.xs > .fade, #search_results .article_content.sm > .fade {
display: inline-block;
text-align: right;
font-size: 20px;
.total-results {
font-weight: bold;
color: var(--v-primary-base);
padding-top: 30px;
width:100%;
height:60px;
position:absolute;
left:0;
top:40px;
background:linear-gradient(rgba(255, 255, 255, 0) 0px, var(--v-tertiary-base));
}
article.righ_hand_column div.inflection-wrapper {
right: -35px;
.result-counts {
padding: 10px;
justify-content: right !important;
}
.total-results, .dict-counts {
white-space: nowrap;
}
.pagination ul {
padding-inline-start: 0px !important;
justify-content: right;
}
#per-page {
padding-bottom: 10px;
padding-right: 10px;
margin-left: 10px;
display: flex;
flex-direction: row;
gap: 10px;
align-items: baseline;
}
.per-page-select {
max-width: 64px;;
}
.pagination-container {
margin-left: 10px;
padding-bottom: 10px;
display: flex;
flex-wrap: wrap;
gap: 10px;
align-items: center;
}
.lg .pagination-container, .xl .pagination-container {
padding-top: 10px;
}
.dict-label-title {
color: var(--v-primary-base) ;
font-weight: bold;
font-size: 24px;
font-variant-caps: all-small-caps;
}
.dict-label-top {
padding: 10px;
padding-left: 24px;
}
</style>
<template>
<div id="search_toolbar" :class="$vuetify.breakpoint">
<v-card v-if="$vuetify.breakpoint.smAndDown" rounded="xl" min-height="38px">
<v-list two-line v-if="expanded" id="settings-list">
<v-list-item>
<v-select
v-model="$parent.$parent.pos_selected"
hide-details
:menu-props="{ offsetY: true }"
:aria-label="$t('options.pos')"
:items="pos_items"
append-icon="expand_more"
@input="updatePos">
</v-select>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="fulltext"
hide-details
:label="$t('options.fulltext')"/>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="inflected_results"
hide-details=""
:label="$t('options.inflected')"/>
</v-list-item>
<v-list-item v-if="($route.name == 'search' || $route.name == 'word') && $store.state.collapseArticles != 'auto'">
<v-switch hide-details dense v-model="updateCollapse" :label="$t('options.collapse')"></v-switch>
</v-list-item>
</v-list>
<v-btn v-if="$vuetify.breakpoint.smAndDown"
class="search_options"
v-bind:class="{'expanded': expanded}"
height="38px"
rounded
text
@click="expanded=!expanded"
:aria-expanded="expanded ? 'true' : 'false'"
aria-controls="settings-list">
{{expanded? '' : $t('options.title')}}<v-icon small color="primary" :right="!expanded">{{expanded ? 'expand_less': 'expand_more'}}</v-icon></v-btn>
</v-card>
<div id="desktop_toolbar" v-else>
<span>
<v-checkbox
v-model="inflected_results"
dense
hide-details
:label="$t('options.inflected')"/>
</span>
<span>
<v-checkbox
v-model="fulltext"
dense
hide-details
:label="$t('options.fulltext')"/>
</span>
<span id="toolbar-pos-select">
<v-select
v-model="$parent.$parent.pos_selected"
hide-details
:menu-props="{ offsetY: true }"
dense
:aria-label="$t('options.pos')"
:items="pos_items"
append-icon="expand_more"
@input="updatePos">
</v-select>
</span>
<span id="display-options" v-if="($route.name == 'search' || $route.name == 'word') && $store.state.collapseArticles != 'auto'">
<v-switch v-model="updateCollapse" hide-details dense :label="$t('options.collapse')"></v-switch>
</span>
</div>
</div>
</template>
<script>
export default {
name: "SearchToolbar",
data: function() {
return {
expanded: false
}
},
computed: {
updateCollapse: {
get () { return this.$store.state.collapseArticles != "never"},
set(value) {
if (value) this.$store.commit("setCollapse", "always")
else this.$store.commit("setCollapse", "never")
}
},
inflected_results: {
get() {
return this.$parent.$parent.scope.includes("i")
},
set() {
if (this.$parent.$parent.scope.includes("i")) {
this.$emit('updateScope', this.$parent.$parent.scope.replace("i",""))
}
else {
this.$emit('updateScope', this.$parent.$parent.scope + "i")
}
}
},
fulltext: {
get() {
return this.$parent.$parent.scope.includes("f")
},
set() {
if (this.$parent.$parent.scope.includes("f")) {
this.$emit('updateScope', this.$parent.$parent.scope.replace("f",""))
}
else {
this.$emit('updateScope', this.$parent.$parent.scope + "f")
}
}
},
pos_items: function() {
let items = ["VERB", "NOUN", "ADJ", "PRON", "DET", "ADV", "ADP", "CCONJ", "SCONJ", "INTJ"].map(tag =>{
return {text: this.$t("pos_tags_plural." + tag ), value: tag}
})
items.unshift({text: this.$t('all_pos'), value: null})
return items
}
},
methods: {
reset () {
this.$emit('updatePos', "ALL")
this.$emit('updateScope', "ei")
},
updatePos (pos) {
this.$emit('updatePos', pos)
}
}
}
</script>
<style scoped>
.v-card {
padding-top: 0px !important;
padding-bottom: 24px !important;
padding-top: 10px;
margin-top: 10px;
min-height: 36px;
}
.v-list-item {
padding-left: 24px;
padding-right: 24px;
}
.search_options {
position: absolute;
min-height: 36px;
bottom: 0px;
left: 0px;
border-radius: 28px;
float: left;
width: 100%;
}
.search_options.expanded {
border-top-left-radius: 0px;
border-top-right-radius: 0px;
min-height: 24px;
}
#desktop_toolbar {
display: flex;
padding-left: 10px;
margin-right: 10px;
gap: 24px;
}
#search_toolbar {
margin-bottom: 10px;
}
.md#search_toolbar, .lg#search_toolbar, .xl#search_toolbar {
padding-top: 10px;
}
#desktop_toolbar v-combobox {
width: 300px;
}
#toolbar-pos-select {
max-width: 200px;
}
.v-input {
margin-top: 0px;
}
</style>
<template>
<div>
<v-list subheader>
<v-list-item>
<v-checkbox
v-model="toggleInflectionExpanded"
:label="$t('settings.inflection_expanded')"
hide-details>
</v-checkbox>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="toggleInflectionNo"
:label="$t('settings.inflection_no')"
hide-details>
</v-checkbox>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="disableHotkey"
:label="$t('settings.disable_hotkey')"
hide-details>
</v-checkbox>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="toggleInflectionTableContext"
:label="$t('settings.inflection_table_context')"
hide-details>
</v-checkbox>
</v-list-item>
<v-list-item>
<v-radio-group mandatory two-line v-model="updateCollapse" :label="$t('settings.collapse.description')">
<v-radio value="auto" :label="$t('settings.collapse.auto')"></v-radio>
<v-radio value="always" :label="$t('settings.collapse.always')"></v-radio>
<v-radio value="never" :label="$t('settings.collapse.never')"></v-radio>
</v-radio-group>
</v-list-item>
</v-list>
</div>
</template>
<script>
export default {
name: "Settings",
computed: {
toggleInflectionNo: {
get () { return this.$store.state.showInflectionNo},
set () { this.$store.commit("toggleInflectionNo")
}
},
disableHotkey: {
get () { return this.$store.state.disableHotkey},
set () { this.$store.commit("disableHotkey")
}
},
toggleInflectionExpanded: {
get () { return this.$store.state.inflectionExpanded},
set () { this.$store.commit("toggleInflectionExpanded")
}
},
toggleInflectionTableContext: {
get () {
return this.$store.state.inflectionTableContext},
set () {
this.$store.commit("toggleInflectionTableContext")
}
},
updateCollapse: {
get () { return this.$store.state.collapseArticles},
set(value) {
this.$store.commit("setCollapse", value)
}
},
},
}
</script>
<template>
<div :lang="$parent.lang_tag_locale" class = "split-inf" v-if="split_inf">kløyvd infinitiv: <em>-a</em>
<v-menu tile
v-model="menu"
offset-x max-width="200px">
<template v-slot:activator="{ on, attrs }">
<v-btn :aria-label="$t('split_inf.label', $parent.content_locale)"
small
icon
v-on="on"
v-bind="attrs"
class="info-button">
<v-icon color="primary"
small>info</v-icon>
</v-btn>
</template>
<v-card tile
class="info-card">
{{$t('split_inf.content[0]', $parent.content_locale)}} <em>-a</em> {{$t('split_inf.content[1]', $parent.content_locale)}}
<a target="_blank"
href="https://www.sprakradet.no/svardatabase/sporsmal-og-svar/kloyvd-infinitiv-/">{{$t('split_inf.content[2]', $parent.content_locale)}}</a>
</v-card>
</v-menu>
</div>
</template>
<script>
export default {
name: "SplitInf",
props: {
lemmas: Array
},
data: function() {
return {
menu: false,
long_lemma: false
}
},
computed: {
split_inf: function() {
return this.lemmas[0].split_inf
}
}
}
</script>
<style>
.split-inf {
padding-top: 10px;
}
</style>
\ No newline at end of file
......@@ -4,8 +4,8 @@
{{body.lemmas[0]}}
</span>
<ul>
<DefElement :body="body.intro" v-if="body.intro" :dictionary="dictionary" @article-click="article_link_click" />
<Definition :level="9" :body="body.article.body.definitions[0]" :dictionary="dictionary" @article-click="article_link_click" />
<DefElement :body="body.intro" v-if="body.intro" :dictionary="dictionary" @article-click="article_link_click" @error="article_error"/>
<Definition :level="9" :body="body.article.body.definitions[0]" :dictionary="dictionary" @article-click="article_link_click" @error="article_error"/>
</ul>
</li>
</template>
......@@ -33,6 +33,9 @@ export default {
methods: {
article_link_click: function(item) {
this.$emit('article-click', item)
},
article_error: function(payload) {
this.$emit('error', payload)
}
}
}
......
<template>
<div>
<v-app-bar class = "top-bar" dense elevation="0" dark color="primary">
<v-app-bar-title class="beta" :title="release" aria-label="Ordbøkene: Bokmålsordboka og Nynorskordboka"><a href ="/">{{$vuetify.breakpoint.smAndDown ? 'Ordbøkene' : 'ordbøkene.no'}}</a></v-app-bar-title>
<v-spacer/>
<v-divider vertical/>
<v-toolbar-items>
<v-divider vertical />
<v-btn id="locale_button"
aria-haspopup="dialog"
aria-label="Locale | Visningsspråk"
icon @click.native="chooseLocale = !chooseLocale">
<v-icon>language</v-icon></v-btn>
<v-divider vertical />
<v-btn id="top_menu"
:aria-expanded="menuOpen? 'true' : 'false'"
aria-haspopup="dialog"
width="96px"
aria-labelledby="menu_label"
text @click.native="menuOpen = !menuOpen">
<span id="menu_label">{{$t('menu.title')}}</span><v-icon right>{{menuOpen? 'close' : 'menu'}}</v-icon></v-btn>
</v-toolbar-items>
<v-divider vertical/>
</v-app-bar>
<v-dialog origin="48px center" content-class="dialogMenu" aria-labelledby="menu_label" max-width="1200" width="1200" v-model="menuOpen" hide-overlay
:close-on-content-click="false" transition="dialog-top-transition">
<Menu @close="menuOpen=false"/>
</v-dialog>
<v-dialog max-width="600px" v-model="chooseLocale">
<v-card>
<v-toolbar elevation="0" color="primary" text>
<v-toolbar-title class="language-dialog-title">Locale | Visningsspråk</v-toolbar-title></v-toolbar>
<v-card-text class="text--primary">
<v-list three-line>
<v-list-item link v-on:click="choose_locale('nob')">
<v-list-item-content>
<v-list-item-title>Norsk (bokmål)</v-list-item-title>
<v-list-item-subtitle>Vis overskrifter, knapper og menyer på bokmål</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-list-item link v-on:click="choose_locale('nno')">
<v-list-item-content>
<v-list-item-title>Norsk (nynorsk)</v-list-item-title>
<v-list-item-subtitle>Vis overskrifter, knappar og menyar på nynorsk</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-list-item link v-on:click="choose_locale('eng')">
<v-list-item-content>
<v-list-item-title>English</v-list-item-title>
<v-list-item-subtitle>Choose English as display language for headings, buttons and menus</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-list-item link v-on:click="choose_locale('ukr')">
<v-list-item-content>
<v-list-item-title>Українська (ukrainsk)</v-list-item-title>
<v-list-item-subtitle>Виберіть українську як мову відображення заголовків, кнопок і меню</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>
<script>
import Menu from './Menu.vue'
export default {
name: "TopBar",
data: function() {
return {
version_label: process.env.VUE_APP_VERSION_LABEL,
release: process.env.VUE_APP_RELEASE,
chooseLocale: false
}
},
computed: {
menuOpen: {
get() {
return this.$store.state.menuOpen
},
set () {
this.$store.commit('toggleMenu')
}
}
},
methods: {
home: function() {
this.$router.push('/')
},
choose_locale: function(locale) {
this.$store.commit("setLocale", {value: locale, i18n: this._i18n})
this.chooseLocale = false
}
},
components: {
Menu
},
}
</script>
<style >
.dialogMenu {
margin: 0px !important;
align-self: flex-start !important;
margin-top: 48px !important;
}
.v-app-bar-title a {
text-decoration: none;
color: white !important;
}
</style>
\ No newline at end of file
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
function loadLocaleMessages () {
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
const messages = {}
locales.keys().forEach(key => {
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
if (matched && matched.length > 1) {
const locale = matched[1]
messages[locale] = locales(key)
}
})
return messages
}
export default new VueI18n({
fallbackLocale: 'eng',
silentTranslationWarn: true,
messages: loadLocaleMessages()
})
{
"sub_title": "Bokmålsordboka and Nynorskordboka",
"monthly": "Titbits from the dictionaries",
"pick_ukrainian": "try it",
"pick_ukrainian_long": "try ukrainian display language",
"ukrainian_flag": "Ukrainian flag",
"photo": "Photo by Alina Scheck (unsplash.com)",
"close": "Close",
"cancel": "Cancel",
"or": " or ",
"and": " and ",
"from": "from",
"dicts_from": {
"bm": "bokmål dictionary",
"nn": "nynorsk dictionary"
},
"to_top": "Back to top",
"home": "Home",
"accessibility_statement": "Accessibility statement",
"per_page": "Results per page: ",
"search_placeholder": "Search in ",
"footer_description": " show spelling and inflection in line with official Norwegian spelling. The Language Council and the University of Bergen are behind the dictionaries.",
"accessibility": {
"menu": "Open top menu",
"main_content": "Skip to main content",
"bm": "Skip to results in the Bokmål dictionary",
"nn": "Skip to results in the Nynorsk dictionary",
"homograph": "Meaning "
},
"dicts": {
"nn": "Nynorsk dictionary",
"bm": "Bokmål dictionary",
"bm,nn": "Both dictionaries"
},
"dicts_inline": {
"nn": "the Nynorsk dictionary",
"bm": "the Bokmål dictionary",
"bm,nn": "the dictionaries"
},
"dicts_short": {
"nn": "nynorsk",
"bm": "bokmål",
"bm,nn": "both"
},
"menu": {
"title": "Menu",
"help": "Help",
"about": "About"
},
"options": {
"title": "Search options",
"inflected": "Include inflected forms",
"fulltext": "Full-text search",
"pos": "Part of speech",
"collapse": "Collapse articles"
},
"all_pos": "all parts of speech",
"tags": {
"NOUN": "noun",
"VERB": "verb",
"ADJ": "adjective",
"ADP": "preposition",
"PFX": "prefix",
"ADV": "adverb",
"DET": "determinative",
"PROPN": "proper noun",
"ABBR": "abbreviation",
"INTJ": "interjection",
"SYM": "symbol",
"PRON": "pronoun",
"CCONJ": "conjunction",
"SCONJ": "subjunction",
"INFM": "infinitive particle",
"COMPPFX": "in compounds",
"Masc": "masculine",
"Fem": "feminine",
"Neuter": "neuter",
"Uninfl": "uninflectable"
},
"pos_tags_plural": {
"NOUN": "nouns",
"PRON": "pronouns",
"DET": "determinatives",
"ADJ": "adjectives",
"CCONJ": "conjunctions",
"SCONJ": "subjunctions",
"ADV": "adverbs",
"ADP": "prepositions",
"VERB": "verbs",
"INTJ": "interjections"
},
"determiner": {
"Quant": "quantifier",
"Dem": "demonstrative",
"Poss": "possessive"
},
"split_inf": {
"title": "split infinitive",
"label": "More information about split infinitive",
"content": ["If you use split infinitive, the infinitive form of this verb will have the suffix", "", "Read more here (Norwegian)"]
},
"settings": {
"title": "Settings",
"inflection_no": "Show inflection codes",
"disable_hotkey": "Disable search field hotkey",
"inflection_expanded": "Always show inflection tables in expanded articles",
"inflection_table_context": "Show context for participle forms in the inflection tables",
"locale": {
"title": "Locale" ,
"description": "Change the language of headings, buttons, messages, and menus. This will not affect examples and definitions: the Bokmål dictionary will remain in Bokmål and the Nynorsk dictionary stays Nynorsk. "
},
"dict": {
"title": "Default dictionaries",
"description": "Default dictionary settings for which of the dictionaries to be queried when using ordbokene.no. The settings will not affect current searches or links to searches in dictionaries. To change the dictionary during use, change the settings temporarily via the menu to the right of the search field. "
},
"collapse": {
"description": "Default search presentation settings. Choose between seeing complete articles, article excepts or an automatically generated presentation.",
"auto": "Auto (excerpts when more than two results)",
"always": "Show excerpts of articles",
"never": "Show complete articles"
},
"reset": "Delete stored settings"
},
"contact": {
"title": "Contact us",
"content": [
"The content of the dictionaries",
"Functionality and bug reports",
"Feedback and questions regarding words, inflected forms and other content of the dictionaries: ",
"Report bugs or give feedback regarding the user interface: "
],
"faq": {
"title": "Frequently asked questions:",
"items": [
{"title": "Why are some words missing in the dictionaries?",
"text": [" are not to be regarded as lists of words permitted to use in Norwegian. There are many words – old as well as new – that are not in the dictionaries. But you can use anyway. New words do not need official approval before they can be used. It is the language users who jointly decide which words are commonly used in Norwegian. Normally, new words do not enter the dictionaries until they have been in use for some time and are well-established in the language. The dictionary editors decide which words are to be included based on surveys of large text corpora, and the Norwegian Language Council decides how the words are to be spelled and inflected. ",
"Read more in the About-page"]
},
{"title": "Where are the inflection codes from the printed dictionaries?", "text": "You can toggle this feature in settings, which is located at the bottom of the page and in the navigation menu."},
{"title": "Can I avoid having to click “show inflection” and “show article”?", "text": "Yes, you can change this in settings, which is located at the bottom of the page and in the navigation menu. Choose “Always show inflection tables in expanded articles” and “Show complete articles” if you want to reduce the number of clicks as much as possible."}
]
}
},
"notifications": {
"inflected": " is a form of ",
"similar": "Did you mean:",
"similar_bm": "Add similar results from Bokmålsordboka: ",
"similar_nn": "Add similar results from the Nynorsk dictionary: ",
"search": "Search",
"back": "Back to search",
"no_results": "No results",
"results": "results",
"ignored_words": "The search was ignored because we limit queries to 20 words.",
"ignored_chars": "The search was ignored because we do not accept words with more than 40 characters.",
"no_pos_results": " (no matching {pos})",
"suggest_dict": [
"Did you search in the wrong dictionary?",
"Try searching"
],
"fulltext": "Suggested full-text searches:"
},
"article": {
"definition": "Definition",
"show": "Show article",
"show_inflection": "Inflection",
"hide_inflection": "Inflection",
"share": "Share the word",
"copy_link": "Copy link",
"cite": "Cite",
"cite_title": "Cite the article",
"cite_description": ["If you want to cite this article in the ", " we recommend that you state when the article was retrieved (read), e. g. as follows:"],
"copy": "Copy",
"download": "Download RIS file",
"link_copied": "Link copied to the clipboard",
"citation_copied": "Citation copied to the clipboard",
"citation": "« {lemma} ». In: <em> {dict}. </em> Språkrådet & Universitetet i Bergen. &lt;<a href='{link}'> {link} </a>&gt; ( retrieved {dd}. {mm}. {yyyy}). ",
"headings": {
"etymology": "Etymology",
"pronunciation": "Pronunciation",
"expressions": "Set phrases",
"definitions": "Senses and Example Sentences",
"examples": "Example"
}
},
"error": {
"article": "An error has occured in article {no} in {dict}",
"404": {
"title": "404: Not Found",
"description": "The page may have been deleted or moved, or you may have used an invalid link."
},
"503": {
"title": "503: Unavailable service",
"description": "The server is temporarily overloaded or under maintenance."
},
"server": {
"title": "Server Error",
"description": "Something went wrong on the server side (status code: {code})"},
"generic_code": {
"title": "Error",
"description": "An unexpected error occurred while communicating with the server (status code: {code})"},
"network": {
"title": "Connection Error",
"description": "A network problem prevented the page from loading. Please try reloading the page or check if you are connected to the internet."},
"no_article": "The server could not find an article with ID {id}. The article may have been deleted or moved, or you may have used an invalid link.",
"generic": {
"title": "Error",
"description": "Something went wrong ..."
}
}
}
\ No newline at end of file
{
"sub_title": "Bokmålsordboka og Nynorskordboka",
"photo": "Foto: Alina Scheck (unsplash.com)",
"background": "Bakgrunnsbilde",
"monthly": "Smakebitar frå ordbøkene",
"pick_ukrainian": "prøv det",
"pick_ukrainian_long": "prøv ukrainske hjelpetekster",
"ukrainian_flag": "Ukrainsk flagg",
"close": "Lukk",
"cancel": "Avbryt",
"to_top": "Til toppen",
"home": "Til forsida",
"accessibility_statement": "Tilgjengeerklæring",
"per_page": "Resultat per side: ",
"or": " eller ",
"and": " og ",
"from": "frå",
"dicts_from": {
"bm": "bokmålsordboka",
"nn": "nynorskordboka"
},
"search_placeholder": "Søk i ",
"footer_description": " viser skrivemåte og bøying i tråd med norsk rettskriving. Språkrådet og Universitetet i Bergen står bak ordbøkene.",
"accessibility": {
"menu": "Opne toppmeny",
"main_content": "Gå til hovudinnhald",
"bm": "Gå til treff i Bokmålsordboka",
"nn": "Gå til treff i Nynorskordboka",
"homograph": "Tyding "
},
"dicts": {
"nn": "Nynorskordboka",
"bm": "Bokmålsordboka",
"bm,nn": "begge ordbøkene"
},
"dicts_inline": {
"nn": "Nynorskordboka",
"bm": "Bokmålsordboka",
"bm,nn": "ordbøkene"
},
"dicts_short": {
"nn": "nynorsk",
"bm": "bokmål",
"bm,nn": "begge"
},
"menu": {
"title": "Meny",
"help": "Hjelp til søk",
"about": "Om ordbøkene"
},
"options": {
"title": "Søkjealternativ",
"inflected": "Søk i bøygde former",
"fulltext": "Fritekstsøk",
"pos": "Ordklasse",
"collapse": "Komprimer artiklar"
},
"all_pos": "alle ordklasser",
"tags": {
"NOUN": "substantiv",
"VERB": "verb",
"ADJ": "adjektiv",
"ADP": "preposisjon",
"PFX": "prefiks",
"ADV": "adverb",
"DET": "determinativ",
"PROPN": "eigennamn",
"ABBR": "forkorting",
"INTJ": "interjeksjon",
"SYM": "symbol",
"PRON": "pronomen",
"CCONJ": "konjunksjon",
"SCONJ": "subjunksjon",
"INFM": "infinitivsmerke",
"COMPPFX": "i samansetjing",
"Masc": "hankjønn",
"Fem": "hokjønn",
"Neuter": "inkjekjønn",
"Uninfl": "ubøyeleg"
},
"pos_tags_plural": {
"NOUN": "substantiv",
"PRON": "pronomen",
"DET": "determinativ",
"ADJ": "adjektiv",
"CCONJ": "konjunksjonar",
"SCONJ": "subjunksjonar",
"ADV": "adverb",
"ADP": "preposisjonar",
"VERB": "verb",
"INTJ": "interjeksjonar"
},
"determiner": {
"Quant": "kvantor",
"Dem": "demonstrativ",
"Poss": "possessiv"
},
"split_inf": {
"title": "kløyvd infinitiv",
"label": "Meir informasjon om kløyvd infinitiv",
"content": ["Dersom du bruker kløyvd infinitiv, skal dette verbet ha", "i infinitiv.", "Les meir her"]
},
"settings": {
"title": "Innstillingar",
"inflection_no": "Vis bøyingskodane frå dei trykte ordbøkene",
"disable_hotkey": "Slå av hurtigtast for søkjefeltet",
"inflection_expanded": "Vis alltid bøyingstabellane i fullstendige artiklar",
"inflection_table_context": "Vis kontekst for partisippformer i bøyingstabellane",
"locale": {
"title": "Språk",
"description": "Her kan du endre språk på knappar, meldingar og menyar. Dette påverkar ikkje tydingar og døme i ordbøkene: Bokmålsordboka kjem framleis til å vere på bokmål, og Nynorskordboka kjem til å vere på nynorsk."
},
"collapse": {
"description": "Vel når artiklane skal komprimerast til eit utdrag av tydingane.",
"auto": "Automatisk (meir enn to resultat)",
"always": "Vis berre utdrag",
"never": "Vis berre fullstendige artiklar"
},
"reset": "Slett lagra innstillingar"
},
"contact": {
"title": "Kontakt oss",
"content": [
"Innhaldet i ordbøkene",
"Funksjonalitet og tekniske feil",
"Spørsmål og tilbakemeldingar med omsyn til ord, bøyingsformer og anna innhald i ordbøkene: ",
"Rapporter tekniske feil og gje tilbakemeldingar på brukargrensesnittet: "
],
"faq": {
"title": "Ofte stilte spørsmål:",
"items": [
{"title": "Kvifor manglar somme ord i ordbøkene?",
"text": [" er ikkje å rekne som lister over kva ord som er tillatne å bruke på norsk. Det finst mange ord, både gamle og nye, som ikkje er med i ordbøkene, men som du gjerne kan bruke likevel. Det er heller ikkje slik at nye ord må godkjennast før dei kan takast i bruk, det er språkbrukarane som i fellesskap avgjer kva ord som er gangbare i norsk. Normalt kjem ikkje nye ord inn i ordbøkene før dei har vore i bruk ei stund og er etablerte i språket. Ordbokredaksjonen avgjer kva ord som skal vere med basert på undersøkingar av store tekstsamlingar, og Språkrådet avgjer korleis orda skal stavast og bøyast. ",
"Les meir på informasjonssida"]
},
{"title": "Kvar er bøyingskodane frå dei trykte ordbøkene?", "text": "Du kan hake av for «Vis bøyingskodane frå dei trykte ordbøkene» i innstillingane, som du finn nedst på sida og i menyen øvst til høgre på sida."},
{"title": "Kan eg sleppe å trykkje «vis bøying» og «vis artikkel»?", "text": "Ja, du kan endre dette i innstillingane, som du finn nedst på sida og i menyen øvst til høgre på sida. Hak av for «Vis alltid bøyingstabellane i fullstendige artiklar» og «Vis berre fullstendige artiklar» dersom du ønskjer minst mogleg klikking."}
]
}
},
"notifications": {
"inflected": " er ei form av ",
"similar": "Meinte du:",
"similar_bm": "Legg til liknande treff frå Bokmålsordboka: ",
"similar_nn": "Legg til liknande treff frå Nynorskordboka: ",
"search": "Søk i ordbøkene",
"back": "Tilbake til søkjeresultata",
"no_results": "Ingen treff",
"results": "treff",
"ignored_words": "Søket vart ignorert fordi vi avgrensar talet på førespurnader til 20 ord.",
"ignored_chars": "Søket vart ignorert fordi vi ikkje tillèt søkjeord med meir enn 40 teikn.",
"no_pos_results": " i søk på {pos}",
"suggest_dict": [
"Har du søkt i feil ordbok?",
"Prøv å søkje i "
],
"fulltext": "Forslag til fritekstsøk:"
},
"article": {
"definition": "Definisjon",
"show": "Vis artikkel",
"show_inflection": "Vis bøying",
"hide_inflection": "Skjul bøying",
"share": "Del ordet",
"copy_link": "Kopier lenkje",
"cite": "Sitere",
"cite_title": "Sitere artikkelen",
"cite_description": ["Ønskjer du å sitere denne artikkelen i ", ", rår vi deg til å gje opp når artikkelen vart henta (lesen), t.d. slik:"],
"copy": "Kopier",
"download": "Last ned RIS-fil",
"link_copied": "Lenkja er kopiert til utklippstavla",
"citation_copied": "Sitatet er kopiert til utklippstavla",
"citation": "«{lemma}». I: <em>{dict}.</em> Språkrådet og Universitetet i Bergen. &lt;<a href='{link}'>{link}</a>&gt; (lesen {dd}.{mm}.{yyyy}).",
"headings": {
"etymology": "Opphav",
"pronunciation": "Uttale",
"expressions": "Faste uttrykk",
"definitions": "Tyding og bruk",
"examples": "Døme"
}
},
"error": {
"article": "Det har oppstått ein feil i artikkel {no} i {dict}",
"404": {
"title": "404: Ikkje funne",
"description": "Sida kan ha blitt sletta eller flytta, eller du kan ha brukt ei ugyldig lenkje."
},
"503": {
"title": "503: Utilgjengeleg teneste",
"description": "Tenaren er mellombels overbelasta eller under vedlikehald."
},
"server": {
"title": "Feil på server",
"description": "Noko gjekk gale på serversida (statuskode: {code})"},
"generic_code": {
"title": "Feil",
"description": "Det har oppstått ein uventa feil i kommunikasjonen med serveren (statuskode: {code})"},
"network": {
"title":"Tilkoplingsfeil",
"description": "Eit nettverksproblem hindra lasting av sida. Prøv å laste sida på nytt, eller sjekk om du er kopla til internett."},
"no_article": "Serveren finn ingen artikkel med ID {id}. Artikkelen kan ha blitt sletta eller flytta, eller du kan ha brukt ei ugyldig lenkje.",
"generic": {
"title": "Feil",
"description":"Noko gjekk gale..."
}
}
}
{
"sub_title": "Bokmålsordboka og Nynorskordboka",
"photo": "Foto: Alina Scheck (unsplash.com)",
"background": "Bakgrunnsbilde",
"monthly": "Smakebiter fra ordbøkene",
"pick_ukrainian": "prøv det",
"pick_ukrainian_long": "prøv ukrainske hjelpetekster",
"ukrainian_flag": "Ukrainsk flagg",
"close": "Lukk",
"cancel": "Avbryt",
"to_top": "Til toppen",
"home": "Til forsiden",
"accessibility_statement": "Tilgjengelighetserklæring",
"per_page": "Resultater per side: ",
"or": " eller ",
"and": " og ",
"from": "fra",
"dicts_from": {
"bm": "bokmålsordboka",
"nn": "nynorskordboka"
},
"search_placeholder": "Søk i ",
"footer_description": " viser skrivemåte og bøyning i tråd med norsk rettskrivning. Språkrådet og Universitetet i Bergen står bak ordbøkene.",
"accessibility": {
"menu": "Åpne toppmeny",
"main_content": "Gå til hovedinnhold",
"bm": "Gå til treff i Bokmålsordboka",
"nn": "Gå til treff i Nynorskordboka",
"homograph": "Betydning "
},
"dicts": {
"nn": "Nynorskordboka",
"bm": "Bokmålsordboka",
"bm,nn": "begge ordbøkene"
},
"dicts_inline": {
"nn": "Nynorskordboka",
"bm": "Bokmålsordboka",
"bm,nn": "ordbøkene"
},
"dicts_short": {
"nn": "nynorsk",
"bm": "bokmål",
"bm,nn": "begge"
},
"menu": {
"title": "Meny",
"help": "Hjelp til søk",
"about": "Om ordbøkene"
},
"options": {
"title": "Søkealternativer",
"inflected": "Søk i bøyde former",
"fulltext": "Fritekstsøk",
"pos": "Ordklasse",
"collapse": "Komprimer artikler"
},
"all_pos": "alle ordklasser",
"tags": {
"NOUN": "substantiv",
"VERB": "verb",
"ADJ": "adjektiv",
"ADP": "preposisjon",
"PFX": "prefiks",
"ADV": "adverb",
"DET": "determinativ",
"PROPN": "egennavn",
"ABBR": "forkorting",
"INTJ": "interjeksjon",
"SYM": "symbol",
"PRON": "pronomen",
"CCONJ": "konjunksjon",
"SCONJ": "subjunksjon",
"INFM": "infinitivsmerke",
"COMPPFX": "i sammensetting",
"Masc": "hankjønn",
"Fem": "hunkjønn",
"Neuter": "intetkjønn",
"Uninfl": "ubøyelig"
},
"pos_tags": {
"NOUN": "substantiv",
"PRON": "pronomen",
"DET": "determinativ",
"ADJ": "adjektiv",
"CCONJ": "konjunksjon",
"SCONJ": "subjunksjon",
"ADV": "adverb",
"ADP": "preposisjon",
"VERB": "verb",
"INTJ": "interjeksjon"
},
"pos_tags_plural": {
"NOUN": "substantiv",
"PRON": "pronomen",
"DET": "determinativ",
"ADJ": "adjektiv",
"CCONJ": "konjunksjoner",
"SCONJ": "subjunksjoner",
"ADV": "adverb",
"ADP": "preposisjoner",
"VERB": "verb",
"INTJ": "interjeksjoner"
},
"determiner": {
"Quant": "kvantor",
"Dem": "demonstrativ",
"Poss": "possessiv"
},
"split_inf": {
"title": "kløyvd infinitiv",
"label": "Mer informasjon om kløyvd infinitiv",
"content": ["Dersom du bruker kløyvd infinitiv, skal dette verbet ha", "i infinitiv.", "Les meir her"]
},
"settings": {
"title": "Innstillinger",
"inflection_no": "Vis bøyningskodene fra de trykte ordbøkene",
"disable_hotkey": "Slå av hurtigtast for søkefeltet",
"inflection_expanded": "Vis alltid bøyningstabellene i fullstendige artikler",
"inflection_table_context": "Vis kontekst for partisippformer i bøyningstabellene",
"locale": {
"title": "Språk" ,
"description": "Her kan du endre språk på knapper, meldinger og menyer. Dette vil ikke påvirke definisjoner og eksempler i ordbøkene: Bokmålsordboka vil fortsatt være på bokmål, og Nynorskordboka vil være på nynorsk"
},
"collapse": {
"description": "Velg når artiklene skal komprimeres til utdrag av definisjonene.",
"auto": "Automatisk (mer enn to resultater)",
"always": "Vis bare utdrag",
"never": "Vis bare fullstendige artikler"
},
"reset": "Slett lagrede innstillinger"
},
"contact": {
"title": "Kontakt oss",
"content": [
"Innholdet i ordbøkene",
"Funksjonalitet og tekniske feil",
"Spørsmål og tilbakemeldinger angående ord, bøyningsformer og annet innhold i ordbøkene: ",
"Rapporter tekniske feil eller kom med tilbakemeldinger på brukergrensesnittet: "
],
"faq": {
"title": "Ofte stilte spørsmål:",
"items": [
{"title": "Hvorfor mangler noen ord i ordbøkene?",
"text": [" er ikke å betrakte som lister over hvilke ord som er tillatt å bruke på norsk. Det finnes mange ord, både gamle og nye, som ikke er med i ordbøkene, men som du gjerne kan bruke likevel. Det er heller ikke slik at nye ord må godkjennes før de kan tas i bruk, det er språkbrukerne som i fellesskap avgjør hvilke ord som er gangbare i norsk. Normalt kommer ikke nye ord inn i ordbøkene før de har vært i bruk en stund og er etablert i språket. Ordbokredaksjonen avgjør hvilke ord som skal være med basert på undersøkelser av store tekstsamlinger, og Språkrådet bestemmer hvordan ordene skal staves og bøyes. ",
"Les mer på informasjonssiden"]
},
{"title": "Hvor er bøyningskodene fra de trykte ordbøkene?", "text": "Du kan velge å vise bøyningskodene i innstillingene, som du finner nederst på siden og i menyen øverst til høyre på siden."},
{"title": "Kan jeg slippe å trykke «vis bøyning» og «vis artikkel»?", "text": "Ja, du kan endre dette i innstillingene, som du finner nederst på siden og i menyen øverst til høyre på siden. Velg «Vis alltid bøyningstabellene i fullstendige artikler» og «Vis bare fullstendige artikler» hvis du ønsker minst mulig klikking."}
]
}
},
"notifications": {
"inflected": " er en form av ",
"similar": "Mente du:",
"similar_bm": "Legg til lignende treff fra Bokmålsordboka: ",
"similar_nn": "Legg til lignende treff fra Nynorskordboka: ",
"search": "Søk i ordbøkene",
"back": "Tilbake til søkeresultatene",
"no_results": "Ingen treff",
"results": "treff",
"ignored_words": "Søket ble ingorert fordi vi begrenser forespørsler til 20 ord.",
"ignored_chars": "Søket ble ignorert fordi vi ikke tillater ord med flere enn 40 tegn.",
"no_pos_results": " i søk på {pos}",
"suggest_dict": [
"Har du søkt i feil ordbok?",
"Prøv å søke i "
],
"fulltext": "Forslag til fritekstsøk: "
},
"article": {
"definition": "Definisjon",
"show": "Vis artikkel",
"show_inflection": "Vis bøyning",
"hide_inflection": "Skjul bøyning",
"share": "Del ordet",
"copy_link": "Kopier lenke",
"cite": "Sitere",
"cite_title": "Sitere artikkelen",
"cite_description": ["Ønsker du å sitere denne artikkelen i ",", anbefaler vi å oppgi når artikkelen ble hentet (lest), f.eks. slik:"],
"copy": "Kopier",
"download": "Last ned RIS-fil",
"link_copied": "Lenken er kopiert til utklippstavlen",
"citation_copied": "Sitatet er kopiert til utklippstavla",
"citation": "«{lemma}». I: <em>{dict}.</em> Språkrådet og Universitetet i Bergen. &lt;<a href='{link}'>{link}</a>&gt; (hentet {dd}.{mm}.{yyyy}).",
"headings": {
"etymology": "Opphav",
"pronunciation": "Uttale",
"expressions": "Faste uttrykk",
"definitions": "Betydning og bruk",
"examples": "Eksempel"
}
},
"error": {
"article": "Det har oppstått en feil i artikkel {no} i {dict}",
"404": {
"title": "404: Ikke funnet",
"description": "Siden kan ha blitt slettet eller flyttet, eller du kan ha brukt en ugyldig lenke."
},
"503": {
"title": "503: Utilgjengelig tjeneste",
"description": "Tjeneren er midlertidig overbelastet eller under vedlikehold."
},
"server": {
"title": "Feil på server",
"description": "Noe gikk galt på serversiden (statuskode: {code})"},
"generic_code": {
"title": "Feil",
"description": "Det har oppstått en uventet feil i kommunikasjonen med serveren (statuskode: {code})"},
"network": {
"title":"Tilkoblingsfeil",
"description": "Et nettverksproblem hindret lasting av siden. Prøv å laste siden på nytt, eller sjekk om du er koblet til internett."},
"no_article": "Serveren finner ingen artikkel med ID {id}. Artikkelen kan ha blitt slettet eller flyttet, eller du kan ha brukt en ugyldig lenke.",
"generic": {
"title": "Feil",
"description":"Noe gikk galt..."
}
}
}
\ No newline at end of file
{
"sub_title": "Cловник букмола та Словник нюношка",
"photo": "фото: Alina Scheck (unsplash.com)",
"background": "Шпалери",
"monthly": "Фрагменти зі словників",
"close": "Закрити",
"cancel": "Скасувати",
"to_top": "Вгору",
"home": "На головну сторінку",
"accessibility_statement": "Декларація про доступність",
"per_page": "Результати на сторінці: ",
"or": " або ",
"and": " і ",
"from": "зі",
"dicts_from": {
"bm": "Словника букмола",
"nn": "Словника нюношка"
},
"search_placeholder": "Пошук: ",
"footer_description": " показує написання та відмінювання, відповідно до норвезької орфографії. За розробкою словників стоять Мовна рада і Бергенський університет.",
"accessibility": {
"menu": "Відкрити верхнє меню",
"main_content": "Перейти до основного вмісту",
"bm": "Перейти до знайденого в Словнику букмола",
"nn": "Перейти до знайденого в Словнику нюношка",
"homograph": "Значення"
},
"dicts": {
"nn": "Словник нюношка",
"bm": "Словник букмола",
"bm,nn": "обидва словники"
},
"dicts_inline": {
"nn": "Словник нюношка",
"bm": "Словник букмола",
"bm,nn": "словники"
},
"dicts_short": {
"nn": "нюношк",
"bm": "букмол",
"bm,nn": "обидва"
},
"menu": {
"title": "Меню",
"help": "Допомога в пошуку",
"about": "Про словник"
},
"options": {
"title": "Параметри пошуку",
"inflected": "Пошук у відмінюваних формах",
"fulltext": "Вільний текстовий пошук",
"pos": "Частини мови",
"collapse": "Скорочені статті"
},
"all_pos": "всі частини мови",
"tags": {
"NOUN": "іменник",
"VERB": "дієслово",
"ADJ": "прикметник",
"ADP": "прийменник",
"PFX": "префікс",
"ADV": "прислівник",
"DET": "детермінатив",
"PROPN": "власна назва",
"ABBR": "абревіатура",
"INTJ": "вигук",
"SYM": "символ",
"PRON": "займенник",
"CCONJ": "сурядний сполучник",
"SCONJ": "підрядний сполучник",
"INFM": "знак інфінітива",
"COMPPFX": "складне речення",
"Masc": "чоловічий",
"Fem": "жіночий",
"Neuter": "середній",
"Uninfl": "незмінні"
},
"pos_tags": {
"NOUN": "іменник",
"PRON": "займенник",
"DET": "детермінатив",
"ADJ": "прикметник",
"CCONJ": "сурядний сполучник",
"SCONJ": "підрядний сполучник",
"ADV": "прислівник",
"ADP": "прийменник",
"VERB": "дієслово",
"INTJ": "вигук"
},
"pos_tags_plural": {
"NOUN": "іменники",
"PRON": "займенники",
"DET": "детермінативи",
"ADJ": "прикметники",
"CCONJ": "сурядні сполучники",
"SCONJ": "підрядні сполучники",
"ADV": "прислівники",
"ADP": "прийменники",
"VERB": "дієслова",
"INTJ": "вигуки"
},
"determiner": {
"Quant": "kvantor",
"Dem": "demonstrativ",
"Poss": "possessiv"
},
"split_inf": {
"title": "розділений інфінітив",
"label": "Більше інформації про розділений інфінітив",
"content": ["Якщо ви використовуєте розділений інфінітив, це дієслово повинно мати", "в інфінітиві.", "Детальніше читайте тут"]
},
"settings": {
"title": "Налаштування",
"inflection_no": "Показати коди відмінювання з друкованих словників",
"disable_hotkey": "Вимкнення сполучення клавіш для рядка пошуку",
"inflection_expanded": "Завжди показувати таблиці відмінювання у повних статтях",
"inflection_table_context": "Показувати контекст для форм дієприкметників у таблицях відмінювання",
"locale": {
"title": "Мова" ,
"description": "Тут ви можете змінити мову кнопок, повідомлень та меню. Це не вплине на визначення та приклади у словниках: Словник букмола все одно буде на букмолі, а Словник нюношка - на нюношку"
},
"collapse": {
"description": "Виберіть параметри пошуку: від повних статей до скорочених витягів з визначенням або автоматичний підбір.",
"auto": "Автоматичний (більше двох результатів)",
"always": "Показувати лише витяги",
"never": "Показувати лише повні статті"
},
"reset": "Видалити збережені налаштування"
},
"contact": {
"title": "Зв’язатися з нами",
"content": [
"Зміст словника",
"Функціональність та технічні помилки",
"Питання та відгуки про слова, відмінювання та інший вміст словника: ",
"Повідомте про технічні помилки або залиште відгуки про інтерфейс користувача: "
],
"faq": {
"title": "Поширені запитання:",
"items": [
{"title": "Чому в словниках відсутні деякі слова?",
"text": [" не варто розглядати як список слів, які дозволено вживати в норвезькій мові. Є багато слів, як старих, так і нових, яких немає у словниках, але ви все одно можете їх вживати. Це також не означає, що нові слова повинні бути схвалені, перш ніж їх можна буде використовувати, користувачі мови спільно вирішують, які слова прийнятні в норвезькій мові. Зазвичай нові слова не потрапляють до словників, поки вони не будуть у вжитку певний час і не закріпляться в мові. Редактори словників вирішують, які слова включати на основі оглядів великих текстових колекцій, а Мовна рада вирішує, як ці слова варто писати й відмінювати. ",
"Детальніше читайте на інформаційній сторінці"]
},
{"title": "Де коди відмінювання з друкованих словників?",
"text": "Ви можете вибрати показ кодів відмінювання в налаштуваннях, які можна знайти внизу сторінки і в меню в правому верхньому куті сторінки."},
{"title": "Чи можу я уникнути натискання “показати відмінювання” та “показати статтю”?",
"text": "так, ви можете змінити це в налаштуваннях, які можна знайти внизу сторінки та в меню у верхньому правому куті сторінки. Виберіть “Завжди показувати таблиці відмінювання у повних статтях” та “Показувати лише повні статті”, якщо ви хочете, щоб кількість натискань була найменшою."}
]
}
},
"notifications": {
"inflected": "знайдене у відмінюваних формах ",
"similar": "Пропозиції щодо пошуку",
"similar_bm": "Додайте подібні збіги зі Словника Букмола: ",
"similar_nn": "Додайте подібні збіги зі Словника Нюношка: ",
"search": "Шукайте в словнику",
"back": "Повернутися до результатів пошуку",
"no_results": "Збігів немає",
"results": "знайдено",
"more": "Показати більше",
"less": "Показати менше",
"fuzzy": "Схожі ключові слова",
"headwords": "Слова і словосполучення",
"feedback-title": "Ви знайшли те, що шукали?",
"like": "Так",
"dislike": "Ні",
"thanks": "Дякуємо за ваш відгук!",
"ignored_words": "Пошук було призупинено, оскільки ми обмежуємо запити 20 словами.",
"ignored_chars": "Пошук було проігноровано, оскільки ми не дозволяємо використовувати слова довжиною понад 40 символів.",
"no_pos_results": " в пошуку {pos}",
"suggest_dict": [
"Ви шукали не в тому словнику?",
"Спробуйте пошукати в "
],
"fulltext": "Результати пошуку по вільному тексту: "
},
"article": {
"definition": "Визначення",
"show": "Показати статтю",
"show_inflection": "Показати відмінювання",
"hide_inflection": "Приховати відмінювання",
"share": "Поділитися цим словом",
"copy_link": "Скопіювати посилання",
"cite": "Цитувати",
"cite_title": "Процитуйте статтю",
"cite_description": ["Ви хочете процитувати цю статтю в ",", ми рекомендуємо вказати, коли стаття була витягнута (прочитана), наприклад, так:"],
"copy": "Копіювати",
"download": "Завантажити файл RIS",
"link_copied": "Посилання скопійовано в буфер обміну",
"citation_copied": "Цитату скопійовано в буфер обміну",
"citation": "«{lemma}». Із: <em>{dict}.</em> Мовна рада та Бергенський університет. &lt;<a href='{link}'>{link}</a>&gt; (взято {dd}.{mm}.{yyyy}).",
"headings": {
"etymology": "Походження",
"pronunciation": "Вимова",
"expressions": "Фіксовані вирази",
"definitions": "Значення та вживання",
"examples": "Приклад"
}
},
"error": {
"article": "У статті сталася помилка {no} i {dict}",
"404": {
"title": "404: Не знайдено",
"description": "Можливо, сторінку було видалено або переміщено, або ви використовували недійсне посилання."
},
"503": {
"title": "503: Недоступна послуга",
"description": "Сервер тимчасово перевантажений або перебуває на технічному обслуговуванні."
},
"server": {
"title": "Помилка сервера",
"description": "Щось пішло не так на стороні сервера (statuskode: {code})"},
"generic_code": {
"title": "Помилка",
"description": "Сталася неочікувана помилка при взаємодії з сервером (statuskode: {code})"},
"network": {
"title":"Помилка з’єднання",
"description": "Проблема з мережею завадила завантаженню сторінки. Спробуйте перезавантажити сторінку або перевірте, чи підключені ви до інтернету."},
"no_article": "Serveren finner ingen artikkel med ID {id}. Artikkelen kan ha blitt slettet eller flyttet, eller du kan ha brukt en ugyldig lenke.",
"generic": {
"title": "Помилка",
"description":"Щось пішло не так..."
}
}
}
\ No newline at end of file
......@@ -6,19 +6,28 @@ import DictionaryView from './components/DictionaryView.vue'
import VueRouter from 'vue-router'
import { VuePlausible } from 'vue-plausible'
import vuetify from './plugins/vuetify'
import VueSocialSharing from 'vue-social-sharing'
Vue.use(VueSocialSharing);
import Vuex from 'vuex'
import i18n from './i18n'
import VueMeta from 'vue-meta'
Vue.config.productionTip = false
Vue.use(Vuex)
Vue.use(VueRouter)
Vue.use(VueMeta, {
// optional pluginOptions
refreshOnceOnNavigation: true
})
Vue.use(VuePlausible, {
domain: 'beta.ordbok.uib.no'
domain: 'ordbokene.no'
})
Vue.$plausible.enableAutoPageviews()
const router = new VueRouter({
mode: 'history',
base: __dirname,
......@@ -26,30 +35,60 @@ const router = new VueRouter({
{
path: '/',
component: App,
beforeEnter(to, from , next) {
if (to.query.OPP) { // Legacy
let query = {q: to.query.OPP.toUpperCase() == to.query.OPP ? to.query.OPP.toLowerCase() : to.query.OPP, scope: "ei"}
if (to.query.ava && to.query.type == "fritekst") {
query["scope"] = "eif"
}
let lang = {"bokmaal": "/bm", "nynorsk": "/nn"}[to.query.ordbok] || "bm,nn"
if (to.query.bokmaal && !to.query.nynorsk) {
lang = "/bm"
}
if (to.query.nynorsk && !to.query.bokmaal) {
lang = "/nn"
}
next({path: lang+"/search", query})
}
else {
next()
}
},
children: [
{
path: 'om',
name: 'about',
component: About
},
{
path: "legacy/:query", // Legacy
redirect: to => {
console.log(to)
let q = to.params.query.replace(/[\[\]]/g, "")
if (q.toUpperCase() == q) {
q = q.toLowerCase()
}
return {path: "bm,nn/search", query: {q}}
}
},
{
path: '',
component: DictionaryView,
children: [
{
path: ':lang',
path: ':lang(bm|nn|bm,nn)',
children: [
{
name: 'word',
path: 'w/:word'
path: 'search',
name: 'search'
},
{
name: 'lookup',
path: ':id(\\d+)/:lemma?'
},
{
name: 'search',
path: 'search/:query'
name: "word",
path: ':q([^?]+)'
}
]
}
......@@ -60,8 +99,127 @@ const router = new VueRouter({
]
})
// All interaction with local storage is encapsulated in vuex
const store = new Vuex.Store({
strict: true,
state: {
showSearchToolbar: null,
showInflectionNo: null,
currentLocale: null,
collapseArticles: 'never',
defaultDict: null,
perPage: 20,
menuOpen: false,
noMouse: null,
searchRoute: null,
fulltextHighlight: false,
unavailable: null,
localeChosen: false,
inflectionExpanded: false,
inflectionTableContext: true
},
mutations: {
initStore(state) {
try {
state.showInflectionNo = localStorage.getItem('showInflectionNo') && localStorage.getItem('showInflectionNo') != 'false'
state.currentLocale = localStorage.getItem('currentLocale') || null
state.defaultDict = localStorage.getItem('defaultDict') || 'bm,nn'
state.perPage = localStorage.getItem('perPage') || 20
state.collapseArticles = localStorage.getItem('collapseArticles') || 'never'
state.localeChosen = localStorage.getItem('currentLocale') ? true : false
state.inflectionExpanded = localStorage.getItem('inflectionExpanded') && localStorage.getItem('inflectionExpanded') != 'false'
state.inflectionTableContext = !localStorage.getItem('inflectionTableContext') || localStorage.getItem('inflectionTableContext') == 'true' ? true : false
} catch(e) {
console.log("localStorage unavailable")
state.unavailable = true
}
if (!state.currentLocale) {
let locales = navigator.languages.map(l => l.split("-")[0])
if (locales.includes("nn")) state.currentLocale = "nno"
else if (locales.includes("nb")) state.currentLocale = "nob"
else {
state.currentLocale = Math.random() < 0.5 ? "nob" : "nno";
if (!state.unavailable) {
localStorage.setItem('currentLocale', state.currentLocale)
}
}
}
i18n.locale = state.currentLocale
state.noMouse = navigator.userAgentData? navigator.userAgentData.mobile : !window.matchMedia('(pointer: fine)').matches
},
setLocale(state, payload) {
state.currentLocale = payload.value
i18n.locale = payload.value
state.localeChosen = true
if (!state.unavailable) localStorage.setItem("currentLocale", payload.value);
},
setCollapse(state, value) {
if (!state.unavailable) localStorage.setItem("collapseArticles", value)
state.collapseArticles = value
},
setFulltextHighlight(state, value) {
state.fulltextHighlight = value
},
setPerPage(state, value) {
if (!state.unavailable) localStorage.setItem("perPage", value)
state.perPage = value
},
toggleInflectionNo(state) {
state.showInflectionNo = !state.showInflectionNo
if (!state.unavailable) localStorage.setItem('showInflectionNo', state.showInflectionNo);
},
disableHotkey(state) {
state.disableHotkey = !state.disableHotkey
if (!state.unavailable) localStorage.setItem('disableHotkey', state.disableHotkey);
},
toggleInflectionTableContext(state) {
state.inflectionTableContext = !state.inflectionTableContext
if (!state.unavailable) localStorage.setItem('inflectionTableContext', state.inflectionTableContext);
},
toggleInflectionExpanded(state) {
state.inflectionExpanded = !state.inflectionExpanded
if (!state.unavailable) localStorage.setItem('inflectionExpanded', state.inflectionExpanded);
},
toggleMenu(state) {
state.menuOpen = !state.menuOpen
},
setDefaultDict(state, value) {
if (!state.unavailable) localStorage.setItem("defaultDict", value)
state.defaultDict = value
},
resetStore() {
localStorage.removeItem("showSearchToolbar")
localStorage.removeItem("showInflectionNo")
localStorage.removeItem("currentLocale")
localStorage.removeItem("collapseArticles")
localStorage.removeItem("defaultDict")
localStorage.removeItem("perPage")
localStorage.removeItem("inflectionTableContext")
localStorage.removeItem("ukr_popup")
localStorage.removeItem("test_info")
localStorage.removeItem("beta_info")
localStorage.removeItem("app_info")
this.commit("initStore")
},
setSearchRoute(state, path) {
state.searchRoute = path
}
}
})
new Vue({
router,
vuetify,
store,
beforeCreate() {
this.$store.commit('initStore');
},
i18n,
render: h => h(Root )
}).$mount('#app')
import Vue from 'vue';
import 'material-design-icons-iconfont/dist/material-design-icons.css';
import Vuetify from 'vuetify/lib/framework';
import { library } from '@fortawesome/fontawesome-svg-core'
import { faShareAltSquare, faInfoCircle} from '@fortawesome/free-solid-svg-icons'
import { faFacebookSquare, faTwitterSquare} from '@fortawesome/free-brands-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(faFacebookSquare, faTwitterSquare, faShareAltSquare, faInfoCircle)
Vue.component('font-awesome-icon', FontAwesomeIcon);
Vue.use(Vuetify);
const FONTAWESOME_ICONS = {
facebook: {
component: FontAwesomeIcon,
props: {
icon: ["fab", "facebook-square"]
}
},
twitter: {
component: FontAwesomeIcon,
props: {
icon: ["fab", "twitter-square"]
}
},
share: {
component: FontAwesomeIcon,
props: {
icon: "share-alt-square"
}
},
info: {
component: FontAwesomeIcon,
props: {
icon: ["fa", "info-circle"]
}
}
}
export default new Vuetify({
breakpoint: {
......@@ -59,7 +27,8 @@ export default new Vuetify({
anchor: '#880E4F',
error: '#FDF4F5',
border: '#9E9E9E',
text: 'black'
button: '#f5f5f5',
text: '#000000'
}
}
},
......@@ -69,6 +38,5 @@ export default new Vuetify({
},
icons: {
iconfont: 'md',
values: FONTAWESOME_ICONS,
}
});
import json
import urllib.parse
# Load lemmas
with open("bm_lemma.json") as inn:
bm_list = json.load(inn)
with open("nn_lemma.json") as inn:
nn_list = json.load(inn)
# Merge bm and nn
words = {}
for row in bm_list:
words[row[0]] = words.get(row[0], set())
words[row[0]].add(("bm", row[1]))
for row in nn_list:
words[row[0]] = words.get(row[0], set())
words[row[0]].add(("nn", row[1]))
url_counter = 0
write_start = lambda out: out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">\n")
filenum = 0
out = open(f"src/sitemap/xml/sitemap_{filenum}.xml", "w")
write_start(out)
seen_articles = set()
for word, articles in words.items():
if url_counter > 20000:
out.write("</urlset>\n")
url_counter = 0
out.close()
filenum += 1
out = open(f"src/sitemap/xml/sitemap_{filenum}.xml", "w")
write_start(out)
for article in articles:
if article[1] not in seen_articles:
out.write("\t<url>\n")
out.write(f"\t\t<loc>https://ordbokene.no/{article[0]}/{article[1]}</loc>\n")
out.write(f"\t\t<xhtml:link rel=\"alternative\" href=\"https://ordbokene.no/{article[0]}/{article[1]}/{urllib.parse.quote(word)}\"/>\n")
out.write("\t</url>\n")
url_counter += 1
seen_articles.add(article[1])
# Omit articles
if len(articles) > 1:
out.write("\t<url>\n")
out.write(f"\t\t<loc>https://ordbokene.no//bm,nn/{urllib.parse.quote(word)}</loc>\n")
out.write("\t</url>\n")
url_counter += 1
out.write("</urlset>\n")
out.close()
with open("src/sitemap/xml/sitemap_index.xml", "w") as outfile:
outfile.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n")
outfile.write("<sitemap><loc>https://ordbokene.no/sitemap.xml</loc></sitemap>\n")
for num in range(filenum+1):
outfile.write(f"<sitemap><loc>https://ordbokene.no/sitemap_{num}.xml</loc></sitemap>\n")
outfile.write("</sitemapindex>")
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://ordbokene.no</loc>
<xhtml:link rel="alternative" href="https://ordbokene.no/bm,nn"/>
</url>
<url>
<loc>https://ordbokene.no/bm</loc>
</url>
<url>
<loc>https://ordbokene.no/nn</loc>
</url>
<url>
<loc>https://ordbokene.no/om</loc>
</url>
</urlset>
\ No newline at end of file