diff --git a/i18n/README.md b/i18n/README.md new file mode 100644 index 00000000..e3b54c6e --- /dev/null +++ b/i18n/README.md @@ -0,0 +1,52 @@ +# novelWriter Internationalisation + +The `i18n` folder contains the internationalisation files for novelWriter. +There are two types of files. The `nw_XX.qm` files are for localisation of the +main GUI, and the `project_XX.json` files are JSON files with translation maps +for the novelWriter projects. + +## GUI Localisation + +The `.qm` files are not generated by default. They can be built with: +```bash +python3 setup.py qtlrelease +``` + +To add a new translation file, please add a new entry in the `novelWriter.pro` +file under the `TRANSLATIONS` variable. Please use the underscore syntax for +file names as the importer expects this format. + +After adding the entry in the `.pro` file, run: +```bash +python3 setup.py qtlupdate +``` + +This will build a new `nw_XX.ts` file for the language you just added. The file +can then be edited with the Qt 5 Linguist application. Please select "English" +and "United Kingdom" as the source langauge when prompted. + +When you're done editing, you can build the `nw_XX.qm` file and test it in +novelWriter. + +**Note:** This requires that you have the tools Qt 5 Linguist and `pylupdate5` +installed on your system. + +## Project Localisation + +Projects can have a different language setting than the GUI itself. The files +with format `project_XX.json` are simple translation maps for text that goes +into the exported documents. + +The files are loaded based on the main GUI spell check language or the +project's spell check language. The project's spell check language takes +precedence over the GUI spell check language. + +Since these are used mainly as replacement lookups, they are maintained as +plain JSON files. The main usage is to generate chapter headers as number +words. + +There is no trick to using these files. Just copy the `project_en.json` file, +rename it, and edit it. Please use the underscore as separator if a language +needs to be localised to a specific country under a language. The importer will +for instance look for `en_GB` or `en_US` first, then use `en` if either is not +found. If there are no matching files, the project falls back to using English. diff --git a/i18n/nw_nb_NO.ts b/i18n/nw_nb_NO.ts new file mode 100644 index 00000000..7737c09c --- /dev/null +++ b/i18n/nw_nb_NO.ts @@ -0,0 +1,4762 @@ + + + + Common + + + just now + nå nettopp + + + + a minute ago + for et minutt siden + + + + an hour ago + for en time siden + + + + a day ago + for en dag siden + + + + a week ago + for en uke siden + + + + a month ago + for en måned siden + + + + a year ago + for et år siden + + + + {0} minutes ago + for {0} minutter siden + + + + {0} hours ago + for {0} timer siden + + + + {0} days ago + for {0} dager siden + + + + {0} weeks ago + for {0} uker siden + + + + {0} months ago + for {0} måneder siden + + + + {0} years ago + for {0} år siden + + + + in the future + i fremtiden + + + + Constant + + + None + Ingen + + + + Novel + Roman + + + + Plot + Plott + + + + Characters + Karakterer + + + + Locations + Lokasjoner + + + + Timeline + Tidslinje + + + + Objects + Objekter + + + + Entity + Enheter + + + + Custom + Annet + + + + Outtakes + Uttak + + + + Trash + Søppel + + + + Title Page + Tittelside + + + + Book + Bok + + + + Plain Page + Enkel side + + + + Partition + Partisjon + + + + Unnumbered + Unumrert + + + + Chapter + Kapittel + + + + Scene + Scene + + + + Note + Notat + + + + Tag + Knagg + + + + Point of View + Perspektiv + + + + Focus + Fokus + + + + Entities + Enheter + + + + Title + Tittel + + + + Level + Nivå + + + + Document + Dokument + + + + Line + Linje + + + + Chars + Tegn + + + + Words + Ord + + + + Pars + Avsnitt + + + + POV + Persp. + + + + Synopsis + Sammendrag + + + + Straight single quotation mark + Rett, enkelt sitattegn + + + + Straight double quotation mark + Rett, dobbelt sitattegn + + + + Left single quotation mark + Venstre, enkelt sitattegn + + + + Right single quotation mark + Høyre, enkelt sitattegn + + + + Single low-9 quotation mark + Enkelt, lavt-9 sitattegn + + + + Single high-reversed-9 quotation mark + Enkelt, høyt, reversert-9 sitattegn + + + + Left double quotation mark + Venstre, dobbelt sitattegn + + + + Right double quotation mark + Høyre, dobbelt sitattegn + + + + Double low-9 quotation mark + Dobbelt, lavt-9 sitattegn + + + + Double high-reversed-9 quotation mark + Dobbelt, høyt, reversert-9 sitattegn + + + + Double low-reversed-9 quotation mark + Dobbelt, lavt, reversert-9 sitattegn + + + + Single left-pointing angle quotation mark + Enkelt, venstre, angulært sitattegn + + + + Single right-pointing angle quotation mark + Enkelt, høyre, angulært sitattegn + + + + Left corner bracket + Venstre hjørnevinkel + + + + Right corner bracket + Høyre hjørnevinkel + + + + Left white corner bracket + Venstre, hvit hjørnevinkel + + + + Right white corner bracket + Høyre, hvit hjørnevinkel + + + + Double left-pointing angle quotation mark + Dobbelt, venstre, angulært sitattegn + + + + Double right-pointing angle quotation mark + Dobbelt, høyre, angulært sitattegn + + + + GuiAbout + + + About novelWriter + Om novelWriter + + + + About + Om + + + + Release + Utgivelse + + + + License + Lisens + + + + OK + OK + + + + Website: {0} + Nettside: {0} + + + + Credits + Krediteringer + + + + novelWriter is a markdown-like text editor designed for organising and writing novels. It is written in Python 3 with a Qt5 GUI, using PyQt5. + novelWriter er en markdown-liknende teksteditor laget for å kunne organisere og skrive romaner og noveller. Programmet er skrevet i Python 3 med et brukergrensesnitt i Qt 5 via PyQt5. + + + + novelWriter is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + novelWriter er gratis programvare: du kan videredistribuere det og/eller modifisere det under vilkårene i GNU General Public License som utgitt av Free Software Foundation, enten versjon 3 av Lisensen, eller (etter eget valg) enhver senere versjon. + + + + novelWriter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + novelWriter er distribuert i håp om at det vil være nyttig, men UTEN NOEN GARANTI; uten selv en underforstått garanti vedrørende SALGBARHET eller EGNETHET TIL ET BESTEMT FORMÅL. Se GNU General Public License for flere detaljer. + + + + See the License tab for the full license text, or visit the GNU website at {0} for more details. + Se lisens-fanen for fulltekst-versjonen av lisensen (på engelsk), eller besøk GNU sin nettside på {0} for mer informasjon. + + + + Theme: {0} + Tema: {0} + + + + Author: {0} + Ansvarlig: {0} + + + + Credit: {0} + Kreditert: {0} + + + + License: {0} + Lisens: {0} + + + + Icons: {0} + Ikoner: {0} + + + + Syntax: {0} + Syntaks: {0} + + + + GuiBuildNovel + + + Build Novel Project + Bygg prosjektet + + + + Title Formats for Novel Files + Tittelformater + + + + Formatting Codes: + Formatteringskoder: + + + + {0} for the title as set in the document + {0} for tittelen slik den er definert i dokumentet + + + + {0} for chapter number (1, 2, 3) + {0} for kapittelnummer (1, 2, 3) + + + + {0} for chapter number as a word (one, two) + {0} for kapittelnummer (én, to, tre) + + + + {0} for chapter number in upper case Roman + {0} for kapittelnummer i store romertall + + + + {0} for chapter number in lower case Roman + {0} for kapittelnummer i små romertall + + + + {0} for scene number within chapter + {0} for scenenummer innad i kapitler + + + + {0} for scene number within novel + {0} for scenenummer innad i boken + + + + Leave blank to skip this heading, or set to a static text, like for instance '{0}', to make a separator. The separator will be centred automatically and only appear between sections of the same type. + La feltet stå tomt for å hoppe over overskriften, eller sett til en statisk tekst, slik som for eksempel '{0}', for å lage en separator. Separatoren vil bli sentrert automatisk, og bare satt inn mellom scener av samme type. + + + + Title + Tittel + + + + Chapter + Kapittel + + + + Unnumbered + Unumrert + + + + Scene + Scene + + + + Section + Seksjon + + + + Font Options + Skriftvalg + + + + Font family + Skriftfamilie + + + + Font size + Skriftstørrelse + + + + Line height + Linjehøyde + + + + Justify text + Rette marger + + + + Disable styling + Slå av styling + + + + Include Options + Inkluderinger + + + + Include synopsis + Inkluder sammendrag + + + + Include comments + Inkluder kommentarer + + + + Include keywords + Inkluder kodeord + + + + Include body text + Inkluder tekst + + + + File Filter Options + Fil-filtre + + + + Include files with layouts other than 'Note'. + Inkluder filer som ikke er notater. + + + + Include files with layout 'Note'. + Inkluder filer som er notater. + + + + Ignore the 'Include when building project' setting and include all files in the output. + Ignorer 'ta med ved eksport'-instilling og ta med alle filer i resultatet. + + + + Include novel files + Inkluder romanfiler + + + + Include note files + Inkluder notatfiler + + + + Ignore export flag + Ignorer 'ta med'-flagg + + + + Export Options + Eksportvalg + + + + Replace tabs with spaces + Erstatt tab med mellomrom + + + + Replace Unicode in HTML + Erstatt Unicode med HTML + + + + Build Preview + Lag forhåndsvisning + + + + Print + Skriv ut + + + + Print Preview + Forhåndsvisning av utskrift + + + + Print to PDF + Skriv ut til PDF + + + + Save As + Lagre som + + + + Open Document (.odt) + + + + + Flat Open Document (.fodt) + + + + + novelWriter HTML (.htm) + + + + + novelWriter Markdown (.nwd) + + + + + Standard Markdown (.md) + + + + + GitHub Markdown (.md) + + + + + JSON + novelWriter HTML (.json) + + + + + JSON + novelWriters Markdown (.json) + + + + + Close + Lukk + + + + Failed to generate preview. The result is too big. + Kunne ikke generere forhåndsvisning. Resultatet er for stort til å vise. + + + + There were problems when building the project + Det har oppstått en feil under byggingen av prosjektet + + + + Open Document + + + + + Flat Open Document + + + + + Plain HTML + Enkel HTML + + + + novelWriter Markdown + + + + + Standard Markdown + + + + + GitHub Markdown + + + + + JSON + novelWriter HTML + + + + + JSON + novelWriter Markdown + + + + + PDF + + + + + Save Document As + Lagre dokumentet som + + + + Unknown format + Ukjent format + + + + {0} file successfully written to: + Lagring av {0} var vellykket, og filen ble skrevet til: + + + + Failed to write {0} file. {1} + Misslykkes i å skrive {0} til. {1} + + + + Styling Options + Styling + + + + GuiBuildNovelDocView + + + This area will show the content of the document to be exported or printed. Press the "Build Preview" button to generate content. + Dette området vil vise innholdet av dokumentet som skal eksporteres. Trykk på knappen merket med "Lag forhåndsvisning" for å oppdatere innholdet. + + + + Unknown + Ukjent + + + + <b>Build Time:</b> {0} + <b>Generert den:</b> {0} + + + + GuiDocEditFooter + + + Status + Status + + + + Line: {0} ({1}) + Linje: {0} ({1}) + + + + Words: {0} ({1}) + Ord: {0} ({1}) + + + + Document size is {0} bytes + Dokumentet er {0} byte + + + + GuiDocEditHeader + + + Edit document meta + Rediger dokumentinstillinger + + + + Search document + Søk i dokumentet + + + + Toggle Focus Mode + Slå av/på "Fokus-modus" + + + + Close the document + Lukk dokumentet + + + + GuiDocEditSearch + + + Search + Søk + + + + Replace + Erstatt + + + + Case Sensitive + Skill store/små bokstaver + + + + Match case + Søket skiller mellom store og små bokstaver + + + + Whole Words Only + Kun hele ord + + + + Match whole words + Søk kun etter hele ord + + + + RegEx Mode + RegEx-modus + + + + Search using regular expressions + Søk ved hjelp av "regular expressions" + + + + Loop Search + Søk rundt + + + + Loop the search when reaching the end + Begynn søket på nytt når enden er nådd + + + + Search Next File + Søk i neste file + + + + Continue searching in the next file + Fortsett søket i neste fil + + + + Preserve Case + Behold store/små bokstaver + + + + Preserve case on replace + Behold store og små bokstaver på samme sted ved erstatt + + + + Close Search + Lukk søk + + + + Close the search box [{0}] + Lukk søkeboksen [{0}] + + + + Show/hide the replace text box + Vis/skjul erstatt-boksen + + + + Find in current document + Søk i det åpne dokumentet + + + + Find and replace in current document + Søk og erstatt i det åpne dokumentet + + + + GuiDocEditor + + + The document you are trying to open is too big. The document size is {0} MB. The maximum size allowed is {1} MB. + Dokumentet du prøver å åpne er for stort. Dokumenter er på {0} MB. Den maksimale størrelsen tillat er {1} MB. + + + + The text you are trying to add is too big. The text size is {0} MB. The maximum size allowed is {1} MB. + Teksten du forsøker å legge til er for stor. Teksten er {0} MB. Den maksimale tillatte størrelsen er {1} MB. + + + + Spell check complete + Stavekontrollen er ferdig + + + + File Location + Filens plassering + + + + The currently open file is saved in: + Det åpne dokumentet er lagret på følgende sted: + + + + The document has grown too big and you cannot add more text to it. The maximum size of a single novelWriter document is {0} MB. + Dokumentet har blitt for stort og du kan ikke legge til mer tekst. Den maksimale tillatte størrelsen for et novelWriter-dokument er {0} MB. + + + + Follow Tag + Følg knagg + + + + Cut + Klipp + + + + Copy + Kopier + + + + Paste + Lim inn + + + + Select All + Velg hele teksten + + + + Select Word + Velg hele ordet + + + + Select Paragraph + Velg hele avsnittet + + + + Spelling Suggestion(s) + Forslag fra stavekontrollen + + + + No Suggestions + Ingen forslag + + + + Add Word to Dictionary + Legg til ord i ordbok + + + + Please selection some text before calling replace quotes. + Venligst velg en del av teksten før du velger å erstatte sitattegn. + + + + GuiDocMerge + + + Merge Documents + Slå sammen dokumenter + + + + Documents to Merge + Dokumenter som skal slås sammen + + + + Drag and drop items to change the order. + Dra og slipp dokumenter for å endre rekkefølge. + + + + Cancel + Avbryt + + + + No source documents found. Nothing to do. + Ingen kilde-dokument funnet. Det er ingenting å gjøre. + + + + No source document selected. Nothing to do. + Ingen kilde-dokument er valgt. Det er ingenting å gjøre. + + + + Could not parse source document. + Klarte ikke å lese kilde-dokumentet. + + + + Element selected in the project tree must be a folder. + Elementet som er valgt i prosjekttreet må være en mappe. + + + + OK + OK + + + + GuiDocSplit + + + Split Document + Del opp dokument + + + + Document Headers + Dokumentets overskrifter + + + + Select the maximum level to split into files. + Velg hvilket nivå av overskrifter å dele opp til. + + + + Split on Header Level 1 (Title) + Del på overskrifter på nivå 1 (titler) + + + + Split up to Header Level 2 (Chapter) + Del på overskrifter opp til nivå 2 (kapitler) + + + + Split up to Header Level 3 (Scene) + Del på overskrifter opp til nivå 3 (scener) + + + + Split up to Header Level 4 (Section) + Del på overskrifter opp til nivå 4 (seksjoner) + + + + Cancel + Avbryt + + + + No source document selected. Nothing to do. + Ingen kilde-dokument er valgt. Det er ingenting å gjøre. + + + + Could not parse source document. + Klarte ikke å lese kilde-dokumentet. + + + + No headers found. Nothing to do. + Ingen overskrifter ble funnet i dokumentet. Det er ikke noe å gjøre. + + + + Cannot add new folder for the document split. Maximum folder depth has been reached. Please move the file to another level in the project tree. + Kan ikke legge til ny mappe for å dele opp dokumentet. Dokumentet har allerede maksimal dybde i prosjekttreet. Flytt dokumentet til et annet nivå først. + + + + The document will be split into {0} file(s) in a new folder. The original document will remain intact. + Dokumentet vil nå bli delt opp i {0} nye filer i en ny mappe. Det originale dokumentet vil ikke bli endret eller fjernet. + + + + Continue with the splitting process? + Fortsette med oppdelingen? + + + + Element selected in the project tree must be a file. + Elementet som er valgt i prosjekttreet må være et dokument. + + + + OK + OK + + + + GuiDocViewFooter + + + Show/hide the references panel + Skjul eller vis referanse-panelet + + + + Activate to freeze the content of the references panel when changing document + Aktiver for å fryse innholdet i referanse-panelet ved bytte av vist dokument + + + + Show comments + Vis kommentarer + + + + Show synopsis comments + Vis sammendrag + + + + References + Referanser + + + + Sticky + Hold igjen + + + + Comments + Kommentarer + + + + Synopsis + Sammendrag + + + + GuiDocViewHeader + + + Go backward + Gå bakover + + + + Go forward + Gå fremover + + + + Reload the document + Last dokumentet på nytt + + + + Close the document + Lukk dokumentet + + + + GuiDocViewer + + + An error occurred while generating the preview. + Det har oppstått en feil under genereringen av visningen. + + + + Could not find the reference for tag '{0}'. It either doesn't exist, or the index is out of date. The index can be updated from the Tools menu, or by pressing {1}. + Kunne ikke finne referansen til knagg '{0}'. Enten finnes den ikke, eller så er prosjektets indeks ikke oppdatert. Indeksen kan oppdateres fra Verktøy-menyen eller ved å trykke på {1}. + + + + Copy + Kopier + + + + Select All + Velg hele teksten + + + + Select Word + Velg hele ordet + + + + Select Paragraph + Velg hele avsnittet + + + + GuiIcons + + + Could not load theme config file. + Kunne ikke laste temaets konfigurasjonsfil. + + + + GuiItemDetails + + + Label + Navn + + + + Status + Status + + + + Class + Klasse + + + + Layout + Format + + + + Characters + Tegn + + + + Words + Ord + + + + Paragraphs + Avsnitt + + + + GuiItemEditor + + + Item Settings + Enhetsinstillinger + + + + Include when building project + Ta med ved eksport + + + + Cancel + Avbryt + + + + Label + Navn + + + + Status + Status + + + + Layout + Format + + + + OK + OK + + + + GuiMain + + + Project + Prosjekt + + + + Novel + Innhold + + + + Project Details + Prosjektdetaljer + + + + Writing Statistics + Statistikk + + + + Project Settings + Prosjektinnstillinger + + + + Editor + Editor + + + + Outline + Disposisjon + + + + Cannot create new project when another project is open. + Kan ikke lage et nytt prosjekt mens et annet prosjekt er åpent. + + + + A project already exists in that location. Please choose another folder. + Et prosjekt finnes allerede i den mappen. Vennligst velg et annet sted å lagre prosjektet. + + + + New project created ... + Et nytt prosjekt har blitt opprettet ... + + + + Close Project + Lukk prosjektet + + + + Close the current project? + Ønsker du å lukke dette prosjektet? + + + + Changes are saved automatically. + Endringer lagres automatisk. + + + + Backup Project + Sikkerhetskopiering + + + + Backup the current project? + Ønsker du å ta sikkerhetskopi av dette prosjektet? + + + + The project was locked by the computer '{0}' ({1} {2}), last active on {3}. + Prosjektet er låst av datamaskinen '{0}' ({1} {2}), siste registrerte aktivitet var {3}. + + + + Project Locked + Prosjektlås + + + + The project is already open by another instance of novelWriter, and is therefore locked. Override lock and continue anyway? + Prosjektet er allerede åpent av en annen instans av novelWriter, og er derfor låst. Vil du overstyre denne låsen og fortsette likevel? + + + + Note: If the program or the computer previously crashed, the lock can safely be overridden. If, however, another instance of novelWriter has the project open, overriding the lock may corrupt the project, and is not recommended. + Merk at hvis programmet har krasjet og har lagt igjen låsen, kan man trygt overstyre denne. Men hvis en annen instans av novelWriter har prosjektet åpent, kan det å overstyre låsen føre til tap av data, og dette er ikke anbefalt. + + + + The project index is outdated or broken. Rebuilding index. + Prosjektets indeks er utdatert eller skadet. Bygger indeksen på nytt. + + + + Text files ({0}) + Tekstfiler ({0}) + + + + Markdown files ({0}) + Markdown-filer ({0}) + + + + novelWriter files ({0}) + novelWriter-filer ({0}) + + + + All files ({0}) + Alle filer ({0}) + + + + Import File + Importer fil + + + + Could not read file. The file must be an existing text file. + Kunne ikke lese filen. Filen må eksistere fra før av. + + + + Please open a document to import the text file into. + Vennligst åpne et dokument hvor teksten i filen kan importeres. + + + + Import Document + Importer dokument + + + + Importing the file will overwrite the current content of the document. Do you want to proceed? + Å importere filen vil overskrive all eksisterende tekst i dokumentet. Ønsker du å fortsette? + + + + Indexing: '{0}' + Indekserer: '{0}' + + + + Unknown item + Ukjent enhet + + + + Indexing completed in {0} ms + Indekseringen tok {0} ms + + + + The project index has been successfully rebuilt. + Prosjektets indeks har blitt bygget på nytt. + + + + Save novelWriter Project + Lagre novelWriter-prosjektet + + + + Information + Informasjon + + + + Warning + Advarsel + + + + Error + Feil + + + + This is a bug! + Dette er en systemfeil! + + + + Internal Error + Intern feil + + + + Exit + Avslutt + + + + Do you want to exit novelWriter? + Ønsker du å avslutte novelWriter? + + + + novelWriter is ready ... + novelWriter er klar ... + + + + GuiMainMenu + + + &Project + &Prosjekt + + + + New Project + Nytt prosjekt + + + + Create new project + Opprett et nytt prosjekt + + + + Open Project + Åpne prosjekt + + + + Open project + Åpne et prosjekt + + + + Save Project + Lagre prosjektet + + + + Save project + Lagre prosjektet + + + + Close Project + Lukk prosjektet + + + + Close project + Lukk prosjektet + + + + Project Settings + Prosjektinnstillinger + + + + Project settings + Endre prosjektinnstillinger + + + + Project Details + Prosjektdetaljer + + + + Project details + Vis prosjektdetaljer + + + + Create Root Folder + Lag ny hovedmappe + + + + Novel Root + Mappe for "Roman" + + + + Plot Root + Mappe for "Plott" + + + + Character Root + Mappe for "Karakterer" + + + + Location Root + Mappe for "Lokasjoner" + + + + Timeline Root + Mappe for "Tidslinjer" + + + + Object Root + Mappe for "Objekter" + + + + Entity Root + Mappe for "Enheter" + + + + Custom Root + Mappe for "Annet" + + + + Outtakes Root + Mappe for "Uttak" + + + + Create Folder + Lag ny mappe + + + + Create folder + Lag en ny mappe + + + + Edit Item + Endre enhet + + + + Change project item settings + Endre innstillinger for enhet + + + + Delete Item + Slett enhet + + + + Delete selected project item + Slett den valgte enheten i prosjektet + + + + Move Item Up + Flytt enhet opp + + + + Move project item up + Flytt enheten oppover i prosjektet + + + + Move Item Down + Flytt enhet ned + + + + Move project item down + Flytt enheten nedover i prosjektet + + + + Undo Last Move + Angre siste flytting + + + + Undo last item move + Angre siste flytting i prosjektet + + + + Empty Trash + Tøm søppel + + + + Permanently delete all files in the Trash folder + Slett alle filene i søppelbøtta permanent + + + + Exit + Avslutt + + + + Exit novelWriter + Avslutt novelWriter + + + + &Document + &Dokument + + + + New Document + Nytt dokument + + + + Create new document + Opprett et nytt dokument + + + + Open Document + Åpne dokument + + + + Open selected document + Åpne valgte dokument + + + + Save Document + Lagre dokumentet + + + + Save current document + Lagre det åpne dokumentet + + + + Close Document + Lukk dokumentet + + + + Close current document + Lukk det åpne dokumentet + + + + View Document + Vis dokument + + + + View document as HTML + Vis dokument som HTML + + + + Close Document View + Lukk dokumentvisning + + + + Close document view pane + Lukk visningsvindu for dokumenter + + + + Show File Details + Vis filinformasjon + + + + Shows a message box with the document location in the project folder + Viser hvor dokumentets fil er lagret i prosjektets mappe + + + + Import from File + Importer fra fil + + + + Import document from a text or markdown file + Importer et dokument fra en ekstern fil + + + + Merge Folder to Document + Slå sammen mappe + + + + Merge a folder of documents to a single document + Slå sammen alle dokumenter i mappen til ett dokument + + + + Split Document to Folder + Del opp dokument + + + + Split a document into a folder of multiple documents + Splitt et dokument opp i flere dokumenter i en ny mappe + + + + &Edit + &Rediger + + + + Undo + Angre + + + + Undo last change + Angre siste endring + + + + Redo + Gjenopprett + + + + Redo last change + Gjenopprett siste endring + + + + Cut + Klipp + + + + Cut selected text + Klipp ut valgt tekst + + + + Copy + Kopier + + + + Copy selected text + Kopier valgt tekst + + + + Paste + Lim inn + + + + Paste text from clipboard + Lim inn tekst fra utklippstavle + + + + Select All + Velg hele teksten + + + + Select all text in document + Velg all tekst i dokumentet + + + + Select Paragraph + Velg hele avsnittet + + + + Select all text in paragraph + Velg all tekst i avsnittet + + + + &View + &Vis + + + + Focus Project Tree + Gå til prosjekttre + + + + Move focus to project tree + Flytt fokus til prosjekttre + + + + Focus Document Editor + Gå til editor + + + + Move focus to left document pane + Flytt fokus til teksteditor + + + + Focus Document Viewer + Gå til visningsvindu + + + + Move focus to right document pane + Flytt fokus til visningsvindu + + + + Focus Outline + Gå til disposisjon + + + + Move focus to outline + Flytt fokus til disposisjon + + + + Go Backward + Gå bakover + + + + Move backward in the view history of the right pane + Gå bakover i visningshistorien i visningsvinduet + + + + Go Forward + Gå fremover + + + + Move forward in the view history of the right pane + Gå fremover i visningshistorien i visningsvinduet + + + + Focus Mode + Focus-modus + + + + Toggles a distraction free mode, only showing text editor + Slå av eller på "Fokus-modus" hvor kun teksteditoren vises i vinduet + + + + Full Screen Mode + Fullskjerm-modus + + + + Maximises the main window + Bruk hele skjermen + + + + &Insert + Sett &inn + + + + Dashes + Bindestreker + + + + Short Dash + Kort bindestrek + + + + Insert short dash (en dash) + Sett inn en kort bindestrek (en dash) + + + + Long Dash + Lang bindestrek + + + + Insert long dash (em dash) + Sett inn en lang bindestrek (em dash) + + + + Horizontal Bar + Horisontal strek + + + + Insert a horizontal bar (quotation dash) + Sett inn en horisontal strek (sitatstrek) + + + + Figure Dash + Tallstrek + + + + Insert figure dash (same width as a number character) + Sett inn en tallstrek (samme bredde som et tall) + + + + Quote Marks + Sitattegn + + + + Left Single Quote + Venstre, enkelt sitattegn + + + + Insert left single quote + Sett inn venstre, enkelt sitattegn + + + + Right Single Quote + Høyre, enkelt sitattegn + + + + Insert right single quote + Sett inn høyre, enkelt sitattegn + + + + Left Double Quote + Venstre, dobbelt sitattegn + + + + Insert left double quote + Sett inn venstre, dobbelt sitattegn + + + + Right Double Quote + Høyre, dobbelt sitattegn + + + + Insert right double quote + Sett inn høyre, dobbelt sitattegn + + + + Alternative Apostrophe + Alternativ apostrof + + + + Insert modifier letter single apostrophe + Sett inn alternativt apostroftegn + + + + General Punctuation + Generell tegnsetting + + + + Ellipsis + Ellipsis + + + + Insert ellipsis + Sett inn ellipsis + + + + Prime + Primtegn + + + + Insert a prime symbol + Sett inn et primtegn + + + + Double Prime + Dobbelt primtegn + + + + Insert a double prime symbol + Sett inn et dobbelt primtegn + + + + Breaks and Spaces + Linjeskift og mellomrom + + + + Hard Line Break + Hardt linjeskift + + + + Insert a hard line break + Sett inn et hardt linjeskift + + + + Non-Breaking Space + Hardt mellomrom + + + + Insert a non-breaking space + Sett inn et hardt mellomrom + + + + Thin Space + Kort mellomrom + + + + Insert a thin space + Sett inn et kort mellomrom + + + + Thin Non-Breaking Space + Hardt, kort mellomrom + + + + Insert a thin non-breaking space + Sett inn et hardt, kort mellomrom + + + + Other Symbols + Andre symboler + + + + List Bullet + Kulepunkt + + + + Insert a list bullet + Sett inn et kulepunkt + + + + Hyphen Bullet + Bindestrekpunkt + + + + Insert a hyphen bullet (alternative bullet) + Sett inn et bindestrekpunkt + + + + Flower Mark + Blomsterpunkt + + + + Insert a flower mark (alternative bullet) + Sett inn et blomsterpunkt + + + + Per Mille + Promille + + + + Insert a per mille symbol + Sett inn et promilletegn + + + + Degree Symbol + Gradertegn + + + + Insert a degree symbol + Sett inn et gradertegn + + + + Minus Sign + Minustegn + + + + Insert a minus sign (not a hypen or dash) + Sett inn et minustegn (ikke det samme som bindestrek) + + + + Times Sign + Gangetegn + + + + Insert a times sign (multiplication cross) + Sett inn et gangetegn (kryss) + + + + Division Sign + Deletegn + + + + Insert a division sign + Sett inn et deletegn + + + + Tags and References + Knagger og referanser + + + + &Search + &Søk + + + + Find + Søk + + + + Find text in document + Søk etter tekst i dokumentet + + + + Replace + Erstatt + + + + Replace text in document + Erstatt tekst i dokumentet + + + + Find Next + Finn neste + + + + Find next occurrence of text in document + Finn neste tilfelle av søketeksten i dokumentet + + + + Find Previous + Finn forrige + + + + Find previous occurrence of text in document + Finn forrige tilfelle av søketeksten i dokumentet + + + + Replace Next + Erstatt neste + + + + Find and replace next occurrence of text in document + Erstatt neste tilfelle av søketeksten i dokumentet + + + + &Format + &Formattering + + + + Emphasis + Kursiv + + + + Add emphasis to selected text (italic) + Gjør valgt tekst kursiv + + + + Strong Emphasis + Uthev + + + + Add strong emphasis to selected text (bold) + Gjør valgt tekst uthevet + + + + Strikethrough + Gjennomstrek + + + + Add strikethrough to selected text + Sett en strek gjennom valgt tekst + + + + Wrap Double Quotes + Sett i doble sitattegn + + + + Wrap selected text in double quotes + Sett doble sitattegn rundt den valgte teksten + + + + Wrap Single Quotes + Sett i enkle sitattegn + + + + Wrap selected text in single quotes + Sett enkle sitattegn rundt den valgte teksten + + + + Header 1 + Overskrift nivå 1 + + + + Change the block format to Header 1 + Endre linjen til overskrift med nivå 1 + + + + Header 2 + Overskrift nivå 2 + + + + Change the block format to Header 2 + Endre linjen til overskrift med nivå 2 + + + + Header 3 + Overskrift nivå 3 + + + + Change the block format to Header 3 + Endre linjen til overskrift med nivå 3 + + + + Header 4 + Overskrift nivå 4 + + + + Change the block format to Header 4 + Endre linjen til overskrift med nivå 4 + + + + Comment + Kommentar + + + + Change the block format to comment + Endre linjen til en kommentar + + + + Remove Block Format + Fjern formattering + + + + Strips block format + Fjerner formatering fra gjeldende linje + + + + Replace Single Quotes + Erstatt enkle sitattegn + + + + Replace all straight single quotes in selected text + Erstatt enkle, rette sitattegn med valgte enkle sitattegn + + + + Replace Double Quotes + Erstatt doble sitattegn + + + + Replace all straight double quotes in selected text + Erstatt doble, rette sitattegn med valgte doble sitattegn + + + + &Tools + &Verktøy + + + + Check Spelling + Stavekontroll + + + + Toggle check spelling + Slå av og på stavekontroll + + + + Re-Run Spell Check + Kjør stavekontroll + + + + Run the spell checker on current document + Kjør stavekontroll for det åpne dokumentet + + + + Project Word List + Prosjektets ordliste + + + + Edit the project's word list + Vis eller endre på prosjektets ordliste + + + + Rebuild Index + Bygg indeks + + + + Rebuild the tag indices and word counts + Bygg hele prosjektets indeks på nytt + + + + Rebuild Outline + Bygg disposisjon + + + + Rebuild the novel outline tree + Bygg prosjektets disposisjon på nytt + + + + Auto-Update Outline + Auto-oppdater disposisjon + + + + Update project outline when a novel file is changed + Oppdater disposisjonen automatisk når innholdet endrer seg + + + + Backup Project Folder + Lag sikkerhetskopi + + + + Backup Project + Lag sikkerhetskopi av prosjektets mappe + + + + Build Novel Project + Bygg prosjektet + + + + Launch the Build novel project tool + Åpne verktøy for å bygge prosjektet + + + + Writing Statistics + Statistikk + + + + Show the writing statistics dialog + Vis prosjektets statistikk i et vindu + + + + Preferences + Innstillinger + + + + &Help + &Hjelp + + + + About novelWriter + Om novelWriter + + + + About Qt5 + Om Qt5 + + + + Documentation (Local) + Dokumentasjon (local) + + + + View local documentation with Qt Assistant + Vis dokumentasjonen ved hjelp av Qt Assistant + + + + Documentation (Online) + Dokumentasjon (online) + + + + View online documentation at {0} + Vis dokumentasjonen på {0} + + + + Report an Issue (GitHub) + Rapporter en feil (GitHub) + + + + Report a bug or issue on GitHub at {0} + Rapporter en feil ved programmet på GitHub på {0} + + + + Ask a Question (GitHub) + Still et spørsmål (GitHub) + + + + Ask a question on GitHub at {0} + Still et spørsmål på GitHub på {0} + + + + Latest Release (GitHub) + Siste utgivelse (GitHub) + + + + Open the Releases page on GitHub at {0} + Åpner Rekeases-siden på GitHub på {0} + + + + The novelWriter Website + novelWriters nettside + + + + Open the novelWriter website at {0} + Åpne novelWriters nettside på {0} + + + + GuiMainStatus + + + None + Ingen + + + + Editor + Editor + + + + Project + Prosjekt + + + + Session Time + Tid brukt i gjeldende sesjon + + + + Words: {0} ({1}) + Ord: {0} ({1}) + + + + Project word count (session change) + Antall ord i prosjektet (endring i denne sesjonen) + + + + GuiNovelTree + + + Title + Tittel + + + + Words + Ord + + + + POV + Persp. + + + + Section title + Seksjonens tittel + + + + Word count + Antall ord + + + + Point-of-view character + Synsvinkel-karakter + + + + GuiOutlineDetails + + + Title + Tittel + + + + Chapter + Kapittel + + + + Scene + Scene + + + + Section + Seksjon + + + + Document + Dokument + + + + Status + Status + + + + Characters + Tegn + + + + Words + Ord + + + + Paragraphs + Avsnitt + + + + Synopsis + Sammendrag + + + + Title Details + Oversikt + + + + Reference Tags + Referanser + + + + GuiOutlineHeaderMenu + + + Select Columns + Velg kolonner + + + + GuiPreferences + + + Preferences + Innstillinger + + + + General + Generelt + + + + Projects + Prosjekt + + + + Documents + Dokument + + + + Editor + Editor + + + + Highlighting + Fremheving + + + + Automation + Automasjon + + + + Cancel + Avbryt + + + + Some changes will not be applied until novelWriter has been restarted. + Noen endringer vil ikke tas i bruk før neste gang novelWriter startes. + + + + OK + OK + + + + GuiPreferencesAutomation + + + Automatic Features + Automatiske funksjoner + + + + Auto-select word under cursor + Auto-velg ord under markør + + + + Apply formatting to word under cursor if no selection is made. + Hvis ingen tekst er valgt, formatter ordet hvor markøren står. + + + + Auto-replace text as you type + Erstatt mens du skriver + + + + Allow the editor to replace symbols as you type. + La editoren erstatte symboler mens du skriver. + + + + Replace as You Type + Erstatt mens du skriver + + + + Auto-replace single quotes + Erstatt enkle sitattegn + + + + Try to guess which is an opening or a closing single quote. + Forsøker å gjette hva som er venstre og høyre tegn. + + + + Auto-replace double quotes + Erstatt doble sitattegn + + + + Try to guess which is an opening or a closing double quote. + Forsøker å gjette hva som er venstre og høyre tegn. + + + + Auto-replace dashes + Erstatt bindestreker + + + + Double and triple hyphens become short and long dashes. + To og tre bindestreker erstattes med kort og lang bindestrek. + + + + Auto-replace dots + Erstatt tre punktum + + + + Three consecutive dots become ellipsis. + Tre punktum på rad erstattes med ellipsis. + + + + Quotation Style + Sitattegn + + + + Single quote open style + Enkelt sitat, venstre side + + + + The symbol to use for a leading single quote. + Symbol for enkelt sitattegn før et sitat. + + + + Single quote close style + Enkelt sitat, høyre side + + + + The symbol to use for a trailing single quote. + Symbol for enkelt sitattegn etter et sitat. + + + + Double quote open style + Dobbelt sitat, venstre side + + + + The symbol to use for a leading double quote. + Symbol for dobbelt sitattegn før et sitat. + + + + Double quote close style + Dobbelt sitat, høyre side + + + + The symbol to use for a trailing double quote. + Symbol for dobbelt sitattegn etter et sitat. + + + + GuiPreferencesDocuments + + + Text Style + Tekststil + + + + Font family + Skriftfamilie + + + + Font for the document editor and viewer. + Skrifttype til bruk for editor og visning. + + + + Font size + Skriftstørrelse + + + + Font size for the document editor and viewer. + Skriftstørrelse til bruk for editor og visning. + + + + pt + + + + + Text Flow + Tekstflyt + + + + Maximum text width in "Normal Mode" + Maks tekstbredde i "Normal-modues" + + + + Horizontal margins are scaled automatically. + Horisontale marger skalerer da automatisk. + + + + px + + + + + Maximum text width in "Focus Mode" + Maks tekstbredde i "Fokus-modues" + + + + Disable maximum text width in "Normal Mode" + Slå av maks tekstbredde i "Normal-modus" + + + + Text width is defined by the margins only. + Tekstbredden er kun definert av margene. + + + + Hide document footer in "Focus Mode" + Gjem dokumentets bunnlinje i "Fokus-modus" + + + + Hide the information bar at the bottom of the document. + Gjemmer informasjonslinja i bunnen av dokumentet. + + + + Justify the text margins in editor and viewer + Bruk justerte marger i editor og visning + + + + Lay out text with straight edges in the editor and viewer. + Justerte marger gir rette linjeender i avsnitt. + + + + Text margin + Marger + + + + If maximum width is set, this becomes the minimum margin. + Hvis tekstbredde er satt, så blir dette istedet minste marger. + + + + Tab width + Tabulatorens bredde + + + + The width of a tab key press in the editor and viewer. + Hvor langt tabulatoren hopper i editor og visning. + + + + GuiPreferencesEditor + + + Spell Checking + Stavekontroll + + + + Internal + Intern + + + + Spell check provider + Verktøy for stavekontroll + + + + Note that the internal spell check tool is quite slow. + Merk at den interne stavekontrollen er ganske treg. + + + + Spell check language + Språk for stavekontroll + + + + Available languages are determined by your system. + Tilgjengelige språk hentes fra operativystemet ditt. + + + + Big document limit + Grense for store dokumenter + + + + Full spell checking is disabled above this limit. + Automatisk stavekontroll slås av over grensen. + + + + kB + + + + + Word Count + Telling av ord + + + + Word count interval + Telle-intervall + + + + How often the word count is updated. + Hvor ofte antall ord blir oppdatert. + + + + seconds + sekunder + + + + Writing Guides + Hjelpesymboler + + + + Show tabs and spaces + Synlige tabulatorer og mellomrom + + + + Add symbols to indicate tabs and spaces in the editor. + Viser symboler for å indikere disse i editoren. + + + + Show line endings + Synlige linjeender + + + + Add a symbol to indicate line endings in the editor. + Viser symbol for å indikere dette i editoren. + + + + Scroll Behaviour + Rullefelt + + + + Scroll past end of the document + Tillat å rulle forbi slutten av dokumentet + + + + Also improves trypewriter scrolling for short documents. + Forbedrer funksjonen til skrivemaskin-rulling. + + + + Typewriter style scrolling when you type + Skrivemaskin-liknende rulling mens du skriver + + + + Try to keep the cursor at a fixed vertical position. + Prøver å holde markøren på samme sted vertikalt. + + + + Minimum position for Typewriter scrolling + Minste avstand for skrivemaskin-rulling + + + + Percentage of the editor height from the top. + I prosent fra toppen av editor-vinduet. + + + + GuiPreferencesGeneral + + + Look and Feel + Utseende + + + + Main GUI theme + Fargetema + + + + Changing this requires restarting novelWriter. + Endring av dette krever omstart av novelWriter. + + + + Main icon theme + Ikon-tema + + + + Prefer icons for dark backgrounds + Foretrekk ikoner for mørk bakgrunn + + + + May improve the look of icons on dark themes. + Kan forbedre utseende på mørke temaer. + + + + Font family + Skriftfamilie + + + + Font size + Skriftstørrelse + + + + pt + + + + + GUI Settings + Brukergrensesnitt + + + + Show full path in document header + Vis full prosjektbane i dokumenthoder + + + + Add the parent folder names to the header. + Legger til mappene foran dokumentets navn. + + + + Hide vertical scroll bars in main windows + Skjul vertikale rullefelt i hovedvinduer + + + + Scrolling available with mouse wheel and keys only. + Rulling kan bare gjøres med mus og tastatur. + + + + Hide horizontal scroll bars in main windows + Skjul horisontale rullefelt i hovedvinduer + + + + Main GUI language + Programspråk + + + + GuiPreferencesProjects + + + Automatic Save + Automatisk lagring + + + + Save document interval + Interval for lagring av dokument + + + + How often the open document is automatically saved. + Hvor ofte det åpne dokumentet lagres automatisk. + + + + seconds + sekunder + + + + Save project interval + Interval for lagring av prosjekt + + + + How often the open project is automatically saved. + Hvor ofte det åpne prosjektet lagres automatisk. + + + + Project Backup + Sikkerhetskopi + + + + Browse + Bla + + + + Backup storage location + Filbane for sikkerhetskopi + + + + Path: {0} + Filbane: {0} + + + + Run backup when the project is closed + Lag sikkerhetskopi når prosjektet lukkes + + + + Can be overridden for individual projects in project settings. + Kan overstyres fra individuelle prosjektinnstillinger. + + + + Ask before running backup + Spør før sikkerhetskopi tas + + + + If off, backups will run in the background. + Hvis avslått, tas sikkerhetskopi automatisk. + + + + Session Timer + Sesjons-klokke + + + + Pause the session timer when not writing + Sett klokka på pause når du er inaktiv + + + + Also pauses when the application window does not have focus. + Pauses også når du ikke jobber i applikasjonens vindu. + + + + Editor inactive time before pausing timer + Tid uten skriving før klokka settes på pause + + + + User activity includes typing and changing the content. + Dette måler kun endringer i teksteditoren. + + + + minutes + minutter + + + + Backup Directory + Mappe for sikkerhetskopi + + + + GuiPreferencesSyntax + + + Highlighting Theme + Syntaksfremheving + + + + Highlighting theme + Fremhevingstema + + + + Colour theme to apply to the editor and viewer. + Fargetema for editor og visning. + + + + Quotes & Dialogue + Sitattegn & dialog + + + + Highlight text wrapped in quotes + Fremhev tekst mellom sitattegn + + + + Applies to single, double and straight quotes. + Gjelder enkle, doble og rette sitattegn. + + + + Allow open-ended single quotes + Tillat enkle sitattegn som ikke lukkes + + + + Highlight single-quoted line with no closing quote. + Fremhev sitater som ikke er lukket i samme avsnitt. + + + + Allow open-ended double quotes + Tillat doble sitattegn som ikke lukkes + + + + Highlight double-quoted line with no closing quote. + Fremhev sitater som ikke er lukket i samme avsnitt. + + + + Text Emphasis + Fremheving av tekst + + + + Add highlight colour to emphasised text + Fremhev formattert tekst + + + + Applies to emphasis (italic) and strong (bold). + Gjelder kursiv og fet tekst. + + + + GuiProjectDetails + + + Project Details + Prosjektdetaljer + + + + Overview + Oversikt + + + + Contents + Innhold + + + + Close + Lukk + + + + GuiProjectDetailsContents + + + Title + Tittel + + + + Words + Ord + + + + Pages + Sider + + + + Page + Side + + + + Progress + Fremdrift + + + + Typical word count for a 5 by 8 inch book page with 11 pt font is 350. + Typisk antall ord for en 5 x 8 tommers bokside med 11 pt tekst er 350. + + + + Start counting page numbers from this page. + Begynn sidetall fra denne siden. + + + + Assume a new chapter or partition always start on an odd numbered page. + Beregn at nye kapitler og partisjoner alltid starter på en høyreside. + + + + Words per page + Ord per side + + + + Count pages from + Tell sider fra + + + + Clear double pages + Tøm doble sider + + + + Table of Contents + Innholdsfortegnelse + + + + END + SLUTT + + + + GuiProjectDetailsMain + + + Working Title: {0} + Arbeidstittel: {0} + + + + By {0} + Av {0} + + + + Words + Ord + + + + Chapters + Kapitler + + + + Scenes + Scener + + + + Revisions + Revisjoner + + + + Editing Time + Redigeringstid + + + + Path + Filbane + + + + GuiProjectEditMain + + + Project Settings + Prosjektinnstillinger + + + + Working title + Arbeidstittel + + + + Should be set only once. + Bør bare settes én gang. + + + + Novel title + Bokens tittel + + + + Change whenever you want! + Kan endres når som helst! + + + + Author(s) + Forfatter(e) + + + + One name per line. + Ett navn per linje. + + + + Default + Ingen valg + + + + Spell check language + Språk for stavekontroll + + + + Overrides main preferences. + Overstyrer valg i innstillinger. + + + + No backup on close + Slå av sikkerhetskopi + + + + GuiProjectEditReplace + + + Keyword + Kodeord + + + + Replace With + Erstatt med + + + + Save entry + Lagre tekst + + + + Add new entry + Legg til ny + + + + Delete selected entry + Slett valgte element + + + + Text Replace List for Preview and Export + Erstatningsliste for forhåndsvisning og eksport + + + + GuiProjectEditStatus + + + New + Ny + + + + Delete + Slett + + + + Save + Lagre + + + + Colour + Farge + + + + Name + Navn + + + + Novel File Status Levels + Statusnivåer i roman-filer + + + + Note File Importance Levels + Viktighetsnivåer i notatfiler + + + + Select Colour + Velg farge + + + + New Item + Legg til + + + + Cannot delete status item that is in use. + Kan ikke slette statusnivåer som er i bruk. + + + + {0} [{1}] + + + + + GuiProjectLoad + + + Open Project + Åpne prosjekt + + + + Working Title + Arbeidstittel + + + + Words + Ord + + + + Last Opened + Sist åpnet + + + + Recently Opened Projects + Tidligere åpnede prosjekter + + + + Path + Filbane + + + + Open + Åpne + + + + Cancel + Avbryt + + + + New + Ny + + + + Remove + Fjern + + + + novelWriter Project File ({0}) + novelWriter-prosjektfil ({0}) + + + + All files ({0}) + Alle filer ({0}) + + + + Open novelWriter Project + Åpne novelWriter-prosjekt + + + + Remove Entry + Fjern linje + + + + Remove '{0}' from the recent projects list? The project files will not be deleted. + Vil du fjerne '{0}' fra listen over tidligere åpnede prosjekter? Selve prosjektfilene blir ikke slettet. + + + + GuiProjectSettings + + + Project Settings + Prosjektinnstillinger + + + + Settings + Innstillinger + + + + Status + Status + + + + Importance + Viktighet + + + + Auto-Replace + Autoerstatt + + + + Cancel + Avbryt + + + + OK + OK + + + + GuiProjectTree + + + Label + Navn + + + + Words + Ord + + + + Inc + Inkl + + + + Flags + Flagg + + + + Item label + Enhetens navn + + + + Word count + Antall ord + + + + Include in build + Ta med ved eksport + + + + Status, class, and layout flags + Flagg for status, klasse, og format + + + + Please select a valid location in the tree to add the document. + Du må velge et gyldig sted i prosjekttreet for å legge til dokumentet. + + + + Please select a valid location in the tree to add the folder. + Du må velge et gyldig sted i prosjekttreet for å legge til mappen. + + + + Did not find anywhere to add the file or folder! + Fant ikke noe sted å legge til filen eller mappen! + + + + New File + Ny fil + + + + Cannot add new folder to this item. + Du kan ikke legge til ny mappe her. + + + + Maximum folder depth has been reached. + Maksimal dybde i prosjekttreet er nådd. + + + + New Folder + Ny mappe + + + + There is currently no Trash folder in this project. + Det er for øyeblikket ingen søppel-mappe i dette prosjektet. + + + + The Trash folder is already empty. + Søppel-mappen er allerede tom. + + + + Empty Trash + Tøm søppel + + + + Permanently delete {0} file(s) from Trash? + Vil du slette {0} filer i søppel-mappen for godt? + + + + Delete File + Slett fil + + + + Permanently delete file '{0}'? + Slette filen '{0}' for godt? + + + + Move file '{0}' to Trash? + Vil du flytte filen '{0}' til søpla? + + + + Cannot delete folder. It is not empty. Recursive deletion is not supported. Please delete the content first. + Kan ikke slette mappen da den ikke er tom. Rekursiv sletting er ikke støttet. Du må slette innholdet først. + + + + Cannot delete root folder. It is not empty. Recursive deletion is not supported. Please delete the content first. + Kan ikke slette hovedmappen da den ikke er tom. Rekursiv sletting er ikke støttet. Du må slette innholdet først. + + + + The item cannot be moved to that location. + Denne enheten kan ikke flyttes til denne lokasjonen. + + + + Cannot add new files or folders to the Trash folder. + Kan ikke legge til nye filer eller mapper til søppel-mappen. + + + + There is nowhere to add item with name '{0}'. + Fant ikke noe sted å legge til enheten med navn '{0}'. + + + + GuiProjectTreeMenu + + + Edit Project Item + Endre enhet + + + + Open Document + Åpne dokument + + + + View Document + Vis dokument + + + + Toggle Included Flag + Slå av/på inkludering + + + + New File + Ny fil + + + + New Folder + Ny mappe + + + + Delete Item + Slett enhet + + + + Empty Trash + Tøm søppel + + + + Move Item Up + Flytt enhet opp + + + + Move Item Down + Flytt enhet ned + + + + GuiTheme + + + Could not load theme config file. + Kunne ikke laste temaets konfigurasjonsfil. + + + + Could not load syntax file. + Kunne ikke laste temaets syntaksfil. + + + + GuiWordList + + + Project Word List + Prosjektets ordliste + + + + Add new entry + Legg til nytt + + + + Delete selected entry + Slett valgte element + + + + Save + Lagre + + + + Close + Lukk + + + + Cannot add a blank word. + Kan ikke legge til et tomt ord. + + + + The word '{0}' is already in the word list. + Ordet '{0}' ligger allerede i ordlisten. + + + + GuiWritingStats + + + Writing Statistics + Statistikk + + + + Session Start + Starttid + + + + Length + Lengde + + + + Idle + Inaktiv + + + + Words + Ord + + + + Histogram + + + + + Sum Totals + Totalsummer + + + + Total Time: + Totaltid: + + + + Idle Time: + Inaktiv tid: + + + + Filtered Time: + Filtrert tid: + + + + Novel Word Count: + Ord i roman: + + + + Notes Word Count: + Ord i notater: + + + + Total Word Count: + Ord totalt: + + + + Filters + Filtre + + + + Count novel files + Tell i romanfiler + + + + Count note files + Tell i notatfiler + + + + Hide zero word count + Skjul null-verdier + + + + Hide negative word count + Skjul negative verdier + + + + Group entries by day + Samle rader per dag + + + + Show idle time + Vis inaktiv som tid + + + + Word count cap for the histogram + Maks antall ord for histogram + + + + Close + Lukk + + + + Save As + Lagre som + + + + JSON Data File (.json) + JSON-format (.json) + + + + CSV Data File (.csv) + CSV-format (.csv) + + + + JSON Data File + JSON-format + + + + CSV Data File + CSV-format + + + + Failed to read session log file. + Kunne ikke lese loggfil med skrive-statistikk. + + + + Save Data As + Lagre data som + + + + NWDoc + + + Failed to open document file. + Kunne ikke åpne dokumentets fil. + + + + Opened Document: {0} + Åpnet dokument: {0} + + + + Could not save document. + Kunne ikke lagre dokumentet. + + + + Saved Document: {0} + Lagret dokumentet: {0} + + + + Could not delete document file. + Kunne ikke slette dokumentets fil. + + + + NWErrorMessage + + + Close + Lukk + + + + NWProject + + + Trash + Søppel + + + + New + Ny + + + + Note + Notat + + + + Draft + Utkast + + + + Finished + Ferdig + + + + Minor + Mindre + + + + Major + Større + + + + Main + Hoved + + + + New Project + Nytt prosjekt + + + + By + Av + + + + Novel + Roman + + + + Plot + Plott + + + + Characters + Karakterer + + + + World + Verden + + + + Title Page + Tittelside + + + + New Chapter + Nytt kapittel + + + + New Scene + Ny scene + + + + Chapter {0} + Kapittel {0} + + + + Scene {0} + Scene {0} + + + + File not found: {0} + Fant ikke filen: {0} + + + + Failed to parse project xml. + Kunne ikke lese prosjektets xml-data. + + + + Attempting to open backup project file instead. + Forsøker å åpne prosjektets sekundære prosjektfil istedet. + + + + Unknown + Ukjent + + + + Project file does not appear to be a novelWriterXML file. + Prosjektfilen later ikke til å være en novelWriterXML-fil. + + + + Unknown or unsupported novelWriter project file format. The project cannot be opened by this version of novelWriter. The file was saved with novelWriter version {0}. + Prosjektfilen har et ukjent eller ikke støttet format, og kan ikke åpnes med denne versjonen av novelWriter. Prosjektet ble lagret av novelWriter versjon {0}. + + + + Version Conflict + Versjonskonflikt + + + + Opened Project: {0} + Åpnet prosjekt: {0} + + + + Project path not set, cannot save project. + Prosjektet mangler filbane, og kan ikke lagres. + + + + Failed to save project. + Kunne ikke lagre prosjektet. + + + + Saved Project: {0} + Lagret prosjekt: {0} + + + + Backing up project ... + Lager sikkerhetskopi ... + + + + Cannot backup project because no backup path is set. Please set a valid backup location in Tools > Preferences. + Kan ikke ta sikkerhetskopi av prosjektet da ingen filbane er satt. Du må først sette en filbane i Verktøy > Innstillinger. + + + + Cannot backup project because no project name is set. Please set a Working Title in Project > Project Settings. + Kan ikke ta sikkerhetskopi av prosjektet da ingen arbeidstittel er satt. Du må først sette en arbeidstittel i Prosjekt > Prosjektinnstillinger. + + + + Cannot backup project because the backup path does not exist. Please set a valid backup location in Tools > Preferences. + Kan ikke ta sikkerhetskopi av prosjektet da filbane ikke finnes. Du må sette en ny filbane i Verktøy > Innstillinger. + + + + Could not create backup folder. + Kunne ikke lage mappe til sikkerhetskopi. + + + + Cannot backup project because the backup path is within the project folder to be backed up. Please choose a different backup path in Tools > Preferences. + Kan ikke ta sikkerhetskopi av prosjektet da filbanen er inne i prosjektmappen. Du må sette en ny filbane i Verktøy > Innstillinger. + + + + Backup from {0} + Sikkerhetskopi fra {0} + + + + Backup archive file written to: {0} + Sikkerhetskopi skrevet til: {0} + + + + Could not write backup archive. + Kunne ikke lage sikkerhetskopi. + + + + Project backed up to '{0}' + Sikkerhetskopi skrevet til '{0}' + + + + Failed to create a new example project. + Kunne ikke lage nytt eksempel-prosjekt. + + + + Failed to create a new example project. Could not find the necessary files. They seem to be missing from this installation. + Kunne ikke lage nytt eksempel-prosjekt. Kunne ikke finne de nødvendige filene. De ser ut til å mangle i denne installasjonen. + + + + Could not create new project folder. + Kunne ikke lage ny prosjekt-mappe. + + + + New project folder is not empty. Each project requires a dedicated project folder. + Ny prosjektmappe er ikke tom. Hvert prosjekt trenger sin egen mappe. + + + + You must set a valid backup path in preferences to use the automatic project backup feature. + Du må sette en gyldig filbane i innstillingene for å kunne bruke automatisk sikkerhetskopi. + + + + You must set a valid project name in project settings to use the automatic project backup feature. + Du må sette en gyldig arbeidstittel i prosjektinnstillingene for å kunne bruke automatisk sikkerhetskopi. + + + + and + og + + + + Found {0} orphaned file(s) in project folder. + Fant {0} tapte filer i prosjektmappen. + + + + Recovered + Gjennopprettet + + + + [{0}] {1} + + + + + Recovered File {0} + Gjennopprettet fil {0} + + + + One or more orphaned files could not be added back into the project. Make sure at least a Novel root folder exists. + Én eller flere gjennopprettede filer kunne ikke bli lagt til i posjektet. Pass på at "Roman"-mappen i det minste eksisterer. + + + + Not a folder: {0} + Ikke en mappe: {0} + + + + Could not move: {0} + Kunne ikke flytte: {0} + + + + Could not delete: {0} + Kunne ikke slette: {0} + + + + Could not make folder: {0} + Kunne ikke lage mappe: {0} + + + + Could not move item {0} to {1}. + Kunne ikke flytte {0} til {1}. + + + + Chapter + Kapittel + + + + This project was saved by a newer version of novelWriter, version {0}. This is version {1}. If you continue to open the project, some attributes and settings may not be preserved, but the overall project should be fine. Continue opening the project? + Dette prosjektet ble lagret av en nyere versjon av novelWriter, versjon {0}. Dette er versjon {1}. Hvis du ønsker å fortsette med å åpne prosjektet, kan noen av innstillingene bli borte, men selve prosjektet vil være i orden. Vil du fortsatt åpne prosjektet? + + + + ProjWizardCustomPage + + + Custom Project Options + Flere alternativer + + + + Select which additional root folders to make, and how to populate the Novel folder. If you don't want to add chapters or scenes, set the values to 0. You can add scenes without chapters. + Velg hvilke mapper du ønsker i prosjektet, og hvordan du ønsker å fylle hovedmappen for boken. Hvis du ikke ønsker å legge til kapitler og scener, sett verdiene til 0. Du kan også legge til scener uten å legge til kapitler. + + + + Additional Root Folders + Hovedmapper + + + + {0} folder + {0} + + + + Populate Novel Folder + Fyll roman-mappen + + + + Add chapters + Legg til kapitler + + + + Scenes (per chapter) + Scener (per kapittel) + + + + Add chapter folders + Lag kapittel-mapper + + + + ProjWizardFinalPage + + + Finished + Ferdig + + + + All done. + Alt er klart. + + + + Press '{0}' to create the new project. + Trykk '{0}' for å opprette det nye prosjektet. + + + + Done + + + + + Finish + + + + + ProjWizardFolderPage + + + Select Project Folder + Velg prosjektmappe + + + + Select a location to store the project. A new project folder will be created in the selected location. + Velg et sted hvor prosjektet skal lagres. En mappe for hele prosjektet vil bli opprettet her. + + + + Required + Påkrevd + + + + Project Path + Filbane + + + + ProjWizardIntroPage + + + Create New Project + Opprett nytt prosjekt + + + + Provide at least a working title. The working title should not be change beyond this point as it is used by the application for generating file names for for instance backups. The other fields are optional and can be changed at any time in Project Settings. + Du må fylle inn minst en arbeidstittel. Du bør ikke endre arbeidstittelen etter at prosjektet er opprettet da denne brukes til blant annet filnavn for sikkerhetskopi. De andre feltene er valgfrie, og kan endres når som helst i Prosjektinstillinger. + + + + Side image by {0}, {1} + Illustrasjon av {0}, {1} + + + + Required + Påkrevd + + + + Optional + Valgfritt + + + + Optional. One name per line. + Valgfritt. Ett navn per linje. + + + + Working Title + Arbeidstittel + + + + Novel Title + Bokens tittel + + + + Author(s) + Forfatter(e) + + + + ProjWizardPopulatePage + + + Populate Project + Fyll prosjektet + + + + Choose how to pre-fill the project. Either with a minimal set of starter items, an example project explaining and showing many of the features, or show further custom options on the next page. + Velg hvordan du vil forhåndsfylle prosjektet. Du kan velge mellom et minimalt sett med mapper og filer, et eksempel-prosjekt som forklarer og viser hvordan du bruker programmet, eller se flere valg på neste side. + + + + Fill the project with a minimal set of items + Fyll prosjektet med et minimalt innhold + + + + Fill the project with example files + Fyll prosjektet med eksempelfiler + + + + Show detailed options for filling the project + Vis detaljerte valg for å fylle prosjektet + + + + QuotesDialog + + + Cancel + Avbryt + + + + OK + OK + + + + Tokenizer + + + Document '{0}' is too big ({1} MB). Skipping. + Dokumentet '{0}' er for stort ({1} MB). Hopper over. + + + + ERROR + + + + diff --git a/i18n/nw_pt.ts b/i18n/nw_pt.ts index cce1aeca..ec87932e 100644 --- a/i18n/nw_pt.ts +++ b/i18n/nw_pt.ts @@ -1,5 +1,6 @@ - + + Constant @@ -678,6 +679,11 @@ JSON + novelWriter Markdown JSON + Markdown do novelWriter + + + Styling Options + + GuiBuildNovelDocView @@ -966,16 +972,16 @@ Element selected in the project tree must be a folder. O elemento selecionado na árvore do projeto deve ser um diretório. - - - Ok - OK - Cancel Cancelar + + + OK + OK + GuiDocSplit @@ -1049,16 +1055,16 @@ The document will be split into {0} file(s) in a new folder. The original document will remain intact. O documento será dividio em {0} arquivo(s) em um novo diretório. O documento original será mantido intacto. - - - Ok - OK - Cancel Cancelar + + + OK + OK + GuiDocViewFooter @@ -1232,16 +1238,16 @@ Layout Leiaute - - - Ok - OK - Cancel Cancelar + + + OK + OK + GuiMain @@ -1450,6 +1456,11 @@ All files ({0}) Todos os arquivos ({0}) + + + novelWriter is ready ... + + GuiMainMenu @@ -2733,16 +2744,16 @@ Automation Automação - - - Ok - OK - Cancel Cancelar + + + OK + OK + GuiPreferencesAutomation @@ -3740,16 +3751,16 @@ Auto-Replace Substituição Automática - - - Ok - OK - Cancel Cancelar + + + OK + OK + GuiProjectTree @@ -4184,11 +4195,6 @@ Trash Lixeira - - - Chapter %ch%: %title% - Capítulo %ch%: %title% - New @@ -4489,6 +4495,11 @@ and e + + + Chapter + Capítulo + ProjWizardCustomPage @@ -4662,16 +4673,16 @@ QuotesDialog - - - Ok - OK - Cancel Cancelar + + + OK + OK + Tokenizer diff --git a/nw/assets/lang/project_en.json b/i18n/project_en.json similarity index 99% rename from nw/assets/lang/project_en.json rename to i18n/project_en.json index e1bfbb37..a0432c75 100644 --- a/nw/assets/lang/project_en.json +++ b/i18n/project_en.json @@ -102,4 +102,4 @@ "97": "Ninety-Seven", "98": "Ninety-Eight", "99": "Ninety-Nine" -} \ No newline at end of file +} diff --git a/nw/assets/lang/project_nb_NO.json b/i18n/project_nb_NO.json similarity index 99% rename from nw/assets/lang/project_nb_NO.json rename to i18n/project_nb_NO.json index 06ce164b..39010cf2 100644 --- a/nw/assets/lang/project_nb_NO.json +++ b/i18n/project_nb_NO.json @@ -102,4 +102,4 @@ "97": "nittisju", "98": "nittiåtte", "99": "nittini" -} \ No newline at end of file +} diff --git a/nw/assets/lang/project_nn_NO.json b/i18n/project_nn_NO.json similarity index 99% rename from nw/assets/lang/project_nn_NO.json rename to i18n/project_nn_NO.json index 1ee2f2ee..09b99a4e 100644 --- a/nw/assets/lang/project_nn_NO.json +++ b/i18n/project_nn_NO.json @@ -102,4 +102,4 @@ "97": "nittisju", "98": "nittiåtte", "99": "nittini" -} \ No newline at end of file +} diff --git a/i18n/project_pt.json b/i18n/project_pt.json new file mode 100644 index 00000000..84dba670 --- /dev/null +++ b/i18n/project_pt.json @@ -0,0 +1,5 @@ +{ + "Synopsis": "Sinopse", + "Comment": "Comentários", + "Notes": "Notas" +} diff --git a/novelWriter.pro b/novelWriter.pro index b2da5800..82f33934 100644 --- a/novelWriter.pro +++ b/novelWriter.pro @@ -26,8 +26,10 @@ SOURCES += \ nw/gui/theme.py \ nw/gui/wordlist.py \ nw/gui/writingstats.py \ + nw/common.py \ nw/error.py \ nw/guimain.py TRANSLATIONS += \ - i18n/nw_pt.ts + i18n/nw_pt.ts \ + i18n/nw_nb_NO.ts diff --git a/nw/common.py b/nw/common.py index 826f7370..d05d814b 100644 --- a/nw/common.py +++ b/nw/common.py @@ -29,6 +29,7 @@ import logging from datetime import datetime from PyQt5.QtWidgets import qApp +from PyQt5.QtCore import QCoreApplication from nw.constants import ( nwConst, nwUnicode, nwItemClass, nwItemType, nwItemLayout @@ -267,33 +268,61 @@ def fuzzyTime(secDiff): """Converts a time difference in seconds into a fuzzy time string. """ if secDiff < 0: - return "in the future" + return QCoreApplication.translate( + "Common", "in the future" + ) elif secDiff < 30: - return "just now" + return QCoreApplication.translate( + "Common", "just now" + ) elif secDiff < 90: - return "a minute ago" + return QCoreApplication.translate( + "Common", "a minute ago" + ) elif secDiff < 3300: # 55 minutes - return "%d minutes ago" % int(round(secDiff/60)) + return QCoreApplication.translate( + "Common", "{0} minutes ago" + ).format(int(round(secDiff/60))) elif secDiff < 5400: # 90 minutes - return "an hour ago" + return QCoreApplication.translate( + "Common", "an hour ago" + ) elif secDiff < 84600: # 23.5 hours - return "%d hours ago" % int(round(secDiff/3600)) + return QCoreApplication.translate( + "Common", "{0} hours ago" + ).format(int(round(secDiff/3600))) elif secDiff < 129600: # 1.5 days - return "a day ago" + return QCoreApplication.translate( + "Common", "a day ago" + ) elif secDiff < 561600: # 6.5 days - return "%d days ago" % int(round(secDiff/86400)) + return QCoreApplication.translate( + "Common", "{0} days ago" + ).format(int(round(secDiff/86400))) elif secDiff < 907200: # 10.5 days - return "a week ago" + return QCoreApplication.translate( + "Common", "a week ago" + ) elif secDiff < 2419200: # 28 days - return "%d weeks ago" % int(round(secDiff/604800)) + return QCoreApplication.translate( + "Common", "{0} weeks ago" + ).format(int(round(secDiff/604800))) elif secDiff < 3888000: # 45 days - return "a month ago" + return QCoreApplication.translate( + "Common", "a month ago" + ) elif secDiff < 29808000: # 345 days - return "%d months ago" % int(round(secDiff/2592000)) + return QCoreApplication.translate( + "Common", "{0} months ago" + ).format(int(round(secDiff/2592000))) elif secDiff < 47336400: # 1.5 years - return "a year ago" + return QCoreApplication.translate( + "Common", "a year ago" + ) else: - return "%d years ago" % int(round(secDiff/31557600)) + return QCoreApplication.translate( + "Common", "{0} years ago" + ).format(int(round(secDiff/31557600))) def makeFileNameSafe(theText): """Returns a filename safe version of the text. @@ -311,3 +340,26 @@ def getGuiItem(theName): if qWidget.objectName() == theName: return qWidget return None + +def numberToRoman(numVal, isLower=False): + """Convert an integer to a roman number. + """ + if not isinstance(numVal, int): + return "NAN" + if numVal < 1 or numVal > 4999: + return "OOR" + + theValues = [ + (1000, "M"), (900, "CM"), (500, "D"), (400, "CD"), (100, "C"), (90, "XC"), + (50, "L"), (40, "XL"), (10, "X"), (9, "IX"), (5, "V"), (4, "IV"), (1, "I"), + ] + + romNum = "" + for theDiv, theSym in theValues: + n = numVal//theDiv + romNum += n*theSym + numVal -= n*theDiv + if numVal <= 0: + break + + return romNum.lower() if isLower else romNum diff --git a/nw/config.py b/nw/config.py index 618bfd3c..037520c8 100644 --- a/nw/config.py +++ b/nw/config.py @@ -76,7 +76,6 @@ class Config: self.themeRoot = None # The full path to the nw/assets/themes folder self.dictPath = None # The full path to the nw/assets/dict folder self.iconPath = None # The full path to the nw/assets/icons folder - self.langPath = None # The full path to the nw/assets/lang folder self.helpPath = None # The full path to the novelwriter .qhc help file # Runtime Settings and Variables @@ -298,7 +297,6 @@ class Config: self.themeRoot = os.path.join(self.assetPath, "themes") self.dictPath = os.path.join(self.assetPath, "dict") self.iconPath = os.path.join(self.assetPath, "icons") - self.langPath = os.path.join(self.assetPath, "lang") self.appIcon = os.path.join(self.iconPath, "novelwriter.svg") # Internationalisation @@ -384,7 +382,7 @@ class Config: for lngPath, lngBase in langList: for lngCode in self.qLocal.uiLanguages(): qTrans = QTranslator() - lngFile = "%s_%s" % (lngBase, lngCode) + lngFile = "%s_%s" % (lngBase, lngCode.replace("-", "_")) if lngFile not in self.qtTrans: if qTrans.load(lngFile, lngPath): logger.debug("Loaded: %s" % qTrans.filePath()) @@ -1079,7 +1077,7 @@ class Config: try: import enchant # noqa: F401 self.hasEnchant = True - logger.debug("Checking package 'pyenchant': Ok") + logger.debug("Checking package 'pyenchant': OK") except Exception: self.hasEnchant = False logger.debug("Checking package 'pyenchant': Missing") @@ -1087,7 +1085,7 @@ class Config: assistPath = shutil.which("assistant") self.hasAssistant = assistPath is not None if self.hasAssistant: - logger.debug("Checking executable 'assistant': Ok") + logger.debug("Checking executable 'assistant': OK") else: logger.debug("Checking executable 'assistant': Missing") diff --git a/nw/constants/constants.py b/nw/constants/constants.py index 9f17bae5..a3ab3580 100644 --- a/nw/constants/constants.py +++ b/nw/constants/constants.py @@ -240,8 +240,8 @@ class nwQuotes(): "\u2039" : QT_TRANSLATE_NOOP("Constant", "Single left-pointing angle quotation mark"), "\u203a" : QT_TRANSLATE_NOOP("Constant", "Single right-pointing angle quotation mark"), - "\u00ab" : QT_TRANSLATE_NOOP("Constant", "Left-pointing double angle quotation mark"), - "\u00bb" : QT_TRANSLATE_NOOP("Constant", "Right-pointing double angle quotation mark"), + "\u00ab" : QT_TRANSLATE_NOOP("Constant", "Double left-pointing angle quotation mark"), + "\u00bb" : QT_TRANSLATE_NOOP("Constant", "Double right-pointing angle quotation mark"), "\u300c" : QT_TRANSLATE_NOOP("Constant", "Left corner bracket"), "\u300d" : QT_TRANSLATE_NOOP("Constant", "Right corner bracket"), diff --git a/nw/core/__init__.py b/nw/core/__init__.py index be0aeeb2..f79492a3 100644 --- a/nw/core/__init__.py +++ b/nw/core/__init__.py @@ -1,17 +1,15 @@ # -*- coding: utf-8 -*- from nw.core.document import NWDoc -from nw.core.index import NWIndex +from nw.core.index import NWIndex, countWords from nw.core.project import NWProject from nw.core.spellcheck import NWSpellCheck, NWSpellEnchant, NWSpellSimple from nw.core.tohtml import ToHtml from nw.core.toodt import ToOdt from nw.core.tomd import ToMarkdown -from nw.core.tools import countWords, numberToRoman __all__ = [ "countWords", - "numberToRoman", "NWDoc", "NWIndex", "NWProject", diff --git a/nw/core/index.py b/nw/core/index.py index f6bdf0ae..93aed47e 100644 --- a/nw/core/index.py +++ b/nw/core/index.py @@ -5,7 +5,8 @@ novelWriter – Project Index Data class for the project index of tags, headers and references File History: -Created: 2019-05-27 [0.1.4] +Created: 2019-04-22 [0.0.1] countWords +Created: 2019-05-27 [0.1.4] NWIndex This file is a part of novelWriter Copyright 2018–2021, Veronica Berglyd Olsen @@ -32,10 +33,10 @@ import os from time import time from nw.constants import ( - nwFiles, nwKeyWords, nwItemType, nwItemClass, nwItemLayout, nwAlert + nwFiles, nwKeyWords, nwItemType, nwItemClass, nwItemLayout, nwAlert, + nwUnicode ) from nw.core.document import NWDoc -from nw.core.tools import countWords from nw.common import isHandle, isTitleTag, isItemClass, isItemLayout logger = logging.getLogger(__name__) @@ -906,3 +907,62 @@ class NWIndex(): return # END Class NWIndex + +# =============================================================================================== # +# Simple Word Counter +# =============================================================================================== # + +def countWords(theText): + """Count words in a piece of text, skipping special syntax and + comments. + """ + charCount = 0 + wordCount = 0 + paraCount = 0 + prevEmpty = True + + # We need to treat dashes as word separators for counting words. + # The check+replace apprach is much faster that direct replace for + # large texts, and a bit slower for small texts, but in the latter + # case it doesn't matter. + if nwUnicode.U_ENDASH in theText: + theText = theText.replace(nwUnicode.U_ENDASH, " ") + if nwUnicode.U_EMDASH in theText: + theText = theText.replace(nwUnicode.U_EMDASH, " ") + + for aLine in theText.splitlines(): + + countPara = True + theLen = len(aLine) + + if theLen == 0: + prevEmpty = True + continue + if aLine[0] == "@" or aLine[0] == "%": + continue + + if aLine[0:5] == "#### ": + wordCount -= 1 + charCount -= 5 + countPara = False + elif aLine[0:4] == "### ": + wordCount -= 1 + charCount -= 4 + countPara = False + elif aLine[0:3] == "## ": + wordCount -= 1 + charCount -= 3 + countPara = False + elif aLine[0:2] == "# ": + wordCount -= 1 + charCount -= 2 + countPara = False + + wordCount += len(aLine.split()) + charCount += theLen + if countPara and prevEmpty: + paraCount += 1 + + prevEmpty = not countPara + + return charCount, wordCount, paraCount diff --git a/nw/core/project.py b/nw/core/project.py index 02fa3fd3..4019fcbc 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -203,7 +203,7 @@ class NWProject(): self.autoReplace = {} self.titleFormat = { "title" : r"%title%", - "chapter" : self.tr(r"Chapter %ch%: %title%"), + "chapter" : self.tr("Chapter")+r" %ch%: %title%", "unnumbered" : r"%title%", "scene" : r"* * *", "section" : r"", @@ -443,16 +443,10 @@ class NWProject(): xRoot = nwXML.getroot() nwxRoot = xRoot.tag - appVersion = xRoot.attrib.get("appVersion", self.tr("Unknown")) - hexVersion = xRoot.attrib.get("hexVersion", "0x0") + appVersion = xRoot.attrib.get("appVersion", self.tr("Unknown")) + hexVersion = xRoot.attrib.get("hexVersion", "0x0") fileVersion = xRoot.attrib.get("fileVersion", self.tr("Unknown")) - # The following are deprecated and will be removed - # The settings have been moved to the tag - self.saveCount = checkInt(xRoot.attrib.get("saveCount", 0), 0, False) - self.autoCount = checkInt(xRoot.attrib.get("autoCount", 0), 0, False) - self.editTime = checkInt(xRoot.attrib.get("editTime", 0), 0, False) - logger.verbose("XML root is %s" % nwxRoot) logger.verbose("File version is %s" % fileVersion) @@ -479,27 +473,7 @@ class NWProject(): # parser will lose the autoReplace settings if allowed to # read the file. Introduced in version 0.10. - if fileVersion == "1.0": - msgYes = self.theParent.askQuestion( - self.tr("Old Project Version"), - "%s

%s" % ( - self.tr( - "The project file and data is created by a novelWriter version " - "lower than 0.7. Do you want to upgrade the project to the " - "most recent format?" - ), - self.tr( - "Note that after the upgrade, you cannot open the project with " - "an older version of novelWriter any more, so make sure you " - "have a recent backup." - ) - ) - ) - if not msgYes: - self.clearProject() - return False - - elif fileVersion != "1.1" and fileVersion != "1.2": + if fileVersion not in ("1.0", "1.1", "1.2"): self.makeAlert(( self.tr( "Unknown or unsupported novelWriter project file format. " @@ -518,7 +492,7 @@ class NWProject(): self.tr("Version Conflict"), self.tr( "This project was saved by a newer version of novelWriter, version " - "{0}. This is version {1}. If you continue to open the project, " + "{0}. This is version {1}. If you continue to open the project, " "some attributes and settings may not be preserved, but the " "overall project should be fine. Continue opening the project?" ).format(appVersion, nw.__version__) @@ -552,10 +526,6 @@ class NWProject(): elif xItem.tag == "editTime": self.editTime = checkInt(xItem.text, 0) - # The following is deprecated, and will be removed - elif xItem.tag == "backup": - self.doBackup = checkBool(xItem.text, False) - elif xChild.tag == "settings": logger.debug("Found project settings") for xItem in xChild: @@ -585,13 +555,8 @@ class NWProject(): self.importItems.unpackXML(xItem) elif xItem.tag == "autoReplace": for xEntry in xItem: - if xEntry.tag == "entry": - if "key" in xEntry.attrib: - self.autoReplace[xEntry.attrib["key"]] = checkString( - xEntry.text, None, False - ) - else: # Old format - self.autoReplace[xEntry.tag] = checkString( + if xEntry.tag == "entry" and "key" in xEntry.attrib: + self.autoReplace[xEntry.attrib["key"]] = checkString( xEntry.text, None, False ) elif xItem.tag == "titleFormat": @@ -1254,9 +1219,9 @@ class NWProject(): theLang = "en" lngShort = theLang.split("_")[0] - loadFile = os.path.join(self.mainConf.langPath, "project_en.json") - chkFile1 = os.path.join(self.mainConf.langPath, "project_%s.json" % theLang) - chkFile2 = os.path.join(self.mainConf.langPath, "project_%s.json" % lngShort) + loadFile = os.path.join(self.mainConf.nwLangPath, "project_en.json") + chkFile1 = os.path.join(self.mainConf.nwLangPath, "project_%s.json" % theLang) + chkFile2 = os.path.join(self.mainConf.nwLangPath, "project_%s.json" % lngShort) if os.path.isfile(chkFile1): loadFile = chkFile1 diff --git a/nw/core/tokenizer.py b/nw/core/tokenizer.py index 260a230e..989db48f 100644 --- a/nw/core/tokenizer.py +++ b/nw/core/tokenizer.py @@ -33,7 +33,7 @@ from functools import partial from PyQt5.QtCore import QCoreApplication, QRegularExpression from nw.core.document import NWDoc -from nw.core.tools import numberToRoman +from nw.common import numberToRoman from nw.constants import nwConst, nwUnicode, nwItemLayout, nwItemType, nwRegEx logger = logging.getLogger(__name__) diff --git a/nw/core/toodt.py b/nw/core/toodt.py index 0de95281..d1519a9d 100644 --- a/nw/core/toodt.py +++ b/nw/core/toodt.py @@ -563,7 +563,7 @@ class ToOdt(Tokenizer): ## if len(theText) != len(theFmt): - # Genrate dummy format if there isn't any + # Generate dummy format if there isn't any or it doesn't match theFmt = " "*len(theText) # XML functions diff --git a/nw/core/tools.py b/nw/core/tools.py deleted file mode 100644 index a3dff45b..00000000 --- a/nw/core/tools.py +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8 -*- -""" -novelWriter – Various Tools -=========================== -Various core tool functions - -File History: -Created: 2019-04-22 [0.0.1] countWords -Created: 2020-07-05 [0.10.0] numberToRoman - -This file is a part of novelWriter -Copyright 2018–2021, Veronica Berglyd Olsen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -""" - -import logging - -from nw.constants import nwUnicode - -logger = logging.getLogger(__name__) - -# =============================================================================================== # -# Simple Word Counter -# =============================================================================================== # - -def countWords(theText): - """Count words in a piece of text, skipping special syntax and - comments. - """ - charCount = 0 - wordCount = 0 - paraCount = 0 - prevEmpty = True - - # We need to treat dashes as word separators for counting words. - # The check+replace apprach is much faster that direct replace for - # large texts, and a bit slower for small texts, but in the latter - # case it doesn't matter. - if nwUnicode.U_ENDASH in theText: - theText = theText.replace(nwUnicode.U_ENDASH, " ") - if nwUnicode.U_EMDASH in theText: - theText = theText.replace(nwUnicode.U_EMDASH, " ") - - for aLine in theText.splitlines(): - - countPara = True - theLen = len(aLine) - - if theLen == 0: - prevEmpty = True - continue - if aLine[0] == "@" or aLine[0] == "%": - continue - - if aLine[0:5] == "#### ": - wordCount -= 1 - charCount -= 5 - countPara = False - elif aLine[0:4] == "### ": - wordCount -= 1 - charCount -= 4 - countPara = False - elif aLine[0:3] == "## ": - wordCount -= 1 - charCount -= 3 - countPara = False - elif aLine[0:2] == "# ": - wordCount -= 1 - charCount -= 2 - countPara = False - - wordCount += len(aLine.split()) - charCount += theLen - if countPara and prevEmpty: - paraCount += 1 - - prevEmpty = not countPara - - return charCount, wordCount, paraCount - -# =============================================================================================== # -# Convert an Integer to a Roman Number -# =============================================================================================== # - -def numberToRoman(numVal, isLower=False): - """Convert an integer to a roman number. - """ - if not isinstance(numVal, int): - return "NAN" - if numVal < 1 or numVal > 4999: - return "OOR" - - theValues = [ - (1000, "M"), (900, "CM"), (500, "D"), (400, "CD"), (100, "C"), (90, "XC"), - (50, "L"), (40, "XL"), (10, "X"), (9, "IX"), (5, "V"), (4, "IV"), (1, "I"), - ] - - romNum = "" - for theDiv, theSym in theValues: - n = numVal//theDiv - romNum += n*theSym - numVal -= n*theDiv - if numVal <= 0: - break - - return romNum.lower() if isLower else romNum diff --git a/nw/gui/build.py b/nw/gui/build.py index 95bd2c40..1e818733 100644 --- a/nw/gui/build.py +++ b/nw/gui/build.py @@ -257,7 +257,7 @@ class GuiBuildNovel(QDialog): # Styling Options # =============== - self.styleGroup = QGroupBox("Styling Options", self) + self.styleGroup = QGroupBox(self.tr("Styling Options"), self) self.styleForm = QGridLayout(self) self.styleGroup.setLayout(self.styleForm) diff --git a/nw/gui/custom.py b/nw/gui/custom.py index 4b187f21..e1ae95e1 100644 --- a/nw/gui/custom.py +++ b/nw/gui/custom.py @@ -39,7 +39,7 @@ from PyQt5.QtWidgets import ( QStylePainter, QStyleOptionTab, QListWidget, QListWidgetItem, QFrame ) -from nw.constants import nwUnicode, nwQuotes +from nw.constants import trConst, nwUnicode, nwQuotes logger = logging.getLogger(__name__) @@ -487,7 +487,7 @@ class QuotesDialog(QDialog): minSize = 100 for sKey, sLabel in nwQuotes.SYMBOLS.items(): - theText = "[ %s ] %s" % (sKey, sLabel) + theText = "[ %s ] %s" % (sKey, trConst(sLabel)) minSize = max(minSize, qMetrics.boundingRect(theText).width()) qtItem = QListWidgetItem(theText) qtItem.setData(Qt.UserRole, sKey) @@ -500,7 +500,7 @@ class QuotesDialog(QDialog): # Buttons self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) - self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("Ok")) + self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("OK")) self.buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr("Cancel")) self.buttonBox.accepted.connect(self._doAccept) self.buttonBox.rejected.connect(self._doReject) diff --git a/nw/gui/docmerge.py b/nw/gui/docmerge.py index 2d2c8887..dfe928d5 100644 --- a/nw/gui/docmerge.py +++ b/nw/gui/docmerge.py @@ -66,7 +66,7 @@ class GuiDocMerge(QDialog): self.listBox.setMinimumHeight(self.mainConf.pxInt(180)) self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) - self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("Ok")) + self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("OK")) self.buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr("Cancel")) self.buttonBox.accepted.connect(self._doMerge) self.buttonBox.rejected.connect(self._doClose) diff --git a/nw/gui/docsplit.py b/nw/gui/docsplit.py index b72f9b3c..034a986c 100644 --- a/nw/gui/docsplit.py +++ b/nw/gui/docsplit.py @@ -82,7 +82,7 @@ class GuiDocSplit(QDialog): self.splitLevel.currentIndexChanged.connect(self._populateList) self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) - self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("Ok")) + self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("OK")) self.buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr("Cancel")) self.buttonBox.accepted.connect(self._doSplit) self.buttonBox.rejected.connect(self._doClose) diff --git a/nw/gui/itemeditor.py b/nw/gui/itemeditor.py index 107172f0..17393579 100644 --- a/nw/gui/itemeditor.py +++ b/nw/gui/itemeditor.py @@ -117,7 +117,7 @@ class GuiItemEditor(QDialog): # Buttons self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) - self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("Ok")) + self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("OK")) self.buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr("Cancel")) self.buttonBox.accepted.connect(self._doSave) self.buttonBox.rejected.connect(self._doClose) diff --git a/nw/gui/preferences.py b/nw/gui/preferences.py index aa7946d6..09a0c3a9 100644 --- a/nw/gui/preferences.py +++ b/nw/gui/preferences.py @@ -70,7 +70,7 @@ class GuiPreferences(PagedDialog): self.addTab(self.tabAuto, self.tr("Automation")) self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) - self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("Ok")) + self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("OK")) self.buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr("Cancel")) self.buttonBox.accepted.connect(self._doSave) self.buttonBox.rejected.connect(self._doClose) @@ -828,8 +828,7 @@ class GuiPreferencesEditor(QWidget): for spTag, spProv in theDict.listDictionaries(): qLocal = QLocale(spTag) spLang = qLocal.nativeLanguageName().title() - spName = qLocal.bcp47Name() - self.spellLangList.addItem("%s (%s) [%s]" % (spLang, spName, spProv), spTag) + self.spellLangList.addItem("%s [%s]" % (spLang, spProv), spTag) spellIdx = self.spellLangList.findData(self.mainConf.spellLanguage) if spellIdx != -1: diff --git a/nw/gui/projdetails.py b/nw/gui/projdetails.py index 1ee40f6f..ba393261 100644 --- a/nw/gui/projdetails.py +++ b/nw/gui/projdetails.py @@ -37,7 +37,7 @@ from PyQt5.QtWidgets import ( from nw.gui.custom import PagedDialog, QSwitch from nw.constants import nwUnicode -from nw.core import numberToRoman +from nw.common import numberToRoman logger = logging.getLogger(__name__) diff --git a/nw/gui/projsettings.py b/nw/gui/projsettings.py index 39cfe930..c09cbfdb 100644 --- a/nw/gui/projsettings.py +++ b/nw/gui/projsettings.py @@ -27,7 +27,7 @@ along with this program. If not, see . import nw import logging -from PyQt5.QtCore import Qt +from PyQt5.QtCore import Qt, QLocale from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush from PyQt5.QtWidgets import ( QHBoxLayout, QVBoxLayout, QLineEdit, QPlainTextEdit, QLabel, QWidget, @@ -77,7 +77,7 @@ class GuiProjectSettings(PagedDialog): self.addTab(self.tabReplace, self.tr("Auto-Replace")) self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) - self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("Ok")) + self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("OK")) self.buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr("Cancel")) self.buttonBox.accepted.connect(self._doSave) self.buttonBox.rejected.connect(self._doClose) @@ -207,11 +207,14 @@ class GuiProjectEditMain(QWidget): ) self.spellLang = QComboBox(self) + self.spellLang.setFixedWidth(xW) theDict = self.theParent.docEditor.theDict self.spellLang.addItem(self.tr("Default"), "None") if theDict is not None: - for spTag, spName in theDict.listDictionaries(): - self.spellLang.addItem(spName, spTag) + for spTag, spProv in theDict.listDictionaries(): + qLocal = QLocale(spTag) + spLang = qLocal.nativeLanguageName().title() + self.spellLang.addItem("%s [%s]" % (spLang, spProv), spTag) self.mainForm.addRow( self.tr("Spell check language"), diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 90126ab8..1e557ba8 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -249,9 +249,7 @@ class GuiProjectTree(QTreeWidget): if self.theProject.projTree.isTrashRoot(pHandle): self.makeAlert( - self.tr("Cannot add new files or folders to the {0} folder.").format( - trConst(nwLabels.CLASS_NAME[nwItemClass.TRASH]) - ), nwAlert.ERROR + self.tr("Cannot add new files or folders to the Trash folder."), nwAlert.ERROR ) return False @@ -974,7 +972,7 @@ class GuiProjectTree(QTreeWidget): else: self.makeAlert( self.tr( - "There is nowhere to add item with name '{0}'" + "There is nowhere to add item with name '{0}'." ).format(nwItem.itemName), nwAlert.ERROR ) del self._treeMap[tHandle] diff --git a/nw/gui/writingstats.py b/nw/gui/writingstats.py index aa8ded71..5cc23198 100644 --- a/nw/gui/writingstats.py +++ b/nw/gui/writingstats.py @@ -372,7 +372,7 @@ class GuiWritingStats(QDialog): dlgOpt = QFileDialog.Options() dlgOpt |= QFileDialog.DontUseNativeDialog savePath, _ = QFileDialog.getSaveFileName( - self, self.tr("Save Document As"), savePath, options=dlgOpt + self, self.tr("Save Data As"), savePath, options=dlgOpt ) if not savePath: return False diff --git a/nw/guimain.py b/nw/guimain.py index f059ef16..50a0f6fa 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -290,7 +290,7 @@ class GuiMain(QMainWindow): self.openProject(self.mainConf.cmdOpen) logger.debug("novelWriter is ready ...") - self.setStatus("novelWriter is ready ...") + self.setStatus(self.tr("novelWriter is ready ...")) return diff --git a/tests/test_base/test_base_common.py b/tests/test_base/test_base_common.py index 4b076a64..03c408cd 100644 --- a/tests/test_base/test_base_common.py +++ b/tests/test_base/test_base_common.py @@ -27,7 +27,7 @@ from nw.common import ( checkString, checkBool, checkInt, colRange, formatInt, transferCase, fuzzyTime, checkHandle, formatTimeStamp, formatTime, hexToInt, makeFileNameSafe, isHandle, isTitleTag, isItemClass, isItemType, - isItemLayout + isItemLayout, numberToRoman ) from tools import cmpList @@ -325,3 +325,30 @@ def testBaseCommon_MakeFileNameSafe(): assert makeFileNameSafe("aaaa bbbb") == "aaaa bbbb" # END Test testBaseCommon_MakeFileNameSafe + +@pytest.mark.core +def testBaseCommon_RomanNumbers(): + """Test conversion of integers to Roman numbers. + """ + assert numberToRoman(None, False) == "NAN" + assert numberToRoman(0, False) == "OOR" + assert numberToRoman(1, False) == "I" + assert numberToRoman(2, False) == "II" + assert numberToRoman(3, False) == "III" + assert numberToRoman(4, False) == "IV" + assert numberToRoman(5, False) == "V" + assert numberToRoman(6, False) == "VI" + assert numberToRoman(7, False) == "VII" + assert numberToRoman(8, False) == "VIII" + assert numberToRoman(9, False) == "IX" + assert numberToRoman(10, False) == "X" + assert numberToRoman(14, False) == "XIV" + assert numberToRoman(42, False) == "XLII" + assert numberToRoman(99, False) == "XCIX" + assert numberToRoman(142, False) == "CXLII" + assert numberToRoman(542, False) == "DXLII" + assert numberToRoman(999, False) == "CMXCIX" + assert numberToRoman(2010, False) == "MMX" + assert numberToRoman(999, True) == "cmxcix" + +# END Test testBaseCommon_RomanNumbers diff --git a/tests/test_core/test_core_index.py b/tests/test_core/test_core_index.py index 9b1c656a..2d5f8f12 100644 --- a/tests/test_core/test_core_index.py +++ b/tests/test_core/test_core_index.py @@ -29,7 +29,7 @@ from shutil import copyfile from tools import cmpFiles from nw.core.project import NWProject -from nw.core.index import NWIndex +from nw.core.index import NWIndex, countWords from nw.constants import nwItemClass, nwItemLayout @pytest.mark.core @@ -1161,3 +1161,34 @@ def testCoreIndex_CheckTextCounts(dummyGUI): theIndex._checkTextCounts() # END Test testCoreIndex_CheckTextCounts + +@pytest.mark.core +def testCoreIndex_CountWords(): + """Test the word counter and the exclusion filers. + """ + testText = ( + "# Heading One\n" + "## Heading Two\n" + "### Heading Three\n" + "#### Heading Four\n" + "\n" + "@tag: value\n" + "\n" + "% A comment that should n ot be counted.\n" + "\n" + "The first paragraph.\n" + "\n" + "The second paragraph.\n" + "\n" + "\n" + "The third paragraph.\n" + "\n" + "Dashes\u2013and even longer\u2014dashes." + ) + cC, wC, pC = countWords(testText) + + assert cC == 138 + assert wC == 22 + assert pC == 4 + +# END Test testCoreIndex_CountWords diff --git a/tests/test_core/test_core_project.py b/tests/test_core/test_core_project.py index 07967b86..d6806984 100644 --- a/tests/test_core/test_core_project.py +++ b/tests/test_core/test_core_project.py @@ -368,7 +368,7 @@ def testCoreProject_Open(monkeypatch, nwMinimal, dummyGUI): # Wrong file version writeFile(rName, ( - "\n" + "\n" "\n" - "\n" - "\n" - "\n" - "B\n" - "\n" - "\n" - "\n" - )) - assert theProject.openProject(nwMinimal) is True - assert theProject.autoReplace == {"A": "B"} - assert theProject.closeProject() - # Clean up XML files os.unlink(rName) os.unlink(bName) diff --git a/tests/test_core/test_core_tools.py b/tests/test_core/test_core_tools.py deleted file mode 100644 index 77faf444..00000000 --- a/tests/test_core/test_core_tools.py +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- -""" -novelWriter – Core Tools Tester -=============================== - -This file is a part of novelWriter -Copyright 2018–2021, Veronica Berglyd Olsen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -""" - -import pytest - -from nw.core.tools import countWords, numberToRoman - -@pytest.mark.core -def testCoreTools_CountWords(): - """Test the word counter and the exclusion filers. - """ - testText = ( - "# Heading One\n" - "## Heading Two\n" - "### Heading Three\n" - "#### Heading Four\n" - "\n" - "@tag: value\n" - "\n" - "% A comment that should n ot be counted.\n" - "\n" - "The first paragraph.\n" - "\n" - "The second paragraph.\n" - "\n" - "\n" - "The third paragraph.\n" - "\n" - "Dashes\u2013and even longer\u2014dashes." - ) - cC, wC, pC = countWords(testText) - - assert cC == 138 - assert wC == 22 - assert pC == 4 - -# END Test testCoreTools_CountWords - -@pytest.mark.core -def testCoreTools_RomanNumbers(): - """Test conversion of integers to Roman numbers. - """ - assert numberToRoman(None, False) == "NAN" - assert numberToRoman(0, False) == "OOR" - assert numberToRoman(1, False) == "I" - assert numberToRoman(2, False) == "II" - assert numberToRoman(3, False) == "III" - assert numberToRoman(4, False) == "IV" - assert numberToRoman(5, False) == "V" - assert numberToRoman(6, False) == "VI" - assert numberToRoman(7, False) == "VII" - assert numberToRoman(8, False) == "VIII" - assert numberToRoman(9, False) == "IX" - assert numberToRoman(10, False) == "X" - assert numberToRoman(14, False) == "XIV" - assert numberToRoman(42, False) == "XLII" - assert numberToRoman(99, False) == "XCIX" - assert numberToRoman(142, False) == "CXLII" - assert numberToRoman(542, False) == "DXLII" - assert numberToRoman(999, False) == "CMXCIX" - assert numberToRoman(2010, False) == "MMX" - assert numberToRoman(999, True) == "cmxcix" - -# END Test testCoreTools_RomanNumbers