IDE: implemented loading .po files of packages

git-svn-id: trunk@10411 -
This commit is contained in:
mattias 2007-01-10 01:29:36 +00:00
parent c87cc5499f
commit e8fa91fe05
43 changed files with 961 additions and 60 deletions

65
.gitattributes vendored
View File

@ -102,22 +102,23 @@ components/codetools/finddeclarationtool.pas svneol=native#text/pascal
components/codetools/identcompletiontool.pas svneol=native#text/pascal
components/codetools/keywordfunclists.pas svneol=native#text/pascal
components/codetools/languages/README.txt svneol=native#text/plain
components/codetools/languages/codetools.ca.po svneol=native#text/plain
components/codetools/languages/codetools.de.po svneol=native#text/plain
components/codetools/languages/codetools.es.po svneol=native#text/plain
components/codetools/languages/codetools.esutf.po svneol=native#text/plain
components/codetools/languages/codetools.fi.po svneol=native#text/plain
components/codetools/languages/codetools.fr.po svneol=native#text/plain
components/codetools/languages/codetools.id.po svneol=native#text/plain
components/codetools/languages/codetools.it.po svneol=native#text/plain
components/codetools/languages/codetools.nl.po svneol=native#text/plain
components/codetools/languages/codetools.pl.po svneol=native#text/plain
components/codetools/languages/codetools.pliso.po svneol=native#text/plain
components/codetools/languages/codetools.plwin.po svneol=native#text/plain
components/codetools/languages/codetools.po svneol=native#text/plain
components/codetools/languages/codetools.ru.po svneol=native#text/plain
components/codetools/languages/codetools.ua.po svneol=native#text/plain
components/codetools/languages/codetools.zh-cn.po svneol=native#text/utf8
components/codetools/languages/codetoolsstrconsts.ca.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.de.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.es.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.esutf.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.fi.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.fr.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.id.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.it.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.nl.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.pb.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.pl.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.pliso.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.plwin.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.ru.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.ua.po svneol=native#text/plain
components/codetools/languages/codetoolsstrconsts.zh-cn.po svneol=native#text/utf8
components/codetools/laz_dom.pas svneol=native#text/pascal
components/codetools/laz_xmlcfg.pas svneol=native#text/pascal
components/codetools/laz_xmlread.pas svneol=native#text/pascal
@ -2576,22 +2577,22 @@ lcl/interfaces/wince/wincewsspin.pp svneol=native#text/plain
lcl/interfaces/wince/wincewsstdctrls.pp svneol=native#text/plain
lcl/intfgraphics.pas svneol=native#text/pascal
lcl/languages/README.txt svneol=native#text/plain
lcl/languages/lcl.ca.po svneol=native#text/plain
lcl/languages/lcl.de.po svneol=native#text/plain
lcl/languages/lcl.es.po svneol=native#text/plain
lcl/languages/lcl.fi.po svneol=native#text/plain
lcl/languages/lcl.fr.po svneol=native#text/plain
lcl/languages/lcl.id.po svneol=native#text/plain
lcl/languages/lcl.it.po svneol=native#text/plain
lcl/languages/lcl.nl.po svneol=native#text/plain
lcl/languages/lcl.pb.po svneol=native#text/plain
lcl/languages/lcl.pl.po svneol=native#text/plain
lcl/languages/lcl.pliso.po svneol=native#text/plain
lcl/languages/lcl.plwin.po svneol=native#text/plain
lcl/languages/lcl.po svneol=native#text/plain
lcl/languages/lcl.ru.po svneol=native#text/plain
lcl/languages/lcl.ua.po svneol=native#text/plain
lcl/languages/lcl.zh-cn.po svneol=native#text/utf8
lcl/languages/lclstrconsts.ca.po svneol=native#text/plain
lcl/languages/lclstrconsts.de.po svneol=native#text/plain
lcl/languages/lclstrconsts.es.po svneol=native#text/plain
lcl/languages/lclstrconsts.fi.po svneol=native#text/plain
lcl/languages/lclstrconsts.fr.po svneol=native#text/plain
lcl/languages/lclstrconsts.id.po svneol=native#text/plain
lcl/languages/lclstrconsts.it.po svneol=native#text/plain
lcl/languages/lclstrconsts.nl.po svneol=native#text/plain
lcl/languages/lclstrconsts.pb.po svneol=native#text/plain
lcl/languages/lclstrconsts.pl.po svneol=native#text/plain
lcl/languages/lclstrconsts.pliso.po svneol=native#text/plain
lcl/languages/lclstrconsts.plwin.po svneol=native#text/plain
lcl/languages/lclstrconsts.po svneol=native#text/plain
lcl/languages/lclstrconsts.ru.po svneol=native#text/plain
lcl/languages/lclstrconsts.ua.po svneol=native#text/plain
lcl/languages/lclstrconsts.zh-cn.po svneol=native#text/utf8
lcl/lazconfigstorage.pas svneol=native#text/pascal
lcl/lazhelphtml.pas svneol=native#text/pascal
lcl/lazhelpintf.pas svneol=native#text/pascal

View File

@ -0,0 +1,756 @@
#: codetoolsstrconsts:ctsothercompilerdefines
msgid "%s Compiler Defines"
msgstr "%s Definições de Compilador"
#: codetoolsstrconsts:ctsnameddirectory
msgid "%s Directory"
msgstr "Diretório %s"
#: codetoolsstrconsts:ctsnamedproject
msgid "%s Project"
msgstr "Projeto %s"
#: codetoolsstrconsts:ctsstrexpectedbutatomfound
msgid "%s expected, but %s found"
msgstr "%s esperado, mas %s encontrado"
#: codetoolsstrconsts:ctsfilehascircularsymlink
msgid "%s has a circular symbolic link"
msgstr "%s tem um link simbólico circular"
#: codetoolsstrconsts:ctsfileisnotexecutable
msgid "%s is not executable"
msgstr "%s não é um executável"
#: codetoolsstrconsts:ctsawithoutb
msgid "%s without %s"
msgstr "% sem %s"
#: codetoolsstrconsts:ctsunknownmainfilename
msgid "(unknown mainfilename)"
msgstr "(arquivo principal desconhecido)"
#: codetoolsstrconsts:ctsunknownsubdescriptor
msgid "(unknown subdescriptor %s)"
msgstr "(sub-descrição desconhecida %s)"
#: codetoolsstrconsts:ctspointhintprocstartat
msgid ". Hint: proc start at "
msgstr ". Dica: proc inicia em "
#: codetoolsstrconsts:ctspointstartat
msgid ". start at "
msgstr ". iniciado em "
#: codetoolsstrconsts:ctssemicolonafterpropspecmissing
msgid "; expected after \"%s\" property specifier, but %s found"
msgstr "; esperado depois \"%s\" especificador de propriedade, mas %s encontrado"
#: codetoolsstrconsts:ctsanonymdefinitionsarenotallowed
msgid "Anonymous %s definitions are not allowed"
msgstr "Definição anonima %s não é permitida"
#: codetoolsstrconsts:ctscpudirectory
msgid "CPU directory"
msgstr "Diretório CPU"
#: codetoolsstrconsts:ctsclasssnotfound
msgid "Class %s not found"
msgstr "Classe %s não encontrada"
#: codetoolsstrconsts:ctscommandlineparameters
msgid "Command line parameters"
msgstr "Parâmetros de linha de comando"
#: codetoolsstrconsts:ctscommentendnotfound
msgid "Comment end not found"
msgstr "Final de comentário não encontrado"
#: codetoolsstrconsts:ctscompiledsrcpath
msgid "Compiled SrcPath"
msgstr "SrcPath Compilado"
#: codetoolsstrconsts:ctscompiler
msgid "Compiler"
msgstr "Compilador"
#: codetoolsstrconsts:ctscomponentsdirectory
msgid "Components Directory"
msgstr "Diretório de Componentes"
#: codetoolsstrconsts:ctsconverterdirectory
msgid "Converter Directory"
msgstr "Diretório do Converter"
#: codetoolsstrconsts:ctscustomcomponentsdirectory
msgid "Custom Components Directory"
msgstr "Diretório de Componentes de Costume"
#: codetoolsstrconsts:ctsdebuggerdirectory
msgid "Debugger Directory"
msgstr "Diretório do Debugger"
#: codetoolsstrconsts:ctsdefaultppc386sourceoperatingsystem
msgid "Default ppc386 source Operating System"
msgstr "Sistema operacional fonte padrão ppc386"
#: codetoolsstrconsts:ctsdefaultppc386source2operatingsystem
msgid "Default ppc386 source Operating System 2"
msgstr "Sistema operacional 2 fonte padrão ppc386"
#: codetoolsstrconsts:ctsdefaultppc386symbol
msgid "Default ppc386 symbol"
msgstr "Símbolo padrão ppc386"
#: codetoolsstrconsts:ctsdefaultppc386targetoperatingsystem
msgid "Default ppc386 target Operating System"
msgstr "Sistema operacional alvo padrão ppc386"
#: codetoolsstrconsts:ctsdefaultppc386targetprocessor
msgid "Default ppc386 target processor"
msgstr "Processador alvo padrão ppc386"
#: codetoolsstrconsts:ctsdefine
msgid "Define "
msgstr "Definir "
#: codetoolsstrconsts:ctsdefinemacroname
msgid "Define Macro %s"
msgstr "Definir Macro %s"
#: codetoolsstrconsts:ctsdefinemacrocarbon1
msgid "Define macro carbon1"
msgstr "Definir macro carbon1"
#: codetoolsstrconsts:ctsdefinemacrognome2
msgid "Define macro gnome2"
msgstr "Definir macro gnome2"
#: codetoolsstrconsts:ctsdefinemacrogtk1
msgid "Define macro gtk1"
msgstr "Definir macro gtk1"
#: codetoolsstrconsts:ctsdefinemacrogtk2
msgid "Define macro gtk2"
msgstr "Definir macro gtk2"
#: codetoolsstrconsts:ctsdefinemacroqt1
msgid "Define macro qt1"
msgstr "Definir macro qt1"
#: codetoolsstrconsts:ctsdefinemacrowince1
msgid "Define macro wince1"
msgstr "Definir macro wince1"
#: codetoolsstrconsts:ctsdefineprocessortype
msgid "Define processor type"
msgstr "Definir tipo de processador"
#: codetoolsstrconsts:ctsdefsforlazarussources
msgid "Definitions for the Lazarus Sources"
msgstr "Definições para os Fontes Lazarus"
#: codetoolsstrconsts:ctsdesignerdirectory
msgid "Designer Directory"
msgstr "Diretório de Designer"
#: codetoolsstrconsts:ctsdesignerunitsdirectory
msgid "Designer Units"
msgstr "Units Designer"
#: codetoolsstrconsts:ctsdoceditordirectory
msgid "Doc Editor Directory"
msgstr "Diretório do Doc Editor"
#: codetoolsstrconsts:ctsendofsourcenotfound
msgid "End of source not found"
msgstr "Final do fonte não encontrado"
#: codetoolsstrconsts:ctsforward
msgid "Forward"
msgstr "Adiante"
#: codetoolsstrconsts:ctsforwardclassdefinitionnotresolved
msgid "Forward class definition not resolved: %s"
msgstr "Definição de classe adiante não resolvida: %s"
#: codetoolsstrconsts:ctsfreepascalcompilerinitialmacros
msgid "Free Pascal Compiler initial macros"
msgstr "Macros iniciais Free Pascal Compiler"
#: codetoolsstrconsts:ctsfreepascalcomponentlibrary
msgid "Free Pascal Component Library"
msgstr "Biblioteca de Componentes Free Pascal"
#: codetoolsstrconsts:ctsfreepascalsourcedir
msgid "Free Pascal Source Directory"
msgstr "Diretório Fonte do Free Pascal"
#: codetoolsstrconsts:ctsfreepascalsourcesplusdesc
msgid "Free Pascal Sources, %s"
msgstr "Fontes Free Pascal, %s"
#: codetoolsstrconsts:ctsidedirectory
msgid "IDE Directory"
msgstr "Diretório do IDE"
#: codetoolsstrconsts:ctsideintfdirectory
msgid "IDEIntf Directory"
msgstr "Diretório IDEIntf"
#: codetoolsstrconsts:ctsidentifieralreadydefined
msgid "Identifier %s already defined"
msgstr "Identificador %s já definido"
#: codetoolsstrconsts:ctsiflclwidgettypeequalsgnome2
msgid "If LCLWidgetType=gnome2 then"
msgstr "Se LCLWidgetType=gnome2 então"
#: codetoolsstrconsts:ctsiflclwidgettypeequalsgtk2
msgid "If LCLWidgetType=gtk2 then"
msgstr "Se LCLWidgetType=gtk2 então"
#: codetoolsstrconsts:ctsiftargetosisnotsrcos
msgid "If TargetOS<>SrcOS"
msgstr "Se TargetOS<>SrcOS"
#: codetoolsstrconsts:ctsiftargetosisnotsrcos2
msgid "If TargetOS<>SrcOS2"
msgstr "Se TargetOS<>SrcOS2"
#: codetoolsstrconsts:ctsiftargetosisnotwin32
msgid "If TargetOS<>win32 then"
msgstr "Se TargetOS<>win32 então"
#: codetoolsstrconsts:ctsincludecircledetected
msgid "Include circle detected"
msgstr "Círculo Include detectado"
#: codetoolsstrconsts:ctsinstalldirectory
msgid "Install Directory"
msgstr "Diretório de Instalação"
#: codetoolsstrconsts:ctsinstallerdirectories
msgid "Installer directories"
msgstr "Diretório de Instalação"
#: codetoolsstrconsts:ctsjitformdirectory
msgid "JITForm Directory"
msgstr "Diretório JITForm"
#: codetoolsstrconsts:ctslazarussources
msgid "Lazarus Sources"
msgstr "Fontes Lazarus"
#: codetoolsstrconsts:ctsnestedcommentson
msgid "Nested Comments On"
msgstr "Comentários Aninhados"
#: codetoolsstrconsts:ctsnoscanneravailable
msgid "No scanner available"
msgstr "Scanner não disponível"
#: codetoolsstrconsts:ctsnoscannerfound
msgid "No scanner found for \"%s\". If this is an include file, please open the main source first."
msgstr "Scanner não encontrado para \"%s\". Se este é um arquivo include, por favor abra o fonte principal primeiro."
#: codetoolsstrconsts:ctspackagedirectories
msgid "Package directories"
msgstr "Diretório de Pacote"
#: codetoolsstrconsts:ctspackagerdirectory
msgid "Packager Directory"
msgstr "Diretório Packager"
#: codetoolsstrconsts:ctspackagerregistrationdirectory
msgid "Packager Registration Directory"
msgstr "Diretório Packager Registration"
#: codetoolsstrconsts:ctspackagerunitsdirectory
msgid "Packager Units Directory"
msgstr "Diretório Packager Units"
#: codetoolsstrconsts:ctspositionnotinsource
msgid "Position not in source"
msgstr "Não situado no fonte"
#: codetoolsstrconsts:ctsresetalldefines
msgid "Reset all defines"
msgstr "Reiniciar todas as definições"
#: codetoolsstrconsts:ctsruntimelibrary
msgid "Runtime library"
msgstr "Biblioteca de Runtime"
#: codetoolsstrconsts:ctssourcefilenamesforstandardfpcunits
msgid "Source filenames for the standard fpc units"
msgstr "Nome de arquivos fontes para as units padrões fpc"
#: codetoolsstrconsts:ctssrcpathinitialization
msgid "SrcPath Initialization"
msgstr "Inicialização SrcPath"
#: codetoolsstrconsts:ctssyntaxerrorinexpr
msgid "Syntax Error in expression \"%s\""
msgstr "Erro de Sintaxe em expressão \"%s\""
#: codetoolsstrconsts:ctstcodetoolmanagerconsistencycheck
msgid "TCodeToolManager.ConsistencyCheck=%d"
msgstr ""
#: codetoolsstrconsts:ctstermnotsimple
msgid "Term has no simple type"
msgstr "Término não tem tipo simples"
#: codetoolsstrconsts:ctstoolsdirectory
msgid "Tools Directory"
msgstr "Diretório de Ferramentas"
#: codetoolsstrconsts:ctsunitpathinitialization
msgid "UnitPath Initialization"
msgstr "Inicialização UnitPath"
#: codetoolsstrconsts:ctsunknownfunction
msgid "Unknown function %s"
msgstr "Função desconhecida %s"
#: codetoolsstrconsts:ctsunparsed
msgid "Unparsed"
msgstr "Sem Processar"
#: codetoolsstrconsts:ctsutilsdirectories
msgid "Utils directories"
msgstr "Diretório de Utilitários"
#: codetoolsstrconsts:ctswidgetdirectory
msgid "Widget Directory"
msgstr "Diretório Widget"
#: codetoolsstrconsts:ctswordnotfound
msgid "\"%s\" not found"
msgstr "\"%s\" não encontrado"
#: codetoolsstrconsts:ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "\"classe de\" definição não resolvida: %s"
#: codetoolsstrconsts:ctsendforclassnotfound
msgid "\"end\" for class/object not found"
msgstr "\"end\" para classe/objeto não encontrado"
#: codetoolsstrconsts:ctsdircomponentdoesnotexistsorisdanglingsymlink
msgid "a directory component in %s does not exist or is a dangling symlink"
msgstr "um diretório de componente em %s não existe ou é um link simbólico pendente"
#: codetoolsstrconsts:ctsdircomponentisnotdir
msgid "a directory component in %s is not a directory"
msgstr "um diretório de componente in %s não é um diretório"
#: codetoolsstrconsts:ctsaddsdirtosourcepath
msgid "adds %s to SrcPath"
msgstr "adicionar %s para SrcPath"
#: codetoolsstrconsts:ctsanlclproject
msgid "an LCL project"
msgstr "um projeto LCL"
#: codetoolsstrconsts:ctsancestorisnotproperty
msgid "ancestor of untyped property is not a property"
msgstr "propriedade ancestor ou não-tipada não é uma propriedade"
#: codetoolsstrconsts:ctsbasetypeofnotfound
msgid "base type of \"%s\" not found"
msgstr "tipo base de \"%s\" não encontrada"
#: codetoolsstrconsts:ctsbinaryoperator
msgid "binary operator"
msgstr "operador binário"
#: codetoolsstrconsts:ctsbracketnotfound
msgid "bracket %s not found"
msgstr "parenteses %s não encontrado"
#: codetoolsstrconsts:ctsbracketcloseexpectedbutatomfound
msgid "bracket close expected, but %s found"
msgstr "esperado fechamento de parenteses, mas %s encontrado"
#: codetoolsstrconsts:ctsbracketopenexpectedbutatomfound
msgid "bracket open expected, but %s found"
msgstr "esperado abertura de parenteses, mas %s encontrado"
#: codetoolsstrconsts:ctscircleindefinitions
msgid "circle in definitions"
msgstr "círculo em definições"
#: codetoolsstrconsts:ctsclassnotfound
msgid "class %s%s%s not found"
msgstr "classe %s%s%s não encontrada"
#: codetoolsstrconsts:ctsclassidentifierexpected
msgid "class identifier expected"
msgstr "identificador de classe esperado"
#: codetoolsstrconsts:ctsclassnodewithoutparentnode
msgid "class node without parent node"
msgstr "nó de classe sem nó parente"
#: codetoolsstrconsts:ctsclasswithoutname
msgid "class without name"
msgstr "classe sem nome"
#: codetoolsstrconsts:ctsconstant
msgid "constant"
msgstr "constante"
#: codetoolsstrconsts:ctscursorposoutsideofcode
msgid "cursor pos outside of code"
msgstr "posição do cursor fora do código"
#: codetoolsstrconsts:ctsdefaultclassancestortobjectnotfound
msgid "default class ancestor TObject not found"
msgstr "classe ancestor padrão TObject não encontrada"
#: codetoolsstrconsts:ctsdefaultinterfaceancestoriinterfacenotfound
msgid "default interface ancestor IInterface not found"
msgstr "ancestor interface padrão IInterface não encontrado"
#: codetoolsstrconsts:ctsdefaultparameterexpectedbutatomfound
msgid "default parameter expected, but %s found"
msgstr "parâmetro padrão esperado, mas %s encontrado"
#: codetoolsstrconsts:ctsdefaultpropertynotfound
msgid "default property not found"
msgstr "propriedade padrão não encontrada"
#: codetoolsstrconsts:ctsdefaultspecifierredefined
msgid "default specifier redefined"
msgstr "especificador padrão redefinido"
#: codetoolsstrconsts:ctsduplicateidentifier
msgid "duplicate identifier: %s"
msgstr "identificador duplicado: %s"
#: codetoolsstrconsts:ctselse
msgid "else"
msgstr "senão"
#: codetoolsstrconsts:ctsfpdocsystemon
msgid "enable FPDocSystem"
msgstr "ativar FPDocSystem"
#: codetoolsstrconsts:ctsendforrecordnotfound
msgid "end for record not found"
msgstr "final para gravar não encontrado"
#: codetoolsstrconsts:ctserrorduringcreationofnewprocbodies
msgid "error during creation of new proc bodies"
msgstr "erro durante a criação"
#: codetoolsstrconsts:ctserrorduringinsertingnewclassparts
msgid "error during inserting new class parts"
msgstr "erro durante a inserção de novas partes da classe"
#: codetoolsstrconsts:ctserrorduringinsertingnewusessection
msgid "error during inserting new units to the main uses section"
msgstr ""
#: codetoolsstrconsts:ctserrorindirectiveexpression
msgid "error in directive expression"
msgstr "erro na diretiva de expressão"
#: codetoolsstrconsts:ctserrorinparamlist
msgid "error in paramlist"
msgstr "erro em lista de parametro"
#: codetoolsstrconsts:ctsexecuteaccessdeniedforfile
msgid "execute access denied for %s"
msgstr "acesso de execução não permitido para %s"
#: codetoolsstrconsts:ctsendofsourceexpectedbutatomfound
msgid "expected end., but %s found"
msgstr "esperado end., mas %s encontrado"
#: codetoolsstrconsts:ctsexportsclauseonlyallowedinlibraries
msgid "exports clause only allowed in libraries"
msgstr "exportar clausula é somente permitido em bibliotecas/libraries"
#: codetoolsstrconsts:ctsexprtypemustbeclassorrecord
msgid "expression type must be class or record type"
msgstr "tipo de expressão deve ser tipo classe ou record"
#: codetoolsstrconsts:ctsfiledoesnotexists
msgid "file \"%s\" does not exist"
msgstr "arquivo \"%s\" não existe"
#: codetoolsstrconsts:ctsfileisreadonly
msgid "file is read only"
msgstr "arquivo é somente-leitura"
#: codetoolsstrconsts:ctsgnomeintfdirectory
msgid "gnome interface directory"
msgstr "diretório de interface gnome"
#: codetoolsstrconsts:ctsgtk2intfdirectory
msgid "gtk2 interface directory"
msgstr "diretório de interface gtk2"
#: codetoolsstrconsts:ctsidentifier
msgid "identifier"
msgstr "identificador"
#: codetoolsstrconsts:ctsidentexpectedbutatomfound
msgid "identifier expected, but %s found"
msgstr "identificador esperado, mas %s encontrado"
#: codetoolsstrconsts:ctsidentexpectedbutkeywordfound
msgid "identifier expected, but keyword %s found"
msgstr "identificador esperado, mas palavra-chave %s encontrada"
#: codetoolsstrconsts:ctsidentifiernotfound
msgid "identifier not found: %s"
msgstr "identificador não encontrado: %s"
#: codetoolsstrconsts:ctsillegalcircleinusedunits
msgid "illegal circle using unit: %s"
msgstr "círculo em utilização de unit ilegal: %s"
#: codetoolsstrconsts:ctsillegalqualifier
msgid "illegal qualifier %s found"
msgstr "qualificador ilegal %s encontrado"
#: codetoolsstrconsts:ctsimplementationnodenotfound
msgid "implementation node not found"
msgstr "nó de implementação não encontrado"
#: codetoolsstrconsts:ctsincludedirectoriesplusdirs
msgid "include directories: %s"
msgstr "incluir diretórios: %s"
#: codetoolsstrconsts:ctsincludefilenotfound
msgid "include file not found \"%s\""
msgstr "arquivo include não encontrado \"%s\""
#: codetoolsstrconsts:ctsincompatibletypesgotexpected
msgid "incompatibles types: expected \"%s\" but got \"%s\""
msgstr "tipos incompatível: esperado \"%s\" mas recebido \"%s\""
#: codetoolsstrconsts:ctsindexparameterexpectedbutatomfound
msgid "index parameter expected, but %s found"
msgstr "esperado parâmetro de indice, mas %s encontrado"
#: codetoolsstrconsts:ctsindexspecifierredefined
msgid "index specifier redefined"
msgstr "especificador de indice redefinido"
#: codetoolsstrconsts:ctsinheritedkeywordonlyallowedinmethods
msgid "inherited keyword only allowed in methods"
msgstr "palavra-chave descendente somente permitida em métodos"
#: codetoolsstrconsts:ctsinsufficientmemory
msgid "insufficient memory"
msgstr "memória insuficiente"
#: codetoolsstrconsts:ctsintfdirectory
msgid "interface directory"
msgstr "diretório interface"
#: codetoolsstrconsts:ctsinterfacesectionnotfound
msgid "interface section not found"
msgstr "seção interface não encontrada"
#: codetoolsstrconsts:ctsinvalidclassname2
msgid "invalid class name %s%s%s"
msgstr "nome de classe inválida %s%s%s"
#: codetoolsstrconsts:ctsinvalidclassname
msgid "invalid class name=%s%s%s"
msgstr "nome de classe inválida=%s%s%s"
#: codetoolsstrconsts:ctsinvalidflagvaluefordirective
msgid "invalid flag value \"%s\" for directive %s"
msgstr "Valor de flag inválido \"%s\" para diretiva %s"
#: codetoolsstrconsts:ctsinvalidmode
msgid "invalid mode \"%s\""
msgstr "modo inválido \"%s\""
#: codetoolsstrconsts:ctsinvalidsubrange
msgid "invalid subrange"
msgstr "sub-faixa inválida"
#: codetoolsstrconsts:ctsinvalidtype
msgid "invalid type"
msgstr "tipo inválido"
#: codetoolsstrconsts:ctsinvalidvariablename
msgid "invalid variable name %s%s%s"
msgstr "nome de variável inválida %s%s%s"
#: codetoolsstrconsts:ctsinvalidvariabletype
msgid "invalid variable type %s%s%s"
msgstr "tipo de variável inválido %s%s%s"
#: codetoolsstrconsts:ctskeyword
msgid "keyword"
msgstr "palavra-chave"
#: codetoolsstrconsts:ctskeywordexampleexpectedbutatomfound
msgid "keyword (e.g. %s) expected, but %s found"
msgstr "palavra-chave (ex: %S) esperada, mas %s encontrado"
#: codetoolsstrconsts:ctskeywordin
msgid "keyword \"in\""
msgstr "palavra-chave \"in\""
#: codetoolsstrconsts:ctslazarusmaindirectory
msgid "lazarus main directory"
msgstr "diretório principal do lazarus"
#: codetoolsstrconsts:ctsmethodname
msgid "method name"
msgstr "nome de método"
#: codetoolsstrconsts:ctsmethodtypedefinitionnotfound
msgid "method type definition not found"
msgstr "método de tipo de definição não encontrado"
#: codetoolsstrconsts:ctsmissingpointafterend
msgid "missing . after end"
msgstr "faltando . depois do end"
#: codetoolsstrconsts:ctsmissingenumlist
msgid "missing enum list"
msgstr "lista enum faltando"
#: codetoolsstrconsts:ctsmissingtypeidentifier
msgid "missing type identifier"
msgstr "tipo de identificador faltando"
#: codetoolsstrconsts:ctsnewprocbodynotfound
msgid "new proc body not found"
msgstr "corpo novo de proc não encontrado"
#: codetoolsstrconsts:ctsnocontextnodefoundatcursor
msgid "no context node found at cursor"
msgstr "nenhum nó de contexto encontrado no cursor"
#: codetoolsstrconsts:ctsnopascalcodefound
msgid "no pascal code found (first token is %s)"
msgstr "nenhum código pascal encontrado (primeiro símbolo é %s)"
#: codetoolsstrconsts:ctsnonodefoundatcursor
msgid "no pascal node found at cursor (i.e. in unparsed code)"
msgstr "nó pascal não encontrado no cursor (corresponde à código sem processar)"
#: codetoolsstrconsts:ctsnodefaultspecifierdefinedtwice
msgid "nodefault specifier defined twice"
msgstr "especificador nodefault definido duas vezes"
#: codetoolsstrconsts:ctsoldmethodnotfound
msgid "old method not found: %s"
msgstr "antigo método não encontrado: %s"
#: codetoolsstrconsts:ctsprocedureorfunction
msgid "procedure or function"
msgstr "procedure ou função"
#: codetoolsstrconsts:ctsprocessorspecific
msgid "processor specific"
msgstr "processador especifico"
#: codetoolsstrconsts:ctspropertyspecifieralreadydefined
msgid "property specifier already defined: %s"
msgstr "especificador de propriedade definida: %s"
#: codetoolsstrconsts:ctsproperttypeexpectedbutatomfound
msgid "property type expected, but %s found"
msgstr "tipo de propriedade esperado, mas %s encontrado"
#: codetoolsstrconsts:ctsqualifierexpectedbutatomfound
msgid "qualifier expected but %s found"
msgstr "qualificador esperado mas %s encontrado"
#: codetoolsstrconsts:ctssemicolonnotfound
msgid "semicolon not found"
msgstr "semi-vírgula não encontrada"
#: codetoolsstrconsts:ctssetsincpathto
msgid "sets IncPath to %s"
msgstr "ajustar IncPath para %s"
#: codetoolsstrconsts:ctssetssrcpathto
msgid "sets SrcPath to %s"
msgstr "ajustar SrcPath para %s"
#: codetoolsstrconsts:ctssourceisnotunit
msgid "source is not unit"
msgstr "fonte não é uma unit"
#: codetoolsstrconsts:ctssourcenotfoundunit
msgid "source not found: unit %s"
msgstr "fonte não encontrado: unit %s"
#: codetoolsstrconsts:ctssrcpathforcompiledunits
msgid "src path for compiled units"
msgstr "caminho src para units compiladas"
#: codetoolsstrconsts:ctsstringconstant
msgid "string constant"
msgstr "constante de string"
#: codetoolsstrconsts:ctstypeidentifier
msgid "type identifier"
msgstr "tipo de identificador"
#: codetoolsstrconsts:ctstypesectionofclassnotfound
msgid "type section of class not found"
msgstr "seção de tipo de classe não encontrada"
#: codetoolsstrconsts:ctsunabletoapplychanges
msgid "unable to apply changes"
msgstr "impossível aplicar as mudanças"
#: codetoolsstrconsts:ctsunabletocompleteproperty
msgid "unable to complete property"
msgstr "impossível completar propriedade"
#: codetoolsstrconsts:ctsidentexpectedbuteoffound
msgid "unexpected end of file (identifier expected)"
msgstr "final de arquivo inesperado (identificador esperado)"
#: codetoolsstrconsts:ctsunexpectedendofsource
msgid "unexpected end of source"
msgstr "inesperado final do fonte"
#: codetoolsstrconsts:ctsunexpectedkeyword
msgid "unexpected keyword \"%s\""
msgstr "palavra-chave \"%s\""
#: codetoolsstrconsts:ctsunexpectedkeywordwhilereadingbackwards
msgid "unexpected keyword \"%s\" found while reading blocks backwards"
msgstr "palavra-chave \"%s\" inesperada enquanto se lia blocos para atrás"
#: codetoolsstrconsts:ctsunexpectedkeywordinasmblock
msgid "unexpected keyword \"%s\" in asm block found"
msgstr "palavra-chave \"%s\" inesperada em bloco asm encontrado"
#: codetoolsstrconsts:ctsunexpectedkeywordinbeginendblock
msgid "unexpected keyword \"%s\" in begin..end found"
msgstr "palavra-chave \"%s\" inesperada em begin..end encontrado"
#: codetoolsstrconsts:ctsunexpectedsubrangeoperatorfound
msgid "unexpected subrange operator '..' found"
msgstr "unexpected operador de sub-faixa '..' encontrado"
#: codetoolsstrconsts:ctsunitnotfound
msgid "unit not found: %s"
msgstr "unit não encontrado: %s"
#: codetoolsstrconsts:ctsunknownsectionkeyword
msgid "unknown section keyword %s found"
msgstr "seção de palavra-chave %s encontrada desconhecida"
#: codetoolsstrconsts:ctsusedunitisnotapascalunit
msgid "used unit is not a pascal unit"
msgstr "unit usada não é uma unit pascal"

View File

@ -3783,7 +3783,7 @@ var
CaretType: integer;
IgnorePos: TCodePosition;
begin
DebugLn(['TPascalParserTool.BuildTreeAndGetCleanPos ',MainFilename,' btSetIgnoreErrorPos=',btSetIgnoreErrorPos in BuildTreeFlags,' btKeepIgnoreErrorPos=',btKeepIgnoreErrorPos in BuildTreeFlags,' CursorPos=x=',CursorPos.X,',y=',CursorPos.Y]);
//DebugLn(['TPascalParserTool.BuildTreeAndGetCleanPos ',MainFilename,' btSetIgnoreErrorPos=',btSetIgnoreErrorPos in BuildTreeFlags,' btKeepIgnoreErrorPos=',btKeepIgnoreErrorPos in BuildTreeFlags,' CursorPos=x=',CursorPos.X,',y=',CursorPos.Y]);
if (btSetIgnoreErrorPos in BuildTreeFlags) then begin
// ignore errors after cursor position
if (CursorPos.Code<>nil) then begin

View File

@ -77,8 +77,8 @@ function ConvertRSTFiles(RSTDirectory, PODirectory: string): Boolean;
function ConvertRSTFile(const RSTFilename, OutputFilename: string): Boolean;
var
LazarusTranslations: TLazarusTranslations;
LazarusTranslations: TLazarusTranslations = nil;
SystemLanguageID1, SystemLanguageID2: string;
implementation
@ -367,25 +367,26 @@ begin
//debugln('TranslateResourceStrings A CustomLang=',CustomLang);
if LazarusTranslations=nil then CollectTranslations(BaseDirectory);
if CustomLang='' then begin
GetLanguageIDs(Lang,FallbackLang);
Lang:=SystemLanguageID1;
FallbackLang:=SystemLanguageID2;
end else begin
Lang:=CustomLang;
FallbackLang:='';
end;
//debugln('TranslateResourceStrings A Lang=',Lang,' FallbackLang=',FallbackLang);
Dir:=AppendPathDelim(BaseDirectory);
// LCL
TranslateUnitResourceStrings('LclStrConsts',
Dir+'lcl/languages/lcl'+Ext,Lang,FallbackLang);
// IDE without objectinspector
// IDE
TranslateUnitResourceStrings('LazarusIDEStrConsts',
Dir+'languages/lazaruside'+Ext,Lang,FallbackLang);
// objectinspector
// LCL
TranslateUnitResourceStrings('LclStrConsts',
Dir+'lcl/languages/lclstrconsts'+Ext,Lang,FallbackLang);
// IDEIntf
TranslateUnitResourceStrings('ObjInspStrConsts',
Dir+'ideintf/languages/objinspstrconsts'+Ext,Lang,FallbackLang);
// CodeTools
TranslateUnitResourceStrings('CodeToolsStrConsts',
Dir+'components/codetools/languages/codetools'+Ext,Lang,FallbackLang);
Dir+'components/codetools/languages/codetoolsstrconsts'+Ext,Lang,FallbackLang);
// SynEdit
TranslateUnitResourceStrings('SynEditStrConst',
Dir+'components/synedit/languages/synedit'+Ext,Lang,FallbackLang);
@ -394,7 +395,6 @@ begin
Dir+'components/synedit/languages/synmacrorecorder'+Ext,Lang,FallbackLang);
end;
{ TLazarusTranslations }
function TLazarusTranslations.GetItems(Index: integer): TLazarusTranslation;
@ -440,7 +440,8 @@ end;
initialization
LazarusTranslations:=nil;
GetLanguageIDs(SystemLanguageID1,SystemLanguageID2);
finalization
LazarusTranslations.Free;
LazarusTranslations:=nil;

View File

@ -3631,9 +3631,11 @@ Begin
UpdateDefaultPascalFileExtensions;
//DebugLn(['TMainIDE.DoShowEnvGeneralOptions OldLanguage=',OldLanguage,' EnvironmentOptions.LanguageID=',EnvironmentOptions.LanguageID]);
if OldLanguage<>EnvironmentOptions.LanguageID then
if OldLanguage<>EnvironmentOptions.LanguageID then begin
TranslateResourceStrings(EnvironmentOptions.LazarusDirectory,
EnvironmentOptions.LanguageID);
PkgBoss.TranslateResourceStrings;
end;
// set global variables
UpdateEnglishErrorMsgFilename;

View File

@ -84,6 +84,8 @@ var
// translate resource strings for one unit
procedure TranslateUnitResourceStrings(const ResUnitName, BaseFilename,
Lang, FallbackLang: string);
function TranslateUnitResourceStrings(const ResUnitName, AFilename: string
): boolean;
function UTF8ToSystemCharSet(const s: string): string;
{$ifndef MultiLocale} inline;{$endif}
procedure InitTranslation;
@ -147,7 +149,7 @@ begin
end;
{$endif ver2_0}
function DoTranslateUnitResourceStrings(const ResUnitName, AFilename: string
function TranslateUnitResourceStrings(const ResUnitName, AFilename: string
): boolean;
var
{$ifdef ver2_0}
@ -159,7 +161,7 @@ var
begin
Result:=false;
InitTranslation;
//debugln('DoTranslateUnitResourceStrings) ResUnitName="',ResUnitName,'" AFilename="',AFilename,'"');
//debugln('TranslateUnitResourceStrings) ResUnitName="',ResUnitName,'" AFilename="',AFilename,'"');
if (ResUnitName='') or (AFilename='') or (not FileExists(AFilename)) then
exit;
try
@ -176,7 +178,7 @@ begin
s:=GetResourceStringName(TableID,0);
if CompareText(ResUnitName+'.',LeftStr(s,length(ResUnitName)+1))<>0
then continue;
// translate all resource strings of the unit
for StringID := 0 to TableCount - 1 do begin
DefValue:=GetResourceStringDefaultValue(TableID,StringID);
@ -212,9 +214,9 @@ begin
//debugln('TranslateUnitResourceStrings BaseFilename="',BaseFilename,'"');
if (FallbackLang<>'') then
DoTranslateUnitResourceStrings(ResUnitName,Format(BaseFilename,[FallbackLang]));
TranslateUnitResourceStrings(ResUnitName,Format(BaseFilename,[FallbackLang]));
if (Lang<>'') then
DoTranslateUnitResourceStrings(ResUnitName,Format(BaseFilename,[Lang]));
TranslateUnitResourceStrings(ResUnitName,Format(BaseFilename,[Lang]));
end;
{ TPOFile }

View File

@ -49,8 +49,8 @@ rstconv -i $SynMacroRec_RST \
# LCL
LCL_RST=`find lcl/units -name lclstrconsts.rst | xargs ls -1t | head -1`;
rstconv -i $LCL_RST -o lcl/languages/lcl.po
./tools/updatepofiles lcl/languages/lcl.po
rstconv -i $LCL_RST -o lcl/languages/lclstrconsts.po
./tools/updatepofiles lcl/languages/lclstrconsts.po
# end.

View File

@ -66,6 +66,7 @@ type
procedure UpdateVisibleComponentPalette; virtual; abstract;
procedure ProcessCommand(Command: word; var Handled: boolean); virtual; abstract;
procedure OnSourceEditorPopupMenu(const AddMenuItemProc: TAddMenuItemProc); virtual; abstract;
procedure TranslateResourceStrings; virtual; abstract;
// files
function GetDefaultSaveDirectoryForFile(const Filename: string): string; virtual; abstract;

View File

@ -48,7 +48,8 @@ uses
Classes, SysUtils, LCLProc, LResources, Graphics,
AVL_Tree, Laz_XMLCfg,
DefineTemplates, CodeToolManager, EditDefineTree, CompilerOptions, Forms,
FileUtil, PropEdits, LazIDEIntf,
FileUtil,
PropEdits, LazIDEIntf, MacroIntf,
LazarusIDEStrConsts, IDEProcs, ComponentReg,
TransferMacros, FileReferenceList, PublishModule;
@ -601,6 +602,7 @@ type
FSourceDirectories: TFileReferenceList;
FStateFileDate: longint;
FTopologicalLevel: integer;
FTranslated: string;
FUpdateLock: integer;
FUsageOptions: TPkgAdditionalCompilerOptions;
FUserReadOnly: boolean;
@ -788,6 +790,7 @@ type
property SourceDirectories: TFileReferenceList read FSourceDirectories;
property StateFileDate: longint read FStateFileDate write FStateFileDate;
property TopologicalLevel: integer read FTopologicalLevel write FTopologicalLevel;
property Translated: string read FTranslated write FTranslated;
property UsageOptions: TPkgAdditionalCompilerOptions read FUsageOptions;
property UserReadOnly: boolean read FUserReadOnly write SetUserReadOnly;
end;
@ -2148,6 +2151,8 @@ procedure TLazPackage.SetAutoInstall(const AValue: TPackageInstallType);
begin
if FAutoInstall=AValue then exit;
FAutoInstall:=AValue;
if AutoCreated and (FAutoInstall<>pitStatic) then
DumpStack;
end;
procedure TLazPackage.SetAutoUpdate(const AValue: TPackageUpdatePolicy);
@ -3167,6 +3172,8 @@ function TLazPackage.GetRSTOutDirectory: string;
begin
Result:=TrimFilename(SubstitutePkgMacro(fRSTOutputDirectory,false));
LongenFilename(Result);
IDEMacros.SubstituteMacros(Result);
Result:=TrimFilename(Result);
end;
function TLazPackage.GetUnitPath(RelativeToBaseDir: boolean): string;

View File

@ -89,6 +89,7 @@ type
TPkgWriteMakeFile = function(APackage: TLazPackage): TModalResult of object;
TPkgUninstall = function(APackage: TLazPackage;
Flags: TPkgUninstallFlags): TModalResult of object;
TPkgTranslate = procedure(APackage: TLazPackage) of object;
TDependencyModifiedEvent = procedure(ADependency: TPkgDependency) of object;
TEndUpdateEvent = procedure(Sender: TObject; GraphChanged: boolean) of object;
TFindFPCUnitEvent = procedure(const UnitName, Directory: string;
@ -116,6 +117,7 @@ type
FOnDeletePackage: TPkgDeleteEvent;
FOnDependencyModified: TDependencyModifiedEvent;
FOnEndUpdate: TEndUpdateEvent;
FOnTranslatePackage: TPkgTranslate;
FOnUninstallPackage: TPkgUninstall;
FOnWriteMakeFile: TPkgWriteMakeFile;
FRegistrationFile: TPkgFile;
@ -326,6 +328,8 @@ type
read FOnDeleteAmbiguousFiles write FOnDeleteAmbiguousFiles;
property OnWriteMakeFile: TPkgWriteMakeFile read FOnWriteMakeFile
write FOnWriteMakeFile;
property OnTranslatePackage: TPkgTranslate read FOnTranslatePackage
write FOnTranslatePackage;
property OnUninstallPackage: TPkgUninstall read FOnUninstallPackage
write FOnUninstallPackage;
property Packages[Index: integer]: TLazPackage read GetPackages; default; // see Count for the number
@ -1097,6 +1101,7 @@ begin
PackageType:=lptRunAndDesignTime;
Installed:=pitStatic;
CompilerOptions.UnitOutputDirectory:='';
Translated:=SystemLanguageID1;
// add lazarus registration unit path
UsageOptions.UnitPath:=SetDirSeparators(
@ -1149,6 +1154,7 @@ begin
Installed:=pitStatic;
CompilerOptions.UnitOutputDirectory:='$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/';
RSTOutputDirectory:='languages';
Translated:=SystemLanguageID1;
// add requirements
AddRequiredDependency(FCLPackage.CreateDependencyWithOwner(Result));
@ -1185,6 +1191,7 @@ begin
AddFile('colorbox.pas','ColorBox',pftUnit,[pffHasRegisterProc],cpBase);
AddFile('buttonpanel.pas','ButtonPanel',pftUnit,[pffHasRegisterProc],cpBase);
AddFile('lresources.pp','LResources',pftUnit,[pffHasRegisterProc],cpBase);
AddFile('lclstrconsts.pas','LCLStrConsts',pftUnit,[],cpBase);
// increase priority by one, so that the LCL components are inserted to the
// left in the palette
for i:=0 to FileCount-1 do
@ -1226,6 +1233,7 @@ begin
Installed:=pitStatic;
CompilerOptions.UnitOutputDirectory:='';
RSTOutputDirectory:='languages';
Translated:=SystemLanguageID1;
// add requirements
AddRequiredDependency(LCLPackage.CreateDependencyWithOwner(Result));
@ -1284,6 +1292,7 @@ begin
Installed:=pitStatic;
CompilerOptions.UnitOutputDirectory:='';
RSTOutputDirectory:='languages';
Translated:=SystemLanguageID1;
// add requirements
AddRequiredDependency(FCLPackage.CreateDependencyWithOwner(Result));
@ -1359,6 +1368,7 @@ begin
Installed:=pitStatic;
CompilerOptions.UnitOutputDirectory:='';
RSTOutputDirectory:='languages';
Translated:=SystemLanguageID1;
// add requirements
AddRequiredDependency(LCLPackage.CreateDependencyWithOwner(Result));
@ -1421,6 +1431,7 @@ begin
PackageType:=lptDesignTime;
Installed:=pitStatic;
CompilerOptions.UnitOutputDirectory:='';
Translated:=SystemLanguageID1;
// add unit paths
UsageOptions.UnitPath:=SetDirSeparators('$(LazarusDir)/components/custom');
@ -3183,6 +3194,7 @@ begin
// register IDE built-in packages (Note: codetools do not need)
RegisterStaticPackage(FCLPackage,@RegisterFCL.Register);
RegisterStaticPackage(LCLPackage,@RegisterLCL.Register);
if Assigned(OnTranslatePackage) then OnTranslatePackage(CodeToolsPackage);
RegisterStaticPackage(SynEditPackage,@RegisterSynEdit.Register);
RegisterStaticPackage(IDEIntfPackage,@RegisterIDEIntf.Register);
@ -3205,7 +3217,10 @@ procedure TLazPackageGraph.RegisterStaticPackage(APackage: TLazPackage;
RegisterProc: TRegisterProc);
begin
if AbortRegistration then exit;
//DebugLn(['TLazPackageGraph.RegisterStaticPackage ',APackage.IDAsString]);
RegistrationPackage:=APackage;
if Assigned(OnTranslatePackage) then
OnTranslatePackage(APackage);
CallRegisterProc(RegisterProc);
APackage.Registered:=true;
RegistrationPackage:=nil;

View File

@ -46,6 +46,7 @@ uses
{$ENDIF}
// FCL, LCL
Classes, SysUtils, LCLProc, Forms, Controls, FileUtil, Dialogs, Menus,
StringHashList, Translations, GetText,
// codetools
CodeToolManager, CodeCache, BasicCodeTools, DefineTemplates,
AVL_Tree, Laz_XMLCfg,
@ -57,7 +58,7 @@ uses
EnvironmentOpts, MiscOptions, InputHistory, ProjectDefs, Project,
ComponentReg, UComponentManMain, PackageEditor, AddToPackageDlg, PackageDefs,
PackageLinks, PackageSystem, OpenInstalledPkgDlg, PkgGraphExplorer,
BrokenDependenciesDlg, CompilerOptions, ExtToolEditDlg,
BrokenDependenciesDlg, CompilerOptions, ExtToolEditDlg, IDETranslations,
TransferMacros, MsgView, BuildLazDialog, NewDialog, IDEDialogs,
ProjectInspector, ComponentPalette, UnitEditor, AddFileToAPackageDlg,
LazarusPackageIntf, PublishProjectDlg, InstallPkgSetDlg,
@ -188,6 +189,7 @@ type
procedure UpdateVisibleComponentPalette; override;
procedure ProcessCommand(Command: word; var Handled: boolean); override;
procedure OnSourceEditorPopupMenu(const AddMenuItemProc: TAddMenuItemProc); override;
procedure TranslateResourceStrings; override;
// files
function GetDefaultSaveDirectoryForFile(const Filename: string): string; override;
@ -273,6 +275,7 @@ type
function DoInstallPackage(APackage: TLazPackage): TModalResult;
function DoUninstallPackage(APackage: TLazPackage;
Flags: TPkgUninstallFlags): TModalResult;
procedure DoTranslatePackage(APackage: TLazPackage);
function DoOpenPackageSource(APackage: TLazPackage): TModalResult;
function DoCompileAutoInstallPackages(Flags: TPkgCompileFlags
): TModalResult; override;
@ -444,12 +447,12 @@ begin
PackageGraph.BeginUpdate(true);
try
// get all required packages
debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick GetAllRequiredPackages for ',DependencyListAsString(NewFirstAutoInstallDependency,pdlRequires));
//debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick GetAllRequiredPackages for ',DependencyListAsString(NewFirstAutoInstallDependency,pdlRequires));
if LoadDependencyList(NewFirstAutoInstallDependency)<>mrOk then exit;
PackageGraph.GetAllRequiredPackages(NewFirstAutoInstallDependency,PkgList);
// mark packages for installation
debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick mark packages for installation');
//debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick mark packages for installation');
for i:=0 to PkgList.Count-1 do begin
RequiredPackage:=TLazPackage(PkgList[i]);
if RequiredPackage.AutoInstall=pitNope then begin
@ -458,16 +461,17 @@ begin
end;
// mark packages for uninstall
debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick mark packages for uninstall');
//debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick mark packages for uninstall');
CurDependency:=FirstAutoInstallDependency;
while CurDependency<>nil do begin
if CurDependency.RequiredPackage<>nil then
if (CurDependency.RequiredPackage<>nil)
and (not CurDependency.RequiredPackage.AutoCreated) then
CurDependency.RequiredPackage.AutoInstall:=pitNope;
CurDependency:=CurDependency.NextRequiresDependency;
end;
// replace install list
debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick replace install list');
//debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick replace install list');
FreeDependencyList(FirstAutoInstallDependency,pdlRequires);
FirstAutoInstallDependency:=NewFirstAutoInstallDependency;
NewFirstAutoInstallDependency:=nil;
@ -476,7 +480,7 @@ begin
end;
// save package list
debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick save package list');
//debugln('TPkgManager.MainIDEitmPkgEditInstallPkgsClick save package list');
SortAutoInstallDependencies;
SaveAutoInstallDependencies(true);
@ -1704,6 +1708,7 @@ begin
PackageGraph.OnDeleteAmbiguousFiles:=@BuildBoss.DeleteAmbiguousFiles;
PackageGraph.OnWriteMakeFile:=@DoWriteMakefile;
PackageGraph.OnUninstallPackage:=@DoUninstallPackage;
PackageGraph.OnTranslatePackage:=@DoTranslatePackage;
// package editors
PackageEditors:=TPackageEditors.Create;
@ -1896,6 +1901,117 @@ begin
@OnOpenPackageForCurrentSrcEditFile);
end;
procedure TPkgManager.TranslateResourceStrings;
var
PkgList: TFPList;
i: Integer;
begin
PkgList:=nil;
OnGetAllRequiredPackages(FirstAutoInstallDependency,PkgList);
if PkgList=nil then exit;
for i:=0 to PkgList.Count-1 do
if TObject(PkgList[i]) is TLazPackage then
DoTranslatePackage(TLazPackage(PkgList[i]));
PkgList.Free;
end;
procedure TPkgManager.DoTranslatePackage(APackage: TLazPackage);
var
TranslatedUnits: TStringHashList;
function UnitTranslated(const AnUnitName: string): boolean;
begin
Result:=(TranslatedUnits<>nil) and (TranslatedUnits.Find(AnUnitName)>=0);
end;
procedure TranslateUnit(const AFilename, AnUnitName: string);
begin
//DebugLn(['TranslateUnit AFilename="',AFilename,'" AnUnitName="',AnUnitName,'"']);
if TranslatedUnits=nil then
TranslatedUnits:=TStringHashList.Create(false);
TranslatedUnits.Add(AnUnitName);
TranslateUnitResourceStrings(AnUnitName,AFilename);
end;
function GetPOFilenameParts(const Filename: string;
var UnitName, Language: string): boolean;
var
UnitNameEnd: Integer;
LangEnd: Integer;
begin
Result:=false;
UnitNameEnd:=1;
while (UnitNameEnd<=length(Filename)) and (Filename[UnitNameEnd]<>'.') do
inc(UnitNameEnd);
if (UnitNameEnd=1) then exit;
LangEnd:=UnitNameEnd+1;
while (LangEnd<=length(Filename)) and (Filename[LangEnd]<>'.') do
inc(LangEnd);
if LangEnd<>length(Filename)-2 then exit;
UnitName:=copy(Filename,1,UnitNameEnd-1);
Language:=copy(Filename,UnitNameEnd+1,LangEnd-UnitNameEnd-1);
Result:=IsValidIdent(UnitName) and (Language<>'');
//DebugLn(['GetPOFilenameParts UnitName=',UnitName,' Language=',Language,' Result=',Result]);
end;
procedure TranslateWithFileMask(APackage: TLazPackage;
const Directory, Language: string);
var
FileInfo: TSearchRec;
CurUnitName: string;
CurLang: string;
FileMask: String;
begin
if Language='' then exit;
FileMask:=Directory+'*.'+Language+'.po';
//DebugLn(['TranslateWithFileMask APackage=',APackage.IDAsString,' FileMask="',FileMask,'"']);
if SysUtils.FindFirst(FileMask,faAnyFile,FileInfo)=0
then begin
repeat
// check if special file
if (FileInfo.Name='.') or (FileInfo.Name='..') or (FileInfo.Name='') then
continue;
if GetPOFilenameParts(FileInfo.Name,CurUnitName,CurLang)
and (CurLang=Language)
and (APackage.FindUnit(CurUnitName)<>nil)
and not UnitTranslated(CurUnitName) then begin
TranslateUnit(Directory+FileInfo.Name,CurUnitName);
end;
until SysUtils.FindNext(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
end;
var
Directory: String;
Lang: String;
FallbackLang: String;
Language: String;
begin
if (APackage.RSTOutputDirectory='') then exit;
Directory:=AppendPathDelim(APackage.GetRSTOutDirectory);
Language:=EnvironmentOptions.LanguageID;
if Language='' then begin
Lang:=SystemLanguageID1;
FallbackLang:=SystemLanguageID2;
end else begin
Lang:=Language;
FallbackLang:='';
end;
if APackage.Translated=Lang then exit;
APackage.Translated:=Lang;
TranslatedUnits:=nil;
try
TranslateWithFileMask(APackage,Directory,Lang);
TranslateWithFileMask(APackage,Directory,FallbackLang);
finally
TranslatedUnits.Free;
end;
end;
function TPkgManager.AddPackageToGraph(APackage: TLazPackage;
Replace: boolean): TModalResult;
var