diff --git a/i18n/nw_pt.ts b/i18n/nw_pt.ts index 3db2af43..70234b08 100644 --- a/i18n/nw_pt.ts +++ b/i18n/nw_pt.ts @@ -1,49 +1,308 @@ - + + + + Constant + + + None + Nenhum + + + + Novel + Livro + + + + Plot + Enredo + + + + Characters + + + + + Locations + + + + + Timeline + + + + + Objects + + + + + Entity + + + + + Custom + + + + + Outtakes + + + + + Trash + Lixeira + + + + Title Page + Página de Título + + + + Book + + + + + Plain Page + + + + + Partition + + + + + Unnumbered + Sem Numeração + + + + Chapter + Capítulo + + + + Scene + Cena + + + + Note + Nota + + + + Tag + + + + + Point of View + + + + + Focus + + + + + Entities + + + + + Title + Título + + + + Level + + + + + Document + Documento + + + + Line + + + + + Chars + + + + + Words + Palavras + + + + Pars + + + + + POV + P.V. + + + + Synopsis + Sinopse + + + + Straight single quotation mark + + + + + Straight double quotation mark + + + + + Left single quotation mark + + + + + Right single quotation mark + + + + + Single low-9 quotation mark + + + + + Single high-reversed-9 quotation mark + + + + + Left double quotation mark + + + + + Right double quotation mark + + + + + Double low-9 quotation mark + + + + + Double high-reversed-9 quotation mark + + + + + Double low-reversed-9 quotation mark + + + + + Single left-pointing angle quotation mark + + + + + Single right-pointing angle quotation mark + + + + + Left-pointing double angle quotation mark + + + + + Right-pointing double angle quotation mark + + + + + Left corner bracket + + + + + Right corner bracket + + + + + Left white corner bracket + + + + + Right white corner bracket + + + GuiAbout - + About novelWriter Sobre o novelWriter - + 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 é um editor de texto som sintaxe semelhante ao markdown, projetado para a escrita e organização de livros. É escrito em Python 3 com interface de usuário em Qr5, usando PyQt5. - + 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 é distribuído na especativa de que seja útil, mas SEM NENHUMA GARANTIA, nem mesmo a garantia implícita de COMERCIALIZAÇÃO ou ADEQUAÇÃO PARA UM PROPÓSITO ESPECÍFICO. - + Credits Créditos - + 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 é um software livre: você pode redistribuí-lo e/ou modificá-lo sob os termos da GNU Licença Pública Geral, assim como publicada pela Free Software Foundation, tanto na versão 3 da licença, ou (à sua escolha) qualquer versão subsequente. - + Theme: {0} Tema: {0} - + Icons: {0} Ícones: {0} - + Syntax: {0} Sintaxe: {0} - + Website: {0} Website: {0} @@ -58,7 +317,7 @@ Lançamento - + See the License tab for the full license text, or visit the GNU website at {0} for more details. Veja a aba de Licença para o texto completo de licença, ou visite o website da GNU em {0} para mais detalhes. @@ -73,17 +332,17 @@ Licença - + Author: {0} Autor: {0} - + Credit: {0} Créditos: {0} - + License: {0} Licença: {0} @@ -424,7 +683,7 @@ GuiBuildNovelDocView - + Unknown Desconhecido @@ -434,7 +693,7 @@ Esta área vai mostrar o conteúdo do documento a ser exportado ou impresso. Clique no botão "Construir Prévia" para gerar o conteúdo. - + <b>Build Time:</b> {0} <b>Tempo de Construção:</b> {0} @@ -1002,16 +1261,6 @@ 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. Nota: Se o programa ou o computador sofreu uma falha anteriormente, o bloqueio pode ser sobrescrito com segurança. Se, no entanto, outra instância do novelWriter esteja com o projeto aberto, sobrescrever o bloqueio pode corromper o projeto e não é recomendado. - - - Text files - Arquivos de texto - - - - novelWriter files - Arquivos do novelWriter - Unknown item @@ -1092,16 +1341,6 @@ Project Locked Projeto Bloqueado - - - Markdown files - Arquivos Markdown - - - - All files - Todos os Arquivos - Import File @@ -1147,11 +1386,6 @@ Do you want to exit novelWriter? Você deseja realmente sair do novelWriter? - - - {0} ({1}) - - Indexing completed in {0} ms @@ -1197,6 +1431,26 @@ Indexing: '{0}' Indexando: '{0}' + + + Text files ({0}) + + + + + Markdown files ({0}) + + + + + novelWriter files ({0}) + + + + + All files ({0}) + + GuiMainMenu @@ -1747,7 +2001,7 @@ - Find and replace next occurrence text in document + Find and replace next occurrence of text in document Procura e substitui a próxima ocorrência do texto no documento @@ -2370,50 +2624,65 @@ GuiOutlineDetails - + Title Título - + Document Documento - + Status Estado - + Characters Caracteres - + Words Palavras - + Paragraphs Parágrafos - + Synopsis Sinopse - + Title Details Detalhes do Título - + Reference Tags Referências das Etiquetas + + + Chapter + Capítulo + + + + Scene + Cena + + + + Section + Seção + GuiOutlineHeaderMenu @@ -2479,117 +2748,117 @@ GuiPreferencesAutomation - + Automatic Features Funcionalidades Automáticas - + Auto-select word under cursor Selecionar automaticamente a palavra sob o cursor - + Apply formatting to word under cursor if no selection is made. Aplicar a formatação à palavra sob o cursor se nenhuma seleção for feita. - + Auto-replace text as you type Substituir automaticamente o texto enquanto digita - + Allow the editor to replace symbols as you type. Permite que o editor substituia símbolos emquanto você digita. - + Replace as You Type Substituição Durante a Digitação - + Auto-replace single quotes Substituir automaticamente aspas simples - + Try to guess which is an opening or a closing single quote. Tenta adivinhar se a aspa simples é de abertura ou de fechamento. - + Auto-replace double quotes Subsitituir automaticamente aspas duplas - + Try to guess which is an opening or a closing double quote. Tenta adivinhar se a aspa dupla é de abertura ou de fechamento. - + Auto-replace dashes Substituir automaticamente os travessões - + Double and triple hyphens become short and long dashes. Hífens duplos ou triplos se tornam travessões curtos ou longos. - + Auto-replace dots Substituir automaticamente os pontos - + Three consecutive dots become ellipsis. Três pontos consecutivos se tornam uma reticência. - + Quotation Style Estilo de Aspas - + Single quote open style Estilo da aspa de abertura simples - + The symbol to use for a leading single quote. O símbolo usado para a aspa simples à esquerda. - + Single quote close style Estilo da aspa de fechamento simples - + The symbol to use for a trailing single quote. O símbolo usado para a aspa simples à esquerda. - + Double quote open style Estilo da aspa de abertura dupla - + The symbol to use for a leading double quote. O símbolo usado para a aspa dupla à esquerda. - + Double quote close style Estilo da aspa de fechamento dupla - + The symbol to use for a trailing double quote. O símbolo usado para a aspa dupla à direita. @@ -2597,230 +2866,235 @@ GuiPreferencesDocuments - + Text Style Estilo do Texto - + Font family Família da fonte - + Font for the document editor and viewer. Fonte para o editor e visualizador de documentos. - + Font size Tamanho da fonte - + Font size for the document editor and viewer. Tamanho da fonte para o editor e visualizador de documentos. - + Text Flow Fluxo do Texto - + Maximum text width in "Normal Mode" Largura máxima do texto no "Modo Normal" - + Horizontal margins are scaled automatically. Margens horizontais são redimensionadas automaticamente. - + Maximum text width in "Focus Mode" Largura máxima do texto no "Modo Foco" - + Disable maximum text width in "Normal Mode" Desabilita a largura máxima do texto no "Modo Normal" - + Text width is defined by the margins only. A largura do texto é definida apenas pelas margens. - + Hide document footer in "Focus Mode" Oculta o rodapé do documento no "Modo Foco" - + Hide the information bar at the bottom of the document. Oculta a barra de informações na parte de baixo do documento. - + Justify the text margins in editor and viewer Justifica as margens do texto no editor e visualizador - + Lay out text with straight edges in the editor and viewer. Organiza o texto com cantos retos no editor e visualizador. - + Text margin Margem do texto - + If maximum width is set, this becomes the minimum margin. Se a largura máxima for definida, esta se torna a margem mínima. - + Tab width Largura da tabulação - + The width of a tab key press in the editor and viewer. A largura de uma tabulação no editor e visualizador. - + px px + + + pt + + GuiPreferencesEditor - + Spell Checking Correção Ortográfica - + Internal Interno - + Spell check provider Provedor de correção ortográfica - + Note that the internal spell check tool is quite slow. Note que o corretor ortográfico interno é significativamente lento. - + Spell check language Idioma do corretor ortográfico - + Available languages are determined by your system. Os idiomas disponíveis são determinados pelo seu sistema. - + Big document limit Limite de documento grande - + Full spell checking is disabled above this limit. A verificação ortográfica é desabilitada acima desse limite. - + Writing Guides Guias de Escrita - + Show tabs and spaces Mostrar tabulações e espaços - + Add symbols to indicate tabs and spaces in the editor. Adiciona símbolos para indicar tabulações e espaços no editor. - + Show line endings Mostrar terminações de linha - + Add a symbol to indicate line endings in the editor. Adiciona um símbolo para indicar a terminação de linha no editor. - + Scroll Behaviour Comportamento da Rolagem - + Scroll past end of the document Rolar após o final do documento - + Also improves trypewriter scrolling for short documents. Também melhora a rolagem de máquina de escrever em documentos curtos. - + Typewriter style scrolling when you type Rolagem no estilo de máquina de escrever quando digita - + Try to keep the cursor at a fixed vertical position. Tenta manter o cursor em uma posição vertical fixa. - + Minimum position for Typewriter scrolling Posição máxima da rolagem de máquina de escrever - + Percentage of the editor height from the top. Porcentagem da altura do editor desde o topo. - + kB kB - + Word Count Contagem de Palavras - + Word count interval Intervalo de contagem de palavras - + How often the word count is updated. Com qual frequência a contagem de palavras é atualizada. - + seconds segundos @@ -2897,6 +3171,11 @@ Hide horizontal scroll bars in main windows Ocultar a barra de rolagem horizontal nas janelas principais + + + pt + + GuiPreferencesProjects @@ -3009,67 +3288,67 @@ GuiPreferencesSyntax - + Highlighting Theme Tema do Destaque - + Highlighting theme Tema do destaque - + Colour theme to apply to the editor and viewer. Tema de cores para aplicar ao editor e visualizador. - + Quotes & Dialogue Citações e Diálogos - + Highlight text wrapped in quotes Destaca o texto em citações - + Applies to single, double and straight quotes. Aplica-se a citações com aspas simples, duplas e retas. - + Allow open-ended single quotes Permite citações com aspas simples sem fechamento - + Highlight single-quoted line with no closing quote. Destaca a linha com citação de aspas simples sem aspas de fechamento. - + Allow open-ended double quotes Permite citações com aspas duplas sem fechamento - + Highlight double-quoted line with no closing quote. Destaca a linha com citação de aspas duplas sem aspas de fechamento. - + Text Emphasis Ênfase de Texto - + Add highlight colour to emphasised text Adiciona destaque de cor ao texto enfatizado - + Applies to emphasis (italic) and strong (bold). Aplica-se à ênfase (itálico) e ênfase forte (negrito). @@ -3269,32 +3548,32 @@ GuiProjectEditReplace - + Keyword Palavra-chave - + Replace With Substituir Com - + Save entry Salvar entrada - + Add new entry Adiciona uma nova entrada - + Delete selected entry Remove a entrada selecionada - + Text Replace List for Preview and Export Lista de Substituição de Texto para o Preview ou Exportação @@ -3317,7 +3596,7 @@ Níves de Importância do Arquivo do Livro - + New Item Novo Item @@ -3347,12 +3626,12 @@ Selecione a Cor - + Cannot delete status item that is in use. Não é possível remover um item de status que estja em uso. - + {0} [{1}] @@ -3360,15 +3639,10 @@ GuiProjectLoad - + novelWriter Project File ({0}) Arquivo de Projeto do novelWriter ({0}) - - - All Files (*.*) - Todos os Arquivos (*.*) - Open Project @@ -3405,7 +3679,7 @@ Novo - + Open novelWriter Project Abrir um Projeto do novelWriter @@ -3434,6 +3708,11 @@ Cancel Cancelar + + + All files ({0}) + + GuiProjectSettings @@ -3872,29 +4151,24 @@ - Opened Document - Documento Aberto + Opened Document: {0} + Documento Aberto: {0} - + Could not save document. Não foi possível salvar o documento. - - Saved Document - Documento Salvo + + Saved Document: {0} + Documento Salvo: {0} - + Could not delete document file. Não foi possível remover o arquivo do documento. - - - {0}: {1} - - NWErrorMessage @@ -4211,74 +4485,79 @@ By Por + + + and + + ProjWizardCustomPage - + Custom Project Options Opções Personalizadas do Projeto - + 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. Selecione quais diretórios-raiz adicionais criar e como popular o diretório do livro. Se você não quiser adicionar capítulos ou cenas, deixe os valores em 0. Você pode adicionar cenas sem capítulos. - + Additional Root Folders Diretórios-raiz adicionais - + Populate Novel Folder Popular Diretório do Livro - + Add chapters Adicionar capítulos - + Scenes (per chapter) Cenas (por capítulo) - + Add chapter folders Adicionar diretórios de capítulo - + {0} folder - diretório {0} + Diretório {0} ProjWizardFinalPage - + Finished Finalizado - + All done. Tudo pronto. - + Done Pronto - + Finish Terminar - + Press '{0}' to create the new project. Pressione '{0}' para criar um novo projeto. @@ -4286,22 +4565,22 @@ ProjWizardFolderPage - + Select Project Folder Selecione o Diretório do Projeto - + Select a location to store the project. A new project folder will be created in the selected location. Selecione o local para armazenar o projeto. Um novo diretório será criado para o projeto no local selecionado. - + Required Obrigatório - + Project Path Caminho do projeto @@ -4314,7 +4593,7 @@ Forneça pelo menos um nome de projeto. O nome do projeto não poderá ser modificado após esse ponto pois é utilizado pela aplicação para a geração de nomes de arquivos e para cópias de segurança. Os outros campos são opcionais e podem ser modificados a qualquer momento nas Configurações do Projeto. - + Side image by {0}, {1} Imagem ao lado por {0}, {1} @@ -4324,32 +4603,32 @@ Criar um Projeto Novo - + Required Obrigatório - + Optional Opcional - + Optional. One name per line. Opcional. Um nome por linha. - + Working Title Nome do projeto - + Novel Title Nome do Livro - + Author(s) Autor(es) @@ -4357,27 +4636,27 @@ ProjWizardPopulatePage - + Populate Project Popular o Projeto - + 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. Escolha como pré-popular o projeto. escolha entre um conjunto mínimo de items iniciais, um projeto de exemplo explicando e mostrando várias das funcionalidades ou escolha opções personalizadas na próxima página. - + Fill the project with a minimal set of items Popular o projeto com um conjunto mínimo de items - + Fill the project with example files Popular o projeto com arquivos de exemplo - + Show detailed options for filling the project Mostrar opções detalhadas para popular o projeto @@ -4402,11 +4681,6 @@ Notes Notas - - - Document '{0}' is too big ({1}). Skipping. - O documento '{0}' é muito grande ({1}). Ignorando. - ERROR @@ -4427,5 +4701,10 @@ Comment Comentário + + + Document '{0}' is too big ({1} MB). Skipping. + O documento '{0}' é muito grande ({1} MB). Ignorando. + diff --git a/nw/constants/constants.py b/nw/constants/constants.py index 2135dce4..9f17bae5 100644 --- a/nw/constants/constants.py +++ b/nw/constants/constants.py @@ -24,8 +24,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ -from PyQt5.QtCore import QCoreApplication -from PyQt5.QtCore import QT_TRANSLATE_NOOP as QT_TRN +from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP from nw.constants.enum import ( nwItemClass, nwItemLayout, nwItemType, nwOutline @@ -127,17 +126,17 @@ class nwKeyWords: class nwLabels(): CLASS_NAME = { - nwItemClass.NO_CLASS : QT_TRN("Constant", "None"), - nwItemClass.NOVEL : QT_TRN("Constant", "Novel"), - nwItemClass.PLOT : QT_TRN("Constant", "Plot"), - nwItemClass.CHARACTER : QT_TRN("Constant", "Characters"), - nwItemClass.WORLD : QT_TRN("Constant", "Locations"), - nwItemClass.TIMELINE : QT_TRN("Constant", "Timeline"), - nwItemClass.OBJECT : QT_TRN("Constant", "Objects"), - nwItemClass.ENTITY : QT_TRN("Constant", "Entity"), - nwItemClass.CUSTOM : QT_TRN("Constant", "Custom"), - nwItemClass.ARCHIVE : QT_TRN("Constant", "Outtakes"), - nwItemClass.TRASH : QT_TRN("Constant", "Trash"), + nwItemClass.NO_CLASS : QT_TRANSLATE_NOOP("Constant", "None"), + nwItemClass.NOVEL : QT_TRANSLATE_NOOP("Constant", "Novel"), + nwItemClass.PLOT : QT_TRANSLATE_NOOP("Constant", "Plot"), + nwItemClass.CHARACTER : QT_TRANSLATE_NOOP("Constant", "Characters"), + nwItemClass.WORLD : QT_TRANSLATE_NOOP("Constant", "Locations"), + nwItemClass.TIMELINE : QT_TRANSLATE_NOOP("Constant", "Timeline"), + nwItemClass.OBJECT : QT_TRANSLATE_NOOP("Constant", "Objects"), + nwItemClass.ENTITY : QT_TRANSLATE_NOOP("Constant", "Entity"), + nwItemClass.CUSTOM : QT_TRANSLATE_NOOP("Constant", "Custom"), + nwItemClass.ARCHIVE : QT_TRANSLATE_NOOP("Constant", "Outtakes"), + nwItemClass.TRASH : QT_TRANSLATE_NOOP("Constant", "Trash"), } CLASS_FLAG = { nwItemClass.NO_CLASS : "0", @@ -166,15 +165,15 @@ class nwLabels(): nwItemClass.TRASH : "cls_trash", } LAYOUT_NAME = { - nwItemLayout.NO_LAYOUT : QT_TRN("Constant", "None"), - nwItemLayout.TITLE : QT_TRN("Constant", "Title Page"), - nwItemLayout.BOOK : QT_TRN("Constant", "Book"), - nwItemLayout.PAGE : QT_TRN("Constant", "Plain Page"), - nwItemLayout.PARTITION : QT_TRN("Constant", "Partition"), - nwItemLayout.UNNUMBERED : QT_TRN("Constant", "Unnumbered"), - nwItemLayout.CHAPTER : QT_TRN("Constant", "Chapter"), - nwItemLayout.SCENE : QT_TRN("Constant", "Scene"), - nwItemLayout.NOTE : QT_TRN("Constant", "Note"), + nwItemLayout.NO_LAYOUT : QT_TRANSLATE_NOOP("Constant", "None"), + nwItemLayout.TITLE : QT_TRANSLATE_NOOP("Constant", "Title Page"), + nwItemLayout.BOOK : QT_TRANSLATE_NOOP("Constant", "Book"), + nwItemLayout.PAGE : QT_TRANSLATE_NOOP("Constant", "Plain Page"), + nwItemLayout.PARTITION : QT_TRANSLATE_NOOP("Constant", "Partition"), + nwItemLayout.UNNUMBERED : QT_TRANSLATE_NOOP("Constant", "Unnumbered"), + nwItemLayout.CHAPTER : QT_TRANSLATE_NOOP("Constant", "Chapter"), + nwItemLayout.SCENE : QT_TRANSLATE_NOOP("Constant", "Scene"), + nwItemLayout.NOTE : QT_TRANSLATE_NOOP("Constant", "Note"), } LAYOUT_FLAG = { nwItemLayout.NO_LAYOUT : "Xo", @@ -188,27 +187,27 @@ class nwLabels(): nwItemLayout.NOTE : "Nt", } KEY_NAME = { - nwKeyWords.TAG_KEY : QT_TRN("Constant", "Tag"), - nwKeyWords.POV_KEY : QT_TRN("Constant", "Point of View"), - nwKeyWords.FOCUS_KEY : QT_TRN("Constant", "Focus"), - nwKeyWords.CHAR_KEY : QT_TRN("Constant", "Characters"), - nwKeyWords.PLOT_KEY : QT_TRN("Constant", "Plot"), - nwKeyWords.TIME_KEY : QT_TRN("Constant", "Timeline"), - nwKeyWords.WORLD_KEY : QT_TRN("Constant", "Locations"), - nwKeyWords.OBJECT_KEY : QT_TRN("Constant", "Objects"), - nwKeyWords.ENTITY_KEY : QT_TRN("Constant", "Entities"), - nwKeyWords.CUSTOM_KEY : QT_TRN("Constant", "Custom"), + nwKeyWords.TAG_KEY : QT_TRANSLATE_NOOP("Constant", "Tag"), + nwKeyWords.POV_KEY : QT_TRANSLATE_NOOP("Constant", "Point of View"), + nwKeyWords.FOCUS_KEY : QT_TRANSLATE_NOOP("Constant", "Focus"), + nwKeyWords.CHAR_KEY : QT_TRANSLATE_NOOP("Constant", "Characters"), + nwKeyWords.PLOT_KEY : QT_TRANSLATE_NOOP("Constant", "Plot"), + nwKeyWords.TIME_KEY : QT_TRANSLATE_NOOP("Constant", "Timeline"), + nwKeyWords.WORLD_KEY : QT_TRANSLATE_NOOP("Constant", "Locations"), + nwKeyWords.OBJECT_KEY : QT_TRANSLATE_NOOP("Constant", "Objects"), + nwKeyWords.ENTITY_KEY : QT_TRANSLATE_NOOP("Constant", "Entities"), + nwKeyWords.CUSTOM_KEY : QT_TRANSLATE_NOOP("Constant", "Custom"), } OUTLINE_COLS = { - nwOutline.TITLE : QT_TRN("Constant", "Title"), - nwOutline.LEVEL : QT_TRN("Constant", "Level"), - nwOutline.LABEL : QT_TRN("Constant", "Document"), - nwOutline.LINE : QT_TRN("Constant", "Line"), - nwOutline.CCOUNT : QT_TRN("Constant", "Chars"), - nwOutline.WCOUNT : QT_TRN("Constant", "Words"), - nwOutline.PCOUNT : QT_TRN("Constant", "Pars"), - nwOutline.POV : QT_TRN("Constant", "POV"), - nwOutline.FOCUS : QT_TRN("Constant", "Focus"), + nwOutline.TITLE : QT_TRANSLATE_NOOP("Constant", "Title"), + nwOutline.LEVEL : QT_TRANSLATE_NOOP("Constant", "Level"), + nwOutline.LABEL : QT_TRANSLATE_NOOP("Constant", "Document"), + nwOutline.LINE : QT_TRANSLATE_NOOP("Constant", "Line"), + nwOutline.CCOUNT : QT_TRANSLATE_NOOP("Constant", "Chars"), + nwOutline.WCOUNT : QT_TRANSLATE_NOOP("Constant", "Words"), + nwOutline.PCOUNT : QT_TRANSLATE_NOOP("Constant", "Pars"), + nwOutline.POV : QT_TRANSLATE_NOOP("Constant", "POV"), + nwOutline.FOCUS : QT_TRANSLATE_NOOP("Constant", "Focus"), nwOutline.CHAR : KEY_NAME[nwKeyWords.CHAR_KEY], nwOutline.PLOT : KEY_NAME[nwKeyWords.PLOT_KEY], nwOutline.TIME : KEY_NAME[nwKeyWords.TIME_KEY], @@ -216,7 +215,7 @@ class nwLabels(): nwOutline.OBJECT : KEY_NAME[nwKeyWords.OBJECT_KEY], nwOutline.ENTITY : KEY_NAME[nwKeyWords.ENTITY_KEY], nwOutline.CUSTOM : KEY_NAME[nwKeyWords.CUSTOM_KEY], - nwOutline.SYNOP : QT_TRN("Constant", "Synopsis"), + nwOutline.SYNOP : QT_TRANSLATE_NOOP("Constant", "Synopsis"), } # END Class nwLabels @@ -226,28 +225,28 @@ class nwQuotes(): Source: https://en.wikipedia.org/wiki/Quotation_mark """ SYMBOLS = { - "\u0027" : QT_TRN("Constant", "Straight single quotation mark"), - "\u0022" : QT_TRN("Constant", "Straight double quotation mark"), + "\u0027" : QT_TRANSLATE_NOOP("Constant", "Straight single quotation mark"), + "\u0022" : QT_TRANSLATE_NOOP("Constant", "Straight double quotation mark"), - "\u2018" : QT_TRN("Constant", "Left single quotation mark"), - "\u2019" : QT_TRN("Constant", "Right single quotation mark"), - "\u201a" : QT_TRN("Constant", "Single low-9 quotation mark"), - "\u201b" : QT_TRN("Constant", "Single high-reversed-9 quotation mark"), - "\u201c" : QT_TRN("Constant", "Left double quotation mark"), - "\u201d" : QT_TRN("Constant", "Right double quotation mark"), - "\u201e" : QT_TRN("Constant", "Double low-9 quotation mark"), - "\u201f" : QT_TRN("Constant", "Double high-reversed-9 quotation mark"), - "\u2e42" : QT_TRN("Constant", "Double low-reversed-9 quotation mark"), + "\u2018" : QT_TRANSLATE_NOOP("Constant", "Left single quotation mark"), + "\u2019" : QT_TRANSLATE_NOOP("Constant", "Right single quotation mark"), + "\u201a" : QT_TRANSLATE_NOOP("Constant", "Single low-9 quotation mark"), + "\u201b" : QT_TRANSLATE_NOOP("Constant", "Single high-reversed-9 quotation mark"), + "\u201c" : QT_TRANSLATE_NOOP("Constant", "Left double quotation mark"), + "\u201d" : QT_TRANSLATE_NOOP("Constant", "Right double quotation mark"), + "\u201e" : QT_TRANSLATE_NOOP("Constant", "Double low-9 quotation mark"), + "\u201f" : QT_TRANSLATE_NOOP("Constant", "Double high-reversed-9 quotation mark"), + "\u2e42" : QT_TRANSLATE_NOOP("Constant", "Double low-reversed-9 quotation mark"), - "\u2039" : QT_TRN("Constant", "Single left-pointing angle quotation mark"), - "\u203a" : QT_TRN("Constant", "Single right-pointing angle quotation mark"), - "\u00ab" : QT_TRN("Constant", "Left-pointing double angle quotation mark"), - "\u00bb" : QT_TRN("Constant", "Right-pointing double angle quotation mark"), + "\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"), - "\u300c" : QT_TRN("Constant", "Left corner bracket"), - "\u300d" : QT_TRN("Constant", "Right corner bracket"), - "\u300e" : QT_TRN("Constant", "Left white corner bracket"), - "\u300f" : QT_TRN("Constant", "Right white corner bracket"), + "\u300c" : QT_TRANSLATE_NOOP("Constant", "Left corner bracket"), + "\u300d" : QT_TRANSLATE_NOOP("Constant", "Right corner bracket"), + "\u300e" : QT_TRANSLATE_NOOP("Constant", "Left white corner bracket"), + "\u300f" : QT_TRANSLATE_NOOP("Constant", "Right white corner bracket"), } # END Class nwQuotes diff --git a/nw/core/document.py b/nw/core/document.py index 550cc943..d0c3f664 100644 --- a/nw/core/document.py +++ b/nw/core/document.py @@ -130,9 +130,7 @@ class NWDoc(): if showStatus and not isOrphan: self.theParent.setStatus( - self.tr("{0}: {1}").format( - self.tr("Opened Document"), self._theItem.itemName - ) + self.tr("Opened Document: {0}").format(self._theItem.itemName) ) return theText @@ -178,9 +176,7 @@ class NWDoc(): if self._theItem is not None: self.theParent.setStatus( - self.tr("{0}: {1}").format( - self.tr("Saved Document"), self._theItem.itemName - ) + self.tr("Saved Document: {0}").format(self._theItem.itemName) ) return True diff --git a/nw/core/project.py b/nw/core/project.py index 7ae4e096..7d70b39a 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -1156,8 +1156,8 @@ class NWProject(): if nAuth == 1: authString = self.bookAuthors[0] elif nAuth > 1: - authString = "%s and %s" % ( - ", ".join(self.bookAuthors[0:-1]), self.bookAuthors[-1] + authString = "%s %s %s" % ( + ", ".join(self.bookAuthors[0:-1]), self.tr("and"), self.bookAuthors[-1] ) return authString diff --git a/nw/core/tokenizer.py b/nw/core/tokenizer.py index da95a147..a830ca9d 100644 --- a/nw/core/tokenizer.py +++ b/nw/core/tokenizer.py @@ -292,8 +292,8 @@ class Tokenizer(): docSize = len(self.theText) if docSize > nwConst.MAX_DOCSIZE: - errVal = self.tr("Document '{0}' is too big ({1}). Skipping.").format( - self.theItem.itemName, f"{docSize/1.0e6:.2f} MB" + errVal = self.tr("Document '{0}' is too big ({1} MB). Skipping.").format( + self.theItem.itemName, f"{docSize/1.0e6:.2f}" ) self.theText = "# %s\n\n%s\n\n" % (self.tr("ERROR"), errVal) self.errData.append(errVal) diff --git a/nw/core/tree.py b/nw/core/tree.py index 12503cc6..5fdc55ba 100644 --- a/nw/core/tree.py +++ b/nw/core/tree.py @@ -28,9 +28,9 @@ import nw import logging import os -from time import time from lxml import etree from hashlib import sha256 +from time import time from nw.core.item import NWItem from nw.common import checkHandle @@ -199,7 +199,7 @@ class NWTree(): outFile.write("=================\n") outFile.write("\n") outFile.write("%-25s %-9s %-10s %s\n" % ( - "File Name", "Class", "Layout", "Document Label", + "File Name", "Class", "Layout", "Document Label" )) outFile.write("-"*tocLen + "\n") outFile.write("\n".join(tocList)) diff --git a/nw/gui/about.py b/nw/gui/about.py index 000e2d02..685621d3 100644 --- a/nw/gui/about.py +++ b/nw/gui/about.py @@ -133,42 +133,44 @@ class GuiAbout(QDialog): """Generate the content for the About page. """ listPrefix = "  •  " - aboutMsg = "".join([ - "

%s

" % self.tr("About novelWriter"), - "

{copyright:s}.

", - "

%s

" % self.tr( - "Website: {0}".format("{domain:s}") - ), - "

%s

" % self.tr( + webLink = f"{nw.__domain__:s}" + aboutMsg = ( + "

{title1}

" + "

{copyright}.

" + "

{website}

" + "

{intro}

" + "

{license1}

" + "

{license2}

" + "

{license3}

" + "

{title2}

" + "

{credits}

" + ).format( + title1 = self.tr("About novelWriter"), + copyright = nw.__copyright__, + website = self.tr("Website: {0}").format(webLink), + title2 = self.tr("Credits"), + credits = "
".join(["%s%s" % (listPrefix, x) for x in nw.__credits__]), + intro = self.tr( "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." ), - "

%s

" % self.tr( + license1 = self.tr( "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." ), - "

%s

" % self.tr( + license2 = self.tr( "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." ), - "

%s

" % ( - self.tr( - "See the License tab for the full license text, or visit the " - "GNU website at {0} for more details." - ).format( - "GPL v3.0" - ) + license3 = self.tr( + "See the License tab for the full license text, or visit the " + "GNU website at {0} for more details." + ).format( + "GPL v3.0" ), - "

%s

" % self.tr("Credits"), - "

{credits:s}

", - ]).format( - copyright = nw.__copyright__, - website = nw.__url__, - domain = nw.__domain__, - credits = "
".join(["%s%s" % (listPrefix, x) for x in nw.__credits__]), ) theTheme = self.theParent.theTheme diff --git a/nw/gui/build.py b/nw/gui/build.py index 800a493b..95bd2c40 100644 --- a/nw/gui/build.py +++ b/nw/gui/build.py @@ -986,7 +986,7 @@ class GuiBuildNovel(QDialog): # Report to user if wSuccess: self.theParent.makeAlert( - "%s
%s" % ( + "%s
%s" % ( self.tr("{0} file successfully written to:").format(textFmt), savePath ), nwAlert.INFO @@ -1189,13 +1189,11 @@ class GuiBuildNovelDocView(QTextBrowser): self.qDocument = self.document() self.qDocument.setDocumentMargin(self.mainConf.getTextMargin()) - self.setPlaceholderText( - self.tr( - "This area will show the content of the document to be " - "exported or printed. Press the \"Build Preview\" button " - "to generate content." - ) - ) + self.setPlaceholderText(self.tr( + "This area will show the content of the document to be " + "exported or printed. Press the \"Build Preview\" button " + "to generate content." + )) theFont = QFont() if self.mainConf.textFont is None: @@ -1225,7 +1223,7 @@ class GuiBuildNovelDocView(QTextBrowser): fPx = int(1.1*self.theTheme.fontPixelSize) - self.theTitle = QLabel("") + self.theTitle = QLabel("", self) self.theTitle.setIndent(0) self.theTitle.setAutoFillBackground(True) self.theTitle.setAlignment(Qt.AlignCenter) diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index a108c0d8..dfba6ce1 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -798,7 +798,7 @@ class GuiMainMenu(QMenuBar): # Search > Replace Next self.aReplaceNext = QAction(self.tr("Replace Next"), self) self.aReplaceNext.setStatusTip( - self.tr("Find and replace next occurrence text in document") + self.tr("Find and replace next occurrence of text in document") ) self.aReplaceNext.setShortcut("Ctrl+Shift+1") self.aReplaceNext.triggered.connect(lambda: self._docAction(nwDocAction.REPL_NEXT)) diff --git a/nw/gui/outlinedetails.py b/nw/gui/outlinedetails.py index d5ba010a..8a1bc101 100644 --- a/nw/gui/outlinedetails.py +++ b/nw/gui/outlinedetails.py @@ -27,8 +27,7 @@ along with this program. If not, see . import nw import logging -from PyQt5.QtCore import Qt -from PyQt5.QtCore import QT_TRANSLATE_NOOP as QT_TRN +from PyQt5.QtCore import Qt, QT_TRANSLATE_NOOP from PyQt5.QtWidgets import ( QScrollArea, QWidget, QGridLayout, QHBoxLayout, QGroupBox, QLabel ) @@ -41,10 +40,10 @@ logger = logging.getLogger(__name__) class GuiOutlineDetails(QScrollArea): LVL_MAP = { - "H1" : QT_TRN("GuiOutlineDetails", "Title"), - "H2" : QT_TRN("GuiOutlineDetails", "Chapter"), - "H3" : QT_TRN("GuiOutlineDetails", "Scene"), - "H4" : QT_TRN("GuiOutlineDetails", "Section"), + "H1" : QT_TRANSLATE_NOOP("GuiOutlineDetails", "Title"), + "H2" : QT_TRANSLATE_NOOP("GuiOutlineDetails", "Chapter"), + "H3" : QT_TRANSLATE_NOOP("GuiOutlineDetails", "Scene"), + "H4" : QT_TRANSLATE_NOOP("GuiOutlineDetails", "Section"), } def __init__(self, theParent): diff --git a/nw/gui/preferences.py b/nw/gui/preferences.py index acd0e33a..74a2af90 100644 --- a/nw/gui/preferences.py +++ b/nw/gui/preferences.py @@ -200,7 +200,7 @@ class GuiPreferencesGeneral(QWidget): self.tr("Font size"), self.guiFontSize, self.tr("Changing this requires restarting novelWriter."), - theUnit = "pt" + theUnit = self.tr("pt") ) # GUI Settings @@ -429,7 +429,8 @@ class GuiPreferencesProjects(QWidget): if newDir: self.backupPath = newDir self.mainForm.setHelpText( - self.backupPathRow, self.tr("Path: {0}").format(self.backupPath)) + self.backupPathRow, self.tr("Path: {0}").format(self.backupPath) + ) return True return False @@ -486,7 +487,7 @@ class GuiPreferencesDocuments(QWidget): self.tr("Font size"), self.textSize, self.tr("Font size for the document editor and viewer."), - theUnit = "pt" + theUnit = self.tr("pt") ) # Text Flow diff --git a/nw/gui/projload.py b/nw/gui/projload.py index 2da9be5d..24c40ca2 100644 --- a/nw/gui/projload.py +++ b/nw/gui/projload.py @@ -186,15 +186,15 @@ class GuiProjectLoad(QDialog): """Browse for a folder path. """ logger.verbose("GuiProjectLoad browse button clicked") + extFilter = [ + self.tr("novelWriter Project File ({0})").format(nwFiles.PROJ_FILE), + self.tr("All files ({0})").format("*.*"), + ] dlgOpt = QFileDialog.Options() dlgOpt |= QFileDialog.DontUseNativeDialog projFile, _ = QFileDialog.getOpenFileName( self, self.tr("Open novelWriter Project"), "", - ";;".join([ - self.tr("novelWriter Project File ({0})").format(nwFiles.PROJ_FILE), - self.tr("All Files (*.*)"), - ]), - options=dlgOpt + filter=";;".join(extFilter), options=dlgOpt ) if projFile: thePath = os.path.abspath(os.path.dirname(projFile)) diff --git a/nw/gui/projsettings.py b/nw/gui/projsettings.py index 6c810e4a..39cfe930 100644 --- a/nw/gui/projsettings.py +++ b/nw/gui/projsettings.py @@ -327,9 +327,7 @@ class GuiProjectEditStatus(QWidget): """ if self.selColour is not None: newCol = QColorDialog.getColor( - self.selColour, - self, - self.tr("Select Colour"), + self.selColour, self, self.tr("Select Colour"), QColorDialog.DontUseNativeDialog ) if newCol.isValid(): diff --git a/nw/gui/projwizard.py b/nw/gui/projwizard.py index b53e794c..590a48ab 100644 --- a/nw/gui/projwizard.py +++ b/nw/gui/projwizard.py @@ -95,14 +95,12 @@ class ProjWizardIntroPage(QWizardPage): self.theTheme = theWizard.theTheme self.setTitle(self.tr("Create New Project")) - self.theText = QLabel( - self.tr( - "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." - ) - ) + self.theText = QLabel(self.tr( + "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." + )) self.theText.setWordWrap(True) self.imgCredit = QLabel(self.tr("Side image by {0}, {1}").format( @@ -166,12 +164,10 @@ class ProjWizardFolderPage(QWizardPage): self.theTheme = theWizard.theTheme self.setTitle(self.tr("Select Project Folder")) - self.theText = QLabel( - self.tr( - "Select a location to store the project. A new project folder " - "will be created in the selected location." - ) - ) + self.theText = QLabel(self.tr( + "Select a location to store the project. A new project folder " + "will be created in the selected location." + )) self.theText.setWordWrap(True) xW = self.mainConf.pxInt(300) @@ -242,13 +238,11 @@ class ProjWizardPopulatePage(QWizardPage): self.theWizard = theWizard self.setTitle(self.tr("Populate Project")) - self.theText = QLabel( - self.tr( - "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." - ) - ) + self.theText = QLabel(self.tr( + "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." + )) self.theText.setWordWrap(True) vS = self.mainConf.pxInt(12) @@ -299,13 +293,11 @@ class ProjWizardCustomPage(QWizardPage): self.theWizard = theWizard self.setTitle(self.tr("Custom Project Options")) - self.theText = QLabel( - self.tr( - "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." - ) - ) + self.theText = QLabel(self.tr( + "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." + )) self.theText.setWordWrap(True) vS = self.mainConf.pxInt(12) @@ -419,12 +411,14 @@ class ProjWizardFinalPage(QWizardPage): self.theWizard = theWizard self.setTitle(self.tr("Finished")) - self.theText = QLabel("".join([ - "

%s

" % self.tr("All done."), - "

%s

" % self.tr("Press '{0}' to create the new project.").format( - self.tr("Done") if self.mainConf.osDarwin else self.tr("Finish") + self.theText = QLabel( + "

{done}

{help}

".format( + done = self.tr("All done."), + help = self.tr("Press '{0}' to create the new project.").format( + self.tr("Done") if self.mainConf.osDarwin else self.tr("Finish") + ) ) - ])) + ) self.theText.setWordWrap(True) # Assemble diff --git a/nw/guimain.py b/nw/guimain.py index feb898bc..f059ef16 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -702,10 +702,10 @@ class GuiMain(QMainWindow): lastPath = self.mainConf.lastPath extFilter = [ - self.tr("{0} ({1})").format(self.tr("Text files"), "*.txt"), - self.tr("{0} ({1})").format(self.tr("Markdown files"), "*.md"), - self.tr("{0} ({1})").format(self.tr("novelWriter files"), "*.nwd"), - self.tr("{0} ({1})").format(self.tr("All files"), "*.*"), + self.tr("Text files ({0})").format("*.txt"), + self.tr("Markdown files ({0})").format("*.md"), + self.tr("novelWriter files ({0})").format("*.nwd"), + self.tr("All files ({0})").format("*.*"), ] dlgOpt = QFileDialog.Options() dlgOpt |= QFileDialog.DontUseNativeDialog