From d5bd81667681afff01a993f4ad877996dd860b7f Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:14:04 +0100 Subject: [PATCH] Last round of changes to localisation --- i18n/nw_pt.ts | 1047 +++++++++++++++++++--------------------- novelWriter.pro | 67 ++- nw/core/project.py | 37 +- nw/core/tokenizer.py | 5 +- nw/core/tree.py | 13 +- nw/gui/about.py | 82 +--- nw/gui/build.py | 45 +- nw/gui/doceditor.py | 59 +-- nw/gui/docviewer.py | 8 +- nw/gui/mainmenu.py | 15 +- nw/gui/preferences.py | 4 +- nw/gui/projdetails.py | 4 +- nw/gui/projload.py | 6 +- nw/gui/projsettings.py | 2 +- nw/gui/projwizard.py | 5 +- nw/gui/statusbar.py | 4 +- nw/gui/writingstats.py | 18 +- nw/guimain.py | 19 +- 18 files changed, 634 insertions(+), 806 deletions(-) diff --git a/i18n/nw_pt.ts b/i18n/nw_pt.ts index 2553feac8..3db2af432 100644 --- a/i18n/nw_pt.ts +++ b/i18n/nw_pt.ts @@ -27,40 +27,25 @@ 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. - - - Author - Autor - - - - Credit - Créditos - - - - License - Licença - - Theme - Tema + Theme: {0} + Tema: {0} - - Icons - Ícones + + Icons: {0} + Ícones: {0} - - Syntax - Sintaxe + + Syntax: {0} + Sintaxe: {0} - Website - Website + Website: {0} + Website: {0} @@ -72,73 +57,83 @@ Release Lançamento - - - {0}: {1} - - 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. - - - <b>{0}:</b> {1} - - OK OK + + + License + Licença + + + + Author: {0} + Autor: {0} + + + + Credit: {0} + Créditos: {0} + + + + License: {0} + Licença: {0} + GuiBuildNovel - + Failed to generate preview. The result is too big. A geração do rascunho falhou. O resultado é muito grande. - - Open Document - Abrir Documento + + Open Document (.odt) + Open Document (.odt) - + PDF PDF - + Plain HTML HTML Simples - + Unknown format Formato desconhecido - - novelWriter HTML - HTML do novelWriter + + novelWriter HTML (.htm) + HTML do novelWriter (.htm) - - novelWriter Markdown - Markdown do novelWriter + + novelWriter Markdown (.nwd) + Markdown do novelWriter (.nwd) - + JSON + novelWriter HTML JSON + HTML do novelWriter - - JSON + novelWriters Markdown - JSON + Markdown do novelWriter + + JSON + novelWriters Markdown (.json) + JSON + Markdown do novelWriter (.json) @@ -251,27 +246,22 @@ Imprimir - + Close Fechar - + Save Document As Salvar Documento Como - - {0} ({1}) - Não traduzir - - - + {0} file successfully written to: Arquivo {0} escrito com sucesso para: - + Failed to write {0} file. {1} Falhou para escrever o arquivo {0}. {1} @@ -291,30 +281,25 @@ Imprimir para PDF - - Flat Open Document + + Flat Open Document (.fodt) - - Standard Markdown - Markdown Padrão + + Standard Markdown (.md) + Markdown Padrão (.md) - - GitHub Markdown - Markdown do GitHub + + GitHub Markdown (.md) + Markdown do GitHub (.md) - + There were problems when building the project Houveram problemas ao construir o projeto - - - JSON + novelWriter Markdown - JSON + Markdown do novelWriter - Scene @@ -340,11 +325,6 @@ Replace Unicode in HTML Substituir Unicode no HTML - - - {0}: - - {0} for the title as set in the document @@ -395,64 +375,89 @@ Include files with layout 'Note'. Inclui arquivos com leiaute 'Nota'. - - - GuiBuildNovelDocView - - Build Time - Tempo de Construção + + Formatting Codes: + - - Unknown - Desconhecido + + Save As + Salvar Como - - <b>{0}:</b> {1} + + Open Document - - This area will show the content of the document to be exported or printed. Press the "Build Preview" button to generate content. - 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. + + Flat Open Document + + + + + novelWriter Markdown + Markdown do novelWriter + + + + Standard Markdown + Markdown Padrão + + + + GitHub Markdown + Markdown do GitHub + + + + JSON + novelWriter HTML (.json) + JSON + HTML do novelWriter (.json) + + + + JSON + novelWriter Markdown + JSON + Markdown do novelWriter - GuiDocEditFooter + GuiBuildNovelDocView - - Line - Linha + + Unknown + Desconhecido - - Words - Palavras + + This area will show the content of the document to be exported or printed. Press the "Build Preview" button to generate content. + 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. - - Status - Estado + + <b>Build Time:</b> {0} + <b>Tempo de Construção:</b> {0} + + + GuiDocEditFooter - - {0}: {1} - + + Line: {0} ({1}) + Linha: {0} ({1}) - - {0}: {1} ({2}u202f%%) - + + Words: {0} ({1}) + Palavras: {0} ({1}) - - {0}: {1} ({2}) - + + Status + Estado - + Document size is {0} bytes O tamanho do documento é {0} bytes @@ -460,22 +465,22 @@ GuiDocEditHeader - + Edit document meta Editar os meta-dados do documento - + Search document Procurar no documento - + Toggle Focus Mode Alternar o "Modo Foco" - + Close the document Fechar o documento @@ -483,97 +488,97 @@ GuiDocEditSearch - + Search Pesquisa - + Replace Substituir - + Case Sensitive Diferenciar Maiúsculas e Minúsculas - + Match case Diferencia Maiúsculas e Minúsculas - + Whole Words Only Apenas Palavras Inteiras - + Match whole words Encontra apenas palavras inteiras - + RegEx Mode Expressão Regular - + Loop Search Pesquisa do Início - + Loop the search when reaching the end Pesquisa do início quando chega no final do documento - + Search Next File Busca no Próximo Arquivo - + Continue searching in the next file Continua a busca no próximo arquivo - + Preserve Case Preserva Maiúsculas e Minúsculas - + Preserve case on replace Preserva maiúsculas e minúsculas ao substituir - + Close Search Fechar a Busca - + Show/hide the replace text box Mostrar/Ocultar a caixa substituição - + Find in current document Encontrar no documento atual - + Find and replace in current document Encontrar e substituir no documento atual - + Close the search box [{0}] Fechar a caixa de busca [{0}] - + Search using regular expressions Busca usando expressões regulares @@ -592,24 +597,19 @@ - The document you are trying to open is too big. The document size is {doc_size}. The maximum size allowed is {max_size}. - O documento que você está tentando abrir é muito grande. O tamanho do documento é {doc_size}. O tamanho máximo permitido é {max_size}. + The document you are trying to open is too big. The document size is {0} MB. The maximum size allowed is {1} MB. + O documento que você está tentando abrir é muito grande. O tamanho do documento é {0} MB. O tamanho máximo permitido é {1} MB. - The text you are trying to add is too big. The text size is {text_size}. The maximum size allowed is {max_size}. - O texto que você está tentando adicionar é muito grande. O tamanho do texto é {text_size}. O tamanho máximo permitido é {max_size}. + The text you are trying to add is too big. The text size is {0} MB. The maximum size allowed is {1} MB. + O texto que você está tentando adicionar é muito grande. O tamanho do texto é {0} MB. O tamanho máximo permitido é {1} MB. File Location Localização do Arquivo - - - The document has grown too big and you cannot add more text to it. The maximum size of a single novelWriter document is {max_size}. - O tamanho do documento aumentou muito e você não pode adicionar mais texto nele. O tamanho máximo de um único documento do novelWriter é {max_size}. - Follow Tag @@ -651,25 +651,25 @@ Sugestão de Ortografia - + Add Word to Dictionary Adicionar Palavra ao Dicionário - + Please selection some text before calling replace quotes. Por favor, selecione algum texto antes de invocar a substituição de aspas. - - - {0}u202fMB - - The currently open file is saved in: O arquivo aberto atualmente está salvo em: + + + 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. + O tamanho do documento aumentou muito e você não pode adicionar mais texto nele. O tamanho máximo de um único documento do novelWriter é {0} MB. + GuiDocMerge @@ -815,32 +815,32 @@ Ative para manter o conteúdo do painel de referências quando trocar o documento - + Show comments Mostrar comentários - + Show synopsis comments Mostrar comentários de sinopse - + References Referências - + Sticky Aderente - + Comments Comentários - + Synopsis Sinopse @@ -1013,37 +1013,32 @@ Arquivos do novelWriter - - Indexing - Indexando - - - + Unknown item Item desconhecido - + Information Informação - + Warning Alerta - + Error Erro - + This is a bug! Isto é um bug! - + Internal Error Erro Interno @@ -1078,7 +1073,7 @@ Fechar o projeto atual? - + Changes are saved automatically. As alterações serão salvas automaticamente. @@ -1118,37 +1113,37 @@ Não foi possível ler o arquivo. O arquivo deve ser um arquivo de texto existente. - + Please open a document to import the text file into. Por favor, abra um documento para importar o text nele. - + Import Document Importar Documento - + Importing the file will overwrite the current content of the document. Do you want to proceed? Importar o arquivo vai sobrescrever o conteúdo atual do documento. Você deseja continuar? - + The project index has been successfully rebuilt. O índice do projeto foi reconstruído com sucesso. - + Save novelWriter Project Salvar o Projeto do novelWriter - + Exit Sair - + Do you want to exit novelWriter? Você deseja realmente sair do novelWriter? @@ -1158,17 +1153,7 @@ - - {0}: '{1}' - - - - - {0}: {1} - - - - + Indexing completed in {0} ms Indexação completa em {0} ms @@ -1207,6 +1192,11 @@ The project was locked by the computer '{0}' ({1} {2}), last active on {3}. O projeto foi bloqueado pelo computador '{0}' ({1} {2}), ativo pela última vez em {3}. + + + Indexing: '{0}' + Indexando: '{0}' + GuiMainMenu @@ -1451,612 +1441,612 @@ Divide um documento em um diretório com múltiplos documentos - + &Edit &Editar - + Undo Desfazer - + Undo last change Desfaz a última alteração - + Redo Refazer - + Redo last change Refaz a última alteração - + Cut Recortar - + Cut selected text Recorta o texto selecionado - + Copy Copiar - + Copy selected text Copia o texto selecionado - + Paste Colar - + Paste text from clipboard Cola o texto da área de transferência - + Select All Selecionar Tudo - + Select all text in document Seleciona todo o texto do documento - + Select Paragraph Selecionar Parágrafo - + Select all text in paragraph Seleciona todo o texto do parágrafo - + &View &Visualizar - + Focus Project Tree Árvore do Projeto - + Move focus to project tree Muda o foco para a árvore do projeto - + Focus Document Editor Editor do Documento - + Move focus to left document pane Muda o foco para o editor do documento - + Focus Document Viewer Visualizador do Documento - + Move focus to right document pane Muda o foco para o visualizador do documento - + Go Backward Voltar - + Move backward in the view history of the right pane Volta no histórico do editor do documento - + Go Forward Avançar - + Move forward in the view history of the right pane Avança no histórico do editor do documento - + Focus Mode Modo de Foco - + Toggles a distraction free mode, only showing text editor Alterna o modo livre de distrações, mostrando apenas o editor de texto - + Full Screen Mode Tela Cheia - + Maximises the main window Maximiza a tela principal - + &Insert &Inserir - + Short Dash Travessão Curto - + Long Dash Travessão Longo - + Quote Marks Aspas - + Left Single Quote Aspas Simples à Esquerda - + Insert left single quote Insere aspas simples à esquerda - + Right Single Quote Aspas Simples à Direita - + Insert right single quote Insere aspas simples à direita - + Left Double Quote Aspas Duplas à Esquerda - + Insert left double quote Insere aspas duplas à esquerda - + Right Double Quote Aspas Duplas à Direita - + Insert right double quote Insere aspas duplas à direita - + Alternative Apostrophe Apóstrofo Alternativo - + Breaks and Spaces Quebras e Espaços - + Hard Line Break Quebra Forçada de Linha - + Insert a hard line break Insere uma quebra forçada de linha - + Non-Breaking Space Espaço Não-Separável - + Insert a non-breaking space Insere um espaço não-separável - + Thin Space Espaço Estreito - + Insert a thin space Insere um espaço estreito - + Thin Non-Breaking Space Espaço Estreito Não-Separável - + Insert a thin non-breaking space Insere um espaço estreito não-separável - + Tags and References Etiquetas e Referências - + &Search Pe&squisa - + Find Procurar - + Find text in document Procura o texto no documento - + Replace Substituir - + Replace text in document Substitui o texto no documento - + Find Next Procurar o Próximo - + Find Previous Procurar a Anterior - + Replace Next Substituir o Próximo - + Find and replace next occurrence text in document Procura e substitui a próxima ocorrência do texto no documento - + &Format &Formatar - + Emphasis Ênfase - + Add emphasis to selected text (italic) Adiciona ênfase ao texto selecionado (itálico) - + Strong Emphasis Ênfase Forte - + Add strong emphasis to selected text (bold) Adiciona ênfase forte ao texto selecionado (negrito) - + Strikethrough Tachado - + Add strikethrough to selected text Adiciona taxado ao texto selecionado - + Wrap Double Quotes Aspas Duplas - + Wrap selected text in double quotes Adiciona aspas dupla ao redor do texto selecionado - + Wrap Single Quotes Aspas Simples - + Wrap selected text in single quotes Adiciona aspas simples ao redor do texto selecionado - + Header 1 Cabeçalho 1 - + Change the block format to Header 1 Altera o formato do bloco para cabeçalho nível 1 - + Header 2 Cabeçalho 2 - + Change the block format to Header 2 Altera o formato do bloco para cabeçalho nível 2 - + Header 3 Cabeçalho 3 - + Change the block format to Header 3 Altera o formato do bloco para cabeçalho nível 3 - + Header 4 Cabeçalho 4 - + Change the block format to Header 4 Altera o formato do bloco para cabeçalho nível 4 - + Comment Comentário - + Change the block format to comment Altera o formato do bloco para comentário - + Remove Block Format Limpar Formatação do Bloco - + Strips block format Remove a formatação do bloco - + Replace Single Quotes Substituir Aspas Simples - + Replace all straight single quotes in selected text Substitui todas as aspas simples do texto selecionado - + Replace Double Quotes Substituir Aspas Duplas - + Replace all straight double quotes in selected text Substitui todas as aspas duplas do texto selecionado - + &Tools Ferramen&tas - + Check Spelling Checar Ortografia - + Toggle check spelling Alterna a checagem de ortografia - + Re-Run Spell Check Checar Ortografia Agora - + Run the spell checker on current document Executa a checagem de ortografia no documento atual - + Rebuild Index Reindexar - + Rebuild the tag indices and word counts Reindexa as etiquetas e contagem de palavras - + Rebuild Outline Recriar a Estrutura - + Rebuild the novel outline tree Recria a estrutura do livro - + Auto-Update Outline Recriar a Estrutura Automaticamente - + Update project outline when a novel file is changed Recria a estrutura do projeto quando um arquivo é modificado - + Backup Project Folder Criar Cópia de Segurança do Diretório do Projeto - + Backup Project Cria uma cópia de segurança do diretório do projeto - + Build Novel Project Construir o Projeto do Livro - + Launch the Build novel project tool Inicia a ferramenta de construção do projeto - + Writing Statistics Estatísticas de Escrita - + Show the writing statistics dialog Mostra o diálogo de estatísticas de escrita - + Preferences Preferências - + &Help A&juda - + About novelWriter Sobre o novelWriter - + About Qt5 Sobre o Qt5 - + Documentation (Local) Documentação (Local) - + View local documentation with Qt Assistant Exibe a documentação local com o assistente do Qt - + Documentation (Online) Documentação (Online) - + Report an Issue (GitHub) Reportar um Problema (Github) - + Ask a Question (GitHub) Fazer uma Pergunta (Github) - + Latest Release (GitHub) Última Versão (Github) - + The novelWriter Website Website do novelWriter - + View online documentation at {0} Visualizar a documentação online em {0} - + Report a bug or issue on GitHub at {0} Reportar um bug ou problema no Github em {0} - + Ask a question on GitHub at {0} Perguntar uma dúvida no Github em {0} - + Open the Releases page on GitHub at {0} Abrir a Página de Versões no Github em {0} - + Open the novelWriter website at {0} Abrir o Website do novelWriter em {0} @@ -2081,42 +2071,42 @@ Remove o item de projeto selecionado - + Dashes Travessões - + Insert short dash (en dash) Insere um travessão curto (meia risca) - + Insert long dash (em dash) Inserir um travessão - + Horizontal Bar Barra Horizontal - + Insert a horizontal bar (quotation dash) Insere uma barra horizontal (travessão de fala) - + Figure Dash Travessão de Número - + Insert figure dash (same width as a number character) Insere um travessão de número (mesma largura de um caracter numérico) - + Insert modifier letter single apostrophe Insere um caracter modificado de apóstrofo simples @@ -2161,152 +2151,152 @@ Desfaz a última movimentação de item - + Focus Outline Foco na Estrutura - + Move focus to outline Move o foco para a estrutura - + General Punctuation Pontuação Geral - + Ellipsis Reticências - + Insert ellipsis Insere reticências - + Prime Prime - + Insert a prime symbol Insere um simbolo prime - + Double Prime Prime Duplo - + Insert a double prime symbol Insere um simbolo prime duplo - + Other Symbols Outros Simbolos - + List Bullet Marcador de Lista - + Insert a list bullet Insere um marcador de lista - + Hyphen Bullet Marcador em Hífen - + Insert a hyphen bullet (alternative bullet) Insere um marcador em hífen (marcador alternativo) - + Flower Mark Marcador em Flor - + Insert a flower mark (alternative bullet) Insere um marcador em flor (marcador alternativo) - + Per Mille Por Milha - + Insert a per mille symbol Insere um simbolo de "por milha" - + Degree Symbol Simbolo de Grau - + Insert a degree symbol Insere um simbolo de grau - + Minus Sign Sinal de Menos - + Insert a minus sign (not a hypen or dash) Insere um sinal de menos (não é um hífen nem travessão) - + Times Sign Sinal de Multiplicação - + Insert a times sign (multiplication cross) Insere um sinal de multiplicação (cruz de multiplicação) - + Division Sign Sinal de Divisão - + Insert a division sign Insere um sinal de divisão - + Project Word List Lista de Palavras do Projeto - + Edit the project's word list Editar a lista de palavras do projeto - + Find next occurrence of text in document Encontra a próxima ocorrência do texto no documento - + Find previous occurrence of text in document Encontra a ocorrência anterior do texto no documento @@ -2318,11 +2308,6 @@ None Nenhum - - - Words - Palavras - Editor @@ -2339,14 +2324,14 @@ Tempo de Sessão - + Project word count (session change) Contagem de palavras do projeto (alteradas na sessão) - {0}: {1} ({2}) - + Words: {0} ({1}) + Palavras: {0} ({1}) @@ -2955,16 +2940,6 @@ Backup storage location Localização da cópia de segurança - - - {0}: {1} - - - - - Path - Caminho - Run backup when the project is closed @@ -3025,6 +3000,11 @@ minutes minutos + + + Path: {0} + Caminho: {0} + GuiPreferencesSyntax @@ -3120,67 +3100,67 @@ GuiProjectDetailsContents - + Title Título - + Words Palavras - + Pages Páginas - + Page Página - + Progress Progresso - + Typical word count for a 5 by 8 inch book page with 11 pt font is 350. Contagem de palavras típica para uma página de livro de 5 por 8 polegadas com a fonte de 11 pt é 350. - + Start counting page numbers from this page. Inicia a contagem de numero de páginas à partir dessa página. - + Assume a new chapter or partition always start on an odd numbered page. Assume que um capítulo ou partição sempre começa em uma página com numeração ímpar. - + Words per page Palavras por página - + Count pages from Contar páginas à partir da página - + Clear double pages Eliminar páginas duplas - + Table of Contents Sumário - + END FIM @@ -3188,50 +3168,45 @@ GuiProjectDetailsMain - - {0}: {1} - - - - - Working Title - Nome do projeto - - - + By {0} Por {0} - + Words Palavras - + Chapters Capítulos - + Scenes Cenas - + Revisions Revisões - + Editing Time Tempo de Edição - + Path Caminho + + + Working Title: {0} + Nome do projeto + GuiProjectEditMain @@ -3323,11 +3298,6 @@ Text Replace List for Preview and Export Lista de Substituição de Texto para o Preview ou Exportação - - - <{0}> - - GuiProjectEditStatus @@ -3391,13 +3361,13 @@ GuiProjectLoad - novelWriter Project File - Arquivo de Projeto do novelWriter + novelWriter Project File ({0}) + Arquivo de Projeto do novelWriter ({0}) - All Files - Todos os Arquivos + All Files (*.*) + Todos os Arquivos (*.*) @@ -3440,17 +3410,12 @@ Abrir um Projeto do novelWriter - + Remove Entry Remover Entrada - - {0} ({1}) - - - - + Remove '{0}' from the recent projects list? The project files will not be deleted. Remover {0} da lista de projetos recentes? Os arquivos do projeto não serão removidos. @@ -3753,14 +3718,14 @@ GuiWritingStats - - JSON Data File - Aruivo de Dados JSON + + JSON Data File (.json) + Aruivo de Dados JSON (.json) - - CSV Data File - Arquivo de Dados CSV + + CSV Data File (.csv) + Arquivo de Dados CSV (.csv) @@ -3794,28 +3759,28 @@ - Total Time - Tempo Total + Total Time: + Tempo Total: - Filtered Time - Tempo Filtrado + Filtered Time: + Tempo Filtrado: - Novel Word Count - Contagem de Palavras do Livro + Novel Word Count: + Contagem de Palavras do Livro: - Notes Word Count - Contagem de Palavras das Notas + Notes Word Count: + Contagem de Palavras das Notas: - Total Word Count - Contagem Total de Palavras + Total Word Count: + Contagem Total de Palavras: @@ -3858,25 +3823,15 @@ Salvar Como - + Save Document As Salvar Documento Como - + Failed to read session log file. Houve uma falha ao ler o arquivo de log da sessão. - - - {0}: - - - - - {0} ({1}) - - Close @@ -3889,14 +3844,24 @@ - Idle Time - Tempo Ocioso + Idle Time: + Tempo Ocioso: Show idle time Mostrar tempo ocioso + + + JSON Data File + Aruivo de Dados JSON + + + + CSV Data File + Arquivo de Dados CSV + NWDoc @@ -3991,11 +3956,6 @@ New Project Novo Projeto - - - By - Por - Novel @@ -4072,124 +4032,114 @@ Conflito de Versão - - This project was saved by a newer version of novelWriter, version {new_version}. This is version {version}. 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? - O projeto foi salvo por uma versão mais nova do novelWriter, versão {new_version}. Esta é a versão {version}. Caso deseje continuar a abrir o projeto, alguns atributos e configurações podem não ser preservados, o restante do projeto, porém, deve funcionar. Continuar a abrir o projeto? - - - - Opened Project - Projeto Aberto + + Opened Project: {0} + Projeto Aberto: {0} - + Project path not set, cannot save project. O caminho do projeto não foi definido, não é possível salvar o projeto. - + Failed to save project. Houve uma falha ao salvar o projeto. - - Saved Project - Projeto Salvo + + Saved Project: {0} + Projeto Salvo: {0} - + Backing up project ... Realizando uma cópia de segurança do projeto... - + Cannot backup project because no backup path is set. Please set a valid backup location in Tools > Preferences. Não foi possível realizar uma cópia de segurança do projeto porquê o caminho das cópias de segurança não foi definido. Por favor, defina um caminho válido para as cópias de segurança em Ferramentas > Preferências. - + Cannot backup project because no project name is set. Please set a Working Title in Project > Project Settings. Não foi possível realizar a cópia de segurança do projeto porque o nome do projeto não está definido. Por favor defina o Nome do Projeto em Projeto > Configurações do Projeto. - + Cannot backup project because the backup path does not exist. Please set a valid backup location in Tools > Preferences. Não foi possível realizar a cópia de segurança do projeto porque o caminho das cópias de segurança não exite. Por favor, defina um cainho válido para as cópias de segurança em Ferramentas > Preferências. - + Could not create backup folder. Não foi possível ler o diretório de cópias de segurança. - + 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. Não foi possível realizar a cópia de segurança do projeto porque o caminho das cópias de segurança está em um caminho dentro do diretório do projeto. Por favor, escolha um caminho diferente para as cópias de segurança em Ferramentas> Preferências. - + Could not write backup archive. Não foi possível escrever o arquivo da cópia de segurança. - + Failed to create a new example project. Houve uma falha ao criar um novo projeto de exemplo. - + Failed to create a new example project. Could not find the necessary files. They seem to be missing from this installation. Houve uma falha ao criar um novo projeto de exemplo. Não foi possível encontrar os arquivos necessários. Eles parecem estar faltando nesta instalação. - + Could not create new project folder. Não foi possível criar o diretório do novo projeto. - + New project folder is not empty. Each project requires a dedicated project folder. O diretório do novo projeto não está vazio. Cada projeto requer um diretório dedicado. - + You must set a valid backup path in preferences to use the automatic project backup feature. Deve ser definido um caminho válido para as cópias de segurança nas preferências para usar a funcionalidade de cópias de segurança automáticas. - + You must set a valid project name in project settings to use the automatic project backup feature. Deve ser definido um nome de projeto válido nas preferências do projeto para usar a funcionalidade de cópias de segurança automáticas. - + Recovered Recuperado - + One or more orphaned files could not be added back into the project. Make sure at least a Novel root folder exists. Um ou mais arquivos-órfãos não puderam ser readicionados ao projeto. Verifique que pelo menos um diretório-raiz de Livro exista. - - Could not move - Não foi possível mover + + Could not move: {0} + Não foi possível mover: {0} - - Could not delete - Não foi possível remover + + Could not delete: {0} + Não foi possível remover: {0} - - Failed to remove - Houve uma falha ao remover - - - - Could not make folder - Não foi possível criar o diretório + + Could not make folder: {0} + Não foi possível criar o diretório: {0} @@ -4207,37 +4157,32 @@ Arquivo não encontrado: {0} - - {0}: {1} - - - - + Backup from {0} Cópia de segurança de {0} - + Backup archive file written to: {0} Arquivo da cópia de segurança escrito em: {0} - + Project backed up to '{0}' Cópia de segurança realizada para '{0}' - + Found {0} orphaned file(s) in project folder. Foram encontrados {0} arquivos-órfãos no diretório do projeto. - + Recovered File {0} Arquivo Recuperado {0} - + Not a folder: {0} Não é um diretório: {0} @@ -4247,83 +4192,65 @@ Format de arquivo de projeto do novelWriter desconhecido ou não-suportado. O projeto não pode ser aberto por essa versão do novelWriter. O arquivo foi salvo com a versão {0} do novelWriter. - + [{0}] {1} - + Could not move item {0} to {1}. Não foi possível mover o item {0} para {1}. - - - NWTree - - - Table of Contents - Sumário - - - - File Name - Nome do Arquivo - - - - Class - Classe - - - Layout - Leiaute + + 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? + O projeto foi salvo por uma versão mais nova do novelWriter, versão {0}. Esta é a versão {1}. Caso deseje continuar a abrir o projeto, alguns atributos e configurações podem não ser preservados, o restante do projeto, porém, deve funcionar. Continuar a abrir o projeto? - - Document Label - Rótulo do Documento + + By + Por 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} @@ -4331,27 +4258,27 @@ 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. @@ -4359,22 +4286,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 @@ -4388,8 +4315,8 @@ - Side image by {author:s}, {license:s} - Imagem ao lado por {author:s}, {license:s} + Side image by {0}, {1} + Imagem ao lado por {0}, {1} @@ -4397,32 +4324,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) @@ -4430,27 +4357,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 @@ -4477,11 +4404,11 @@ - Document '{doc_name}' is too big ({doc_size}). Skipping. - O documento '{doc_name}' é muito grande ({doc_size}). Ignorando. + Document '{0}' is too big ({1}). Skipping. + O documento '{0}' é muito grande ({1}). Ignorando. - + ERROR ERRO diff --git a/novelWriter.pro b/novelWriter.pro index 715ae5a4b..b2da58006 100644 --- a/novelWriter.pro +++ b/novelWriter.pro @@ -1,36 +1,33 @@ -SOURCES += nw/error.py \ - nw/constants/constants.py \ - nw/constants/iso.py \ - nw/core/document.py \ - nw/core/index.py \ - nw/core/project.py \ - nw/core/tohtml.py \ - nw/core/tokenizer.py \ - nw/core/tree.py \ - nw/guimain.py \ - nw/gui/about.py \ - nw/gui/build.py \ - nw/gui/custom.py \ - nw/gui/doceditor.py \ - nw/gui/dochighlight.py \ - nw/gui/docmerge.py \ - nw/gui/docsplit.py \ - nw/gui/docviewer.py \ - nw/gui/itemdetails.py \ - nw/gui/itemeditor.py \ - nw/gui/mainmenu.py \ - nw/gui/noveltree.py \ - nw/gui/outlinedetails.py \ - nw/gui/outline.py \ - nw/gui/preferences.py \ - nw/gui/projdetails.py \ - nw/gui/projload.py \ - nw/gui/projsettings.py \ - nw/gui/projtree.py \ - nw/gui/projwizard.py \ - nw/gui/statusbar.py \ - nw/gui/theme.py \ - nw/gui/wordlist.py \ - nw/gui/writingstats.py +SOURCES += \ + nw/constants/constants.py \ + nw/core/document.py \ + nw/core/project.py \ + nw/core/tokenizer.py \ + nw/gui/about.py \ + nw/gui/build.py \ + nw/gui/custom.py \ + nw/gui/doceditor.py \ + nw/gui/docmerge.py \ + nw/gui/docsplit.py \ + nw/gui/docviewer.py \ + nw/gui/itemdetails.py \ + nw/gui/itemeditor.py \ + nw/gui/mainmenu.py \ + nw/gui/noveltree.py \ + nw/gui/outline.py \ + nw/gui/outlinedetails.py \ + nw/gui/preferences.py \ + nw/gui/projdetails.py \ + nw/gui/projload.py \ + nw/gui/projsettings.py \ + nw/gui/projtree.py \ + nw/gui/projwizard.py \ + nw/gui/statusbar.py \ + nw/gui/theme.py \ + nw/gui/wordlist.py \ + nw/gui/writingstats.py \ + nw/error.py \ + nw/guimain.py -TRANSLATIONS += i18n/nw_pt.ts +TRANSLATIONS += \ + i18n/nw_pt.ts diff --git a/nw/core/project.py b/nw/core/project.py index 7e57650dd..7ae4e096d 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -260,7 +260,7 @@ def newProject(self, projData={}): titlePage = "# %s\n\n" % (self.bookTitle if self.bookTitle else self.projName) if self.bookAuthors: - titlePage = "%s%s %s\n" % (titlePage, self.tr("By"), ", ".join(self.bookAuthors)) + titlePage = "%s%s %s\n" % (titlePage, self.tr("By"), self.getAuthors()) # Document object for writing files aDoc = NWDoc(self, self.theParent) @@ -516,13 +516,10 @@ def openProject(self, fileName, overrideLock=False): self.tr("Version Conflict"), self.tr( "This project was saved by a newer version of novelWriter, version " - "{new_version}. This is version {version}. If you continue to open the " - "project, some attributes and settings may not be preserved, but the " + "{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( - new_version = appVersion, - version = nw.__version__ - ) + ).format(appVersion, nw.__version__) ) if not msgYes: self.clearProject() @@ -622,9 +619,7 @@ def openProject(self, fileName, overrideLock=False): self.mainConf.updateRecentCache(self.projPath, self.projName, self.lastWCount, time()) self.mainConf.saveRecentCache() - self.theParent.setStatus(self.tr("{0}: {1}").format( - self.tr("Opened Project"), self.projName) - ) + self.theParent.setStatus(self.tr("Opened Project: {0}").format(self.projName)) self._scanProjectFolder() @@ -743,9 +738,7 @@ def saveProject(self, autoSave=False): self.mainConf.saveRecentCache() self._writeLockFile() - self.theParent.setStatus(self.tr("{0}: {1}").format( - self.tr("Saved Project"), self.projName) - ) + self.theParent.setStatus(self.tr("Saved Project: {0}").format(self.projName)) self.setProjectChanged(False) return True @@ -1503,9 +1496,7 @@ def _legacyDataFolder(self, theFolder, errList): logger.info("Moved file: %s" % theFile) logger.info("New location: %s" % newPath) except Exception: - errList.append( - self.tr("{0}: {1}").format(self.tr("Could not move"), theFile) - ) + errList.append(self.tr("Could not move: {0}").format(theFile)) logger.error("Could not move: %s" % theFile) nw.logException() @@ -1514,9 +1505,7 @@ def _legacyDataFolder(self, theFolder, errList): os.unlink(theFile) logger.info("Deleted file: %s" % theFile) except Exception: - errList.append( - self.tr("{0}: {1}").format(self.tr("Could not delete"), theFile) - ) + errList.append(self.tr("Could not delete: {0}").format(theFile)) logger.error("Could not delete: %s" % theFile) nw.logException() @@ -1529,12 +1518,10 @@ def _legacyDataFolder(self, theFolder, errList): # ================== try: os.rmdir(theData) - logger.info("Removed folder: %s" % theFolder) + logger.info("Deleted folder: %s" % theFolder) except Exception: - errList.append( - self.tr("{0}: {1}").format(self.tr("Failed to remove"), theFolder) - ) - logger.error("Failed to remove: %s" % theFolder) + errList.append(self.tr("Could not delete: {0}").format(theFolder)) + logger.error("Could not delete: %s" % theFolder) nw.logException() return errList @@ -1545,7 +1532,7 @@ def _moveUnknownItem(self, theDir, theItem): """ theJunk = os.path.join(self.projPath, "junk") if not self._checkFolder(theJunk): - return self.tr("{0}: {1}").format(self.tr("Could not make folder"), theJunk) + return self.tr("Could not make folder: {0}").format(theJunk) theSrc = os.path.join(theDir, theItem) theDst = os.path.join(theJunk, theItem) diff --git a/nw/core/tokenizer.py b/nw/core/tokenizer.py index 0bb8184ac..da95a1475 100644 --- a/nw/core/tokenizer.py +++ b/nw/core/tokenizer.py @@ -292,9 +292,8 @@ def setText(self, theHandle, theText=None): docSize = len(self.theText) if docSize > nwConst.MAX_DOCSIZE: - errVal = self.tr("Document '{doc_name}' is too big ({doc_size}). Skipping.").format( - doc_name = self.theItem.itemName, - doc_size = f"{docSize/1.0e6:.2f} MB" + errVal = self.tr("Document '{0}' is too big ({1}). Skipping.").format( + self.theItem.itemName, f"{docSize/1.0e6:.2f} MB" ) 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 829819699..12503cc65 100644 --- a/nw/core/tree.py +++ b/nw/core/tree.py @@ -31,9 +31,6 @@ from time import time from lxml import etree from hashlib import sha256 -from functools import partial - -from PyQt5.QtCore import QCoreApplication from nw.core.item import NWItem from nw.common import checkHandle @@ -82,9 +79,6 @@ def __init__(self, theProject): self._handleSeed = None # Used for generating handles for testing - # Internal Mappings - self.tr = partial(QCoreApplication.translate, "NWTree") - return ## @@ -201,14 +195,11 @@ def writeToCFile(self): tocText = os.path.join(self.theProject.projPath, nwFiles.TOC_TXT) with open(tocText, mode="w", encoding="utf8") as outFile: outFile.write("\n") - outFile.write("%s\n" % self.tr("Table of Contents")) + outFile.write("Table of Contents\n") outFile.write("=================\n") outFile.write("\n") outFile.write("%-25s %-9s %-10s %s\n" % ( - self.tr("File Name"), - self.tr("Class"), - self.tr("Layout"), - self.tr("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 fd87fc9f9..000e2d022 100644 --- a/nw/gui/about.py +++ b/nw/gui/about.py @@ -136,8 +136,8 @@ def _fillAboutPage(self): aboutMsg = "".join([ "

%s

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

{copyright:s}.

", - "

%s

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

%s

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

%s

" % self.tr( "novelWriter is a markdown-like text editor designed for organising and " @@ -174,64 +174,34 @@ def _fillAboutPage(self): theTheme = self.theParent.theTheme theIcons = self.theParent.theTheme.theIcons if theTheme.themeName: - aboutMsg += "".join([ - "

%s

" % self.tr("{0}: {1}").format( - self.tr("Theme"), theTheme.themeName - ), - "

", - "%s
" % self.tr("{0}: {1}").format( - self.tr("Author"), theTheme.themeAuthor - ), - "%s
" % self.tr("{0}: {1}").format( - self.tr("Credit"), theTheme.themeCredit - ), - self.tr("{0}: {1}").format( - self.tr("License"), "{1}".format( - theTheme.themeLicenseUrl, theTheme.themeLicense - ) - ), - "

" - ]) + aboutMsg += "

%s

%s
%s
%s

" % ( + self.tr("Theme: {0}").format(theTheme.themeName), + self.tr("Author: {0}").format(theTheme.themeAuthor), + self.tr("Credit: {0}").format(theTheme.themeCredit), + self.tr("License: {0}").format( + f"{theTheme.themeLicense}" + ) + ) if theIcons.themeName: - aboutMsg += "".join([ - "

%s

" % self.tr("{0}: {1}").format( - self.tr("Icons"), theIcons.themeName - ), - "

", - "%s
" % self.tr("{0}: {1}").format( - self.tr("Author"), theIcons.themeAuthor - ), - "%s
" % self.tr("{0}: {1}").format( - self.tr("Credit"), theIcons.themeCredit - ), - self.tr("{0}: {1}").format( - self.tr("License"), "{1}".format( - theIcons.themeLicenseUrl, theIcons.themeLicense - ) - ), - "

" - ]) + aboutMsg += "

%s

%s
%s
%s

" % ( + self.tr("Icons: {0}").format(theIcons.themeName), + self.tr("Author: {0}").format(theIcons.themeAuthor), + self.tr("Credit: {0}").format(theIcons.themeCredit), + self.tr("License: {0}").format( + f"{theIcons.themeLicense}" + ) + ) if theTheme.syntaxName: - aboutMsg += "".join([ - "

%s

" % self.tr("{0}: {1}").format( - self.tr("Syntax"), theTheme.syntaxName - ), - "

", - "%s
" % self.tr("{0}: {1}").format( - self.tr("Author"), theTheme.syntaxAuthor - ), - "%s
" % self.tr("{0}: {1}").format( - self.tr("Credit"), theTheme.syntaxCredit - ), - self.tr("{0}: {1}").format( - self.tr("License"), "{1}".format( - theTheme.syntaxLicenseUrl, theTheme.syntaxLicense - ) - ), - "

" - ]) + aboutMsg += "

%s

%s
%s
%s

" % ( + self.tr("Syntax: {0}").format(theTheme.syntaxName), + self.tr("Author: {0}").format(theTheme.syntaxAuthor), + self.tr("Credit: {0}").format(theTheme.syntaxCredit), + self.tr("License: {0}").format( + f"{theTheme.syntaxLicense}" + ) + ) self.pageAbout.setHtml(aboutMsg) diff --git a/nw/gui/build.py b/nw/gui/build.py index 4615c9ff8..800a493b3 100644 --- a/nw/gui/build.py +++ b/nw/gui/build.py @@ -106,7 +106,7 @@ def __init__(self, theParent, theProject): self.titleGroup.setLayout(self.titleForm) fmtHelp = "
".join([ - "%s" % self.tr("{0}:").format("Formatting Codes"), + "%s" % self.tr("Formatting Codes:"), self.tr("{0} for the title as set in the document").format(r"%title%"), self.tr("{0} for chapter number (1, 2, 3)").format(r"%ch%"), self.tr("{0} for chapter number as a word (one, two)").format(r"%chw%"), @@ -423,54 +423,38 @@ def __init__(self, theParent, theProject): # Saving to File self.saveMenu = QMenu(self) - self.btnSave = QPushButton("Save As") + self.btnSave = QPushButton(self.tr("Save As")) self.btnSave.setMenu(self.saveMenu) - self.saveODT = QAction( - self.tr("{0} ({1})").format(self.tr("Open Document"), ".odt"), self - ) + self.saveODT = QAction(self.tr("Open Document (.odt)"), self) self.saveODT.triggered.connect(lambda: self._saveDocument(self.FMT_ODT)) self.saveMenu.addAction(self.saveODT) - self.saveFODT = QAction( - self.tr("{0} ({1})").format(self.tr("Flat Open Document"), ".fodt"), self - ) + self.saveFODT = QAction(self.tr("Flat Open Document (.fodt)"), self) self.saveFODT.triggered.connect(lambda: self._saveDocument(self.FMT_FODT)) self.saveMenu.addAction(self.saveFODT) - self.saveHTM = QAction( - self.tr("{0} ({1})").format(self.tr("novelWriter HTML"), ".htm"), self - ) + self.saveHTM = QAction(self.tr("novelWriter HTML (.htm)"), self) self.saveHTM.triggered.connect(lambda: self._saveDocument(self.FMT_HTM)) self.saveMenu.addAction(self.saveHTM) - self.saveNWD = QAction( - self.tr("{0} ({1})").format(self.tr("novelWriter Markdown"), ".nwd"), self - ) + self.saveNWD = QAction(self.tr("novelWriter Markdown (.nwd)"), self) self.saveNWD.triggered.connect(lambda: self._saveDocument(self.FMT_NWD)) self.saveMenu.addAction(self.saveNWD) - self.saveMD = QAction( - self.tr("{0} ({1})").format(self.tr("Standard Markdown"), ".md"), self - ) + self.saveMD = QAction(self.tr("Standard Markdown (.md)"), self) self.saveMD.triggered.connect(lambda: self._saveDocument(self.FMT_MD)) self.saveMenu.addAction(self.saveMD) - self.saveGH = QAction( - self.tr("{0} ({1})").format(self.tr("GitHub Markdown"), ".md"), self - ) + self.saveGH = QAction(self.tr("GitHub Markdown (.md)"), self) self.saveGH.triggered.connect(lambda: self._saveDocument(self.FMT_GH)) self.saveMenu.addAction(self.saveGH) - self.saveJsonH = QAction( - self.tr("{0} ({1})").format(self.tr("JSON + novelWriter HTML"), ".json"), self - ) + self.saveJsonH = QAction(self.tr("JSON + novelWriter HTML (.json)"), self) self.saveJsonH.triggered.connect(lambda: self._saveDocument(self.FMT_JSON_H)) self.saveMenu.addAction(self.saveJsonH) - self.saveJsonM = QAction( - self.tr("{0} ({1})").format(self.tr("JSON + novelWriters Markdown"), ".json"), self - ) + self.saveJsonM = QAction(self.tr("JSON + novelWriters Markdown (.json)"), self) self.saveJsonM.triggered.connect(lambda: self._saveDocument(self.FMT_JSON_M)) self.saveMenu.addAction(self.saveJsonM) @@ -1241,9 +1225,7 @@ def __init__(self, theParent, theProject): fPx = int(1.1*self.theTheme.fontPixelSize) - self.theTitle = QLabel(self.tr("{0}: {1}".format( - self.tr("Build Time"), self.tr("Unknown"))), self - ) + self.theTitle = QLabel("") self.theTitle.setIndent(0) self.theTitle.setAutoFillBackground(True) self.theTitle.setAlignment(Qt.AlignCenter) @@ -1252,6 +1234,7 @@ def __init__(self, theParent, theProject): self.theTitle.setFont(lblFont) self._updateDocMargins() + self._updateBuildAge() self.setStyleSheet() # Age Timer @@ -1359,9 +1342,7 @@ def _updateBuildAge(self): else: strBuildTime = self.tr("Unknown") - self.theTitle.setText(self.tr("{0}: {1}").format( - self.tr("Build Time"), strBuildTime) - ) + self.theTitle.setText(self.tr("Build Time: {0}").format(strBuildTime)) return diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index f374bd95c..7dc80520e 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -296,11 +296,11 @@ def loadText(self, tHandle, tLine=None, showStatus=True): self.theParent.makeAlert( self.tr( "The document you are trying to open is too big. " - "The document size is {doc_size}. " - "The maximum size allowed is {max_size}." + "The document size is {0} MB. " + "The maximum size allowed is {1} MB." ).format( - doc_size=self.tr("{0}\u202fMB").format(f"{docSize/1.0e6:.2f}"), - max_size=self.tr("{0}\u202fMB").format(f"{nwConst.MAX_DOCSIZE/1.0e6:.2f}") + f"{docSize/1.0e6:.2f}", + f"{nwConst.MAX_DOCSIZE/1.0e6:.2f}" ), nwAlert.ERROR ) @@ -389,11 +389,11 @@ def replaceText(self, theText): self.theParent.makeAlert( self.tr( "The text you are trying to add is too big. " - "The text size is {text_size}. " - "The maximum size allowed is {max_size}." + "The text size is {0} MB. " + "The maximum size allowed is {1} MB." ).format( - text_size=self.tr("{0}\u202fMB").format(f"{docSize/1.0e6:.2f}"), - max_size=self.tr("{0}\u202fMB").format(f"{nwConst.MAX_DOCSIZE/1.0e6:.2f}") + f"{docSize/1.0e6:.2f}", + f"{nwConst.MAX_DOCSIZE/1.0e6:.2f}" ), nwAlert.ERROR ) @@ -580,12 +580,14 @@ def setCursorLine(self, theLine): """ if not isinstance(theLine, int): return False + if theLine >= 0: theBlock = self.qDocument.findBlockByLineNumber(theLine) if theBlock: self.setCursorPosition(theBlock.position()) self.docFooter.updateLineCount() logger.verbose("Cursor moved to line %d" % theLine) + return True ## @@ -651,9 +653,7 @@ def spellCheckDocument(self): self.hLight.rehighlight() qApp.restoreOverrideCursor() afTime = time() - logger.debug( - "Document highlighted in %.3f ms" % (1000*(afTime-bfTime)) - ) + logger.debug("Document highlighted in %.3f ms" % (1000*(afTime-bfTime))) self.theParent.statusBar.showMessage(self.tr("Spell check complete")) return True @@ -809,7 +809,7 @@ def insertKeyWord(self, keyWord): theCursor = self.textCursor() theBlock = theCursor.block() if not theBlock.isValid(): - logger.error("Filed to insert keyword '%s'" % keyWord) + logger.error("Failed to insert keyword '%s'" % keyWord) return False theCursor.beginEditBlock() @@ -946,9 +946,9 @@ def _docChange(self, thePos, chrRem, chrAdd): self.theParent.makeAlert( self.tr( "The document has grown too big and you cannot add more text to it. " - "The maximum size of a single novelWriter document is {max_size}." + "The maximum size of a single novelWriter document is {0} MB." ).format( - max_size=self.tr("{0}\u202fMB").format(f"{nwConst.MAX_DOCSIZE/1.0e6:.2f}") + f"{nwConst.MAX_DOCSIZE/1.0e6:.2f}" ), nwAlert.ERROR ) @@ -1052,8 +1052,9 @@ def _openContextMenu(self, thePos): ) mnuContext.addAction(mnuWord) else: - mnuHead = QAction("%s %s" % (nwUnicode.U_ENDASH, self.tr("No Suggestions")), - mnuContext) + mnuHead = QAction( + "%s %s" % (nwUnicode.U_ENDASH, self.tr("No Suggestions")), mnuContext + ) mnuContext.addAction(mnuHead) mnuContext.addSeparator() @@ -1147,15 +1148,11 @@ def _docSizeChanged(self, theSize): QPointF(theSize.width(), theSize.height()), Qt.FuzzyHit ) if self.queuePos <= thePos: - logger.verbose( - "Allowed cursor move to %d <= %d" % (self.queuePos, thePos) - ) + logger.verbose("Allowed cursor move to %d <= %d" % (self.queuePos, thePos)) self.setCursorPosition(self.queuePos) self.queuePos = None else: - logger.verbose( - "Denied cursor move to %d > %d" % (self.queuePos, thePos) - ) + logger.verbose("Denied cursor move to %d > %d" % (self.queuePos, thePos)) return ## @@ -1547,9 +1544,7 @@ def _formatBlock(self, docAction): theText = newText cOffset -= 0 else: - logger.error( - "Unknown or unsupported block format requested: %s" % str(docAction) - ) + logger.error("Unknown or unsupported block format requested: %s" % str(docAction)) return False # Replace the block text @@ -2446,7 +2441,7 @@ def __init__(self, docEditor): self.linesIcon.setFixedHeight(self.sPx) self.linesIcon.setAlignment(Qt.AlignLeft | Qt.AlignTop) - self.linesText = QLabel(self.tr("{0}: {1}").format(self.tr("Line"), "0")) + self.linesText = QLabel("") self.linesText.setIndent(0) self.linesText.setMargin(0) self.linesText.setContentsMargins(0, 0, 0, 0) @@ -2462,7 +2457,7 @@ def __init__(self, docEditor): self.wordsIcon.setFixedHeight(self.sPx) self.wordsIcon.setAlignment(Qt.AlignLeft | Qt.AlignTop) - self.wordsText = QLabel(self.tr("{0}: {1}").format(self.tr("Words"), "0")) + self.wordsText = QLabel("") self.wordsText.setIndent(0) self.wordsText.setMargin(0) self.wordsText.setContentsMargins(0, 0, 0, 0) @@ -2493,6 +2488,8 @@ def __init__(self, docEditor): # Fix the Colours self.matchColours() + self.updateLineCount() + self.updateCounts() logger.debug("GuiDocEditFooter initialisation complete") @@ -2570,9 +2567,7 @@ def updateLineCount(self): iDist = 100*iLine/self.docEditor.qDocument.blockCount() self.linesText.setText( - self.tr("{0}: {1} ({2}\u202f%%)".format( - self.tr("Line"), f"{iLine:n}", f"{iDist:.0f}") - ) + self.tr("Line: {0} ({1})").format(f"{iLine:n}", f"{iDist:.0f} %") ) return @@ -2588,9 +2583,7 @@ def updateCounts(self): wDiff = wCount - self.theItem.initCount self.wordsText.setText( - self.tr("{0}: {1} ({2})".format( - self.tr("Words"), f"{wCount:n}", f"{wDiff:+n}") - ) + self.tr("Words: {0} ({1})").format(f"{wCount:n}", f"{wDiff:+n}") ) byteSize = self.docEditor.qDocument.characterCount() diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index 33c5a6da1..638622f4a 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -958,11 +958,9 @@ def __init__(self, docViewer): self.stickyRefs.setIconSize(QSize(fPx, fPx)) self.stickyRefs.setFixedSize(QSize(fPx, fPx)) self.stickyRefs.toggled.connect(self._doToggleSticky) - self.stickyRefs.setToolTip( - self.tr( - "Activate to freeze the content of the references panel when changing document" - ) - ) + self.stickyRefs.setToolTip(self.tr( + "Activate to freeze the content of the references panel when changing document" + )) # Show Comments self.showComments = QToolButton(self) diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index 94087ec08..a108c0d89 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -390,8 +390,9 @@ def _buildDocumentMenu(self): # Document > Split Document self.aSplitDoc = QAction(self.tr("Split Document to Folder"), self) - self.aSplitDoc.setStatusTip(self.tr("Split a document into a folder of " - "multiple documents")) + self.aSplitDoc.setStatusTip( + self.tr("Split a document into a folder of multiple documents") + ) self.aSplitDoc.triggered.connect(lambda: self.theParent.splitDocument()) self.docuMenu.addAction(self.aSplitDoc) @@ -516,8 +517,9 @@ def _buildViewMenu(self): # View > Focus Mode self.aFocusMode = QAction(self.tr("Focus Mode"), self) - self.aFocusMode.setStatusTip(self.tr("Toggles a distraction free mode, " - "only showing text editor")) + self.aFocusMode.setStatusTip( + self.tr("Toggles a distraction free mode, only showing text editor") + ) self.aFocusMode.setShortcut("F8") self.aFocusMode.setCheckable(True) self.aFocusMode.setChecked(self.theParent.isFocusMode) @@ -961,8 +963,9 @@ def _buildToolsMenu(self): # Tools > Toggle Auto Build Outline self.aAutoOutline = QAction(self.tr("Auto-Update Outline"), self) - self.aAutoOutline.setStatusTip(self.tr( - "Update project outline when a novel file is changed")) + self.aAutoOutline.setStatusTip( + self.tr("Update project outline when a novel file is changed") + ) self.aAutoOutline.setCheckable(True) self.aAutoOutline.toggled.connect(self._toggleAutoOutline) self.aAutoOutline.setShortcut("Ctrl+F10") diff --git a/nw/gui/preferences.py b/nw/gui/preferences.py index 956230602..acd0e33a1 100644 --- a/nw/gui/preferences.py +++ b/nw/gui/preferences.py @@ -336,7 +336,7 @@ def __init__(self, theParent): self.backupPathRow = self.mainForm.addRow( self.tr("Backup storage location"), self.backupGetPath, - self.tr("{0}: {1}").format(self.tr("Path"), self.backupPath) + self.tr("Path: {0}").format(self.backupPath) ) ## Run when closing @@ -429,7 +429,7 @@ def _backupFolder(self): if newDir: self.backupPath = newDir self.mainForm.setHelpText( - self.backupPathRow, self.tr("{0}: {1}").format(self.tr("Path"), self.backupPath)) + self.backupPathRow, self.tr("Path: {0}").format(self.backupPath)) return True return False diff --git a/nw/gui/projdetails.py b/nw/gui/projdetails.py index cccdc6c99..1ee40f6f8 100644 --- a/nw/gui/projdetails.py +++ b/nw/gui/projdetails.py @@ -156,9 +156,7 @@ def __init__(self, theParent, theProject): self.bookTitle.setWordWrap(True) self.projName = QLabel( - self.tr("{0}: {1}").format( - self.tr("Working Title"), self.theProject.projName - ) + self.tr("Working Title: {0}").format(self.theProject.projName) ) workFont = self.projName.font() workFont.setPointSizeF(0.8*fPt) diff --git a/nw/gui/projload.py b/nw/gui/projload.py index 118a1ba8f..2da9be5db 100644 --- a/nw/gui/projload.py +++ b/nw/gui/projload.py @@ -191,10 +191,8 @@ def _doBrowse(self): projFile, _ = QFileDialog.getOpenFileName( self, self.tr("Open novelWriter Project"), "", ";;".join([ - self.tr("{0} ({1})").format( - self.tr("novelWriter Project File"), nwFiles.PROJ_FILE - ), - self.tr("{0} ({1})").format(self.tr("All Files"), "*") + self.tr("novelWriter Project File ({0})").format(nwFiles.PROJ_FILE), + self.tr("All Files (*.*)"), ]), options=dlgOpt ) diff --git a/nw/gui/projsettings.py b/nw/gui/projsettings.py index 4a3a6898e..6c810e4a3 100644 --- a/nw/gui/projsettings.py +++ b/nw/gui/projsettings.py @@ -466,7 +466,7 @@ def __init__(self, theParent, theProject): self.listBox.setIndentation(0) for aKey, aVal in self.theProject.autoReplace.items(): - newItem = QTreeWidgetItem([self.tr("<{0}>").format(aKey), aVal]) + newItem = QTreeWidgetItem(["<%s>" % aKey, aVal]) self.listBox.addTopLevelItem(newItem) self.listBox.sortByColumn(0, Qt.AscendingOrder) diff --git a/nw/gui/projwizard.py b/nw/gui/projwizard.py index e3efc4848..b53e794c6 100644 --- a/nw/gui/projwizard.py +++ b/nw/gui/projwizard.py @@ -105,9 +105,8 @@ def __init__(self, theWizard): ) self.theText.setWordWrap(True) - self.imgCredit = QLabel(self.tr("Side image by {author:s}, {license:s}").format( - author = "Peter Mitterhofer", - license = "CC BY-SA 4.0" + self.imgCredit = QLabel(self.tr("Side image by {0}, {1}").format( + "Peter Mitterhofer", "CC BY-SA 4.0" )) lblFont = self.imgCredit.font() lblFont.setPointSizeF(0.6*self.theTheme.fontPointSize) diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py index a2a8b4c18..4691202cd 100644 --- a/nw/gui/statusbar.py +++ b/nw/gui/statusbar.py @@ -179,9 +179,7 @@ def setDocumentStatus(self, isChanged): def setStats(self, pWC, sWC): """Set the current project statistics. """ - self.statsText.setText(self.tr("{0}: {1} ({2})").format( - self.tr("Words"), f"{pWC:n}", f"{sWC:+n}") - ) + self.statsText.setText(self.tr("Words: {0} ({1})").format(f"{pWC:n}", f"{sWC:+n}")) self.statsText.setToolTip(self.tr("Project word count (session change)")) return diff --git a/nw/gui/writingstats.py b/nw/gui/writingstats.py index 2a48213a1..aa8ded71c 100644 --- a/nw/gui/writingstats.py +++ b/nw/gui/writingstats.py @@ -159,12 +159,12 @@ def __init__(self, theParent, theProject): self.totalWords.setFont(self.theTheme.guiFontFixed) self.totalWords.setAlignment(Qt.AlignVCenter | Qt.AlignRight) - lblTTime = QLabel(self.tr("{0}:").format(self.tr("Total Time"))) - lblITime = QLabel(self.tr("{0}:").format(self.tr("Idle Time"))) - lblFTime = QLabel(self.tr("{0}:").format(self.tr("Filtered Time"))) - lblNvCount = QLabel(self.tr("{0}:").format(self.tr("Novel Word Count"))) - lblNtCount = QLabel(self.tr("{0}:").format(self.tr("Notes Word Count"))) - lblTtCount = QLabel(self.tr("{0}:").format(self.tr("Total Word Count"))) + lblTTime = QLabel(self.tr("Total Time:")) + lblITime = QLabel(self.tr("Idle Time:")) + lblFTime = QLabel(self.tr("Filtered Time:")) + lblNvCount = QLabel(self.tr("Novel Word Count:")) + lblNtCount = QLabel(self.tr("Notes Word Count:")) + lblTtCount = QLabel(self.tr("Total Word Count:")) self.infoForm.addWidget(lblTTime, 0, 0) self.infoForm.addWidget(lblITime, 1, 0) @@ -268,13 +268,11 @@ def __init__(self, theParent, theProject): self.saveMenu = QMenu(self) self.btnSave.setMenu(self.saveMenu) - self.saveJSON = QAction(self.tr("{0} ({1})").format( - self.tr("JSON Data File"), ".json"), self) + self.saveJSON = QAction(self.tr("JSON Data File (.json)"), self) self.saveJSON.triggered.connect(lambda: self._saveData(self.FMT_JSON)) self.saveMenu.addAction(self.saveJSON) - self.saveCSV = QAction(self.tr("{0} ({1})").format( - self.tr("CSV Data File"), ".csv"), self) + self.saveCSV = QAction(self.tr("CSV Data File (.csv)"), self) self.saveCSV.triggered.connect(lambda: self._saveData(self.FMT_CSV)) self.saveMenu.addAction(self.saveCSV) diff --git a/nw/guimain.py b/nw/guimain.py index de9c6f040..feb898bcf 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -725,13 +725,9 @@ def importDocument(self): theText = inFile.read() self.mainConf.setLastPath(loadFile) except Exception as e: - self.makeAlert( - [ - self.tr("Could not read file. The file must be an existing text file."), - str(e) - ], - nwAlert.ERROR - ) + self.makeAlert([ + self.tr("Could not read file. The file must be an existing text file."), str(e) + ], nwAlert.ERROR) return False if self.docEditor.theHandle is None: @@ -885,14 +881,9 @@ def rebuildIndex(self, beQuiet=False): for nDone, tItem in enumerate(self.theProject.projTree): if tItem is not None: - self.setStatus(self.tr("{0}: '{1}'").format(self.tr("Indexing"), tItem.itemName)) + self.setStatus(self.tr("Indexing: '{0}'").format(tItem.itemName)) else: - self.setStatus( - self.tr("{0}: {1}").format( - self.tr("Indexing"), - self.tr("Unknown item") - ) - ) + self.setStatus(self.tr("Indexing: '{0}'").format(self.tr("Unknown item"))) if tItem is not None and tItem.itemType == nwItemType.FILE: logger.verbose("Scanning: %s" % tItem.itemName)