Tools__InternationalLanguageTranslationEditor.st
changeset 3187 3fcd97a56a0e
parent 3077 48211023a3c7
child 3189 4f828e688bf5
equal deleted inserted replaced
3186:80a20e5881a5 3187:3fcd97a56a0e
  1682 !
  1682 !
  1683 
  1683 
  1684 extractTranslationsFromProject
  1684 extractTranslationsFromProject
  1685     |box projectID newTranslations|
  1685     |box projectID newTranslations|
  1686 
  1686 
  1687     box := ListSelectionBox new.
  1687     projectID := Dialog requestProject:(resources string:'Package to extract translations from:') initialAnswer:(lastExtractedProject ? LastExtractedProject) suggestions:(lastExtractedProject ? LastExtractedProject).
  1688 "/    box useComboBoxWithList:(Smalltalk allProjectIDs).
       
  1689     box title:(resources string:'Project to extract translations from:').
       
  1690     box list:Smalltalk allProjectIDs.
       
  1691     box okAction:[:sel | projectID := sel].
       
  1692     box initialText:(lastExtractedProject ? LastExtractedProject).
       
  1693     box label:'Find Translations in Project'.
       
  1694 
       
  1695     box showAtPointer.
       
  1696 
       
  1697     projectID notNil ifTrue:[
  1688     projectID notNil ifTrue:[
  1698 	projectID := projectID withoutSeparators asSymbol.
  1689         projectID := projectID withoutSeparators asSymbol.
  1699     ].
  1690     ].
  1700     projectID isEmptyOrNil ifTrue:[^ self ].
  1691     projectID isEmptyOrNil ifTrue:[^ self ].
  1701 
  1692 
  1702     lastExtractedProject := LastExtractedProject := projectID.
  1693     lastExtractedProject := LastExtractedProject := projectID.
  1703 
  1694 
  1704     newTranslations := Set new.
  1695     newTranslations := Set new.
  1705 
  1696 
  1706     Smalltalk allClassesDo:[:eachClass |
  1697     Smalltalk allClassesDo:[:eachClass |
  1707 	eachClass theNonMetaclass package == projectID ifTrue:[
  1698         eachClass theNonMetaclass package == projectID ifTrue:[
  1708 "/ eachClass isLoaded ifTrue:[ self halt. ].
  1699 "/ eachClass isLoaded ifTrue:[ self halt. ].
  1709 	    newTranslations addAll:( self extractTranslationsFromClass:eachClass theNonMetaclass).
  1700             newTranslations addAll:( self extractTranslationsFromClass:eachClass theNonMetaclass).
  1710 	]
  1701         ]
  1711     ].
  1702     ].
  1712 
  1703 
  1713     self addAllTranslations:newTranslations.
  1704     self addAllTranslations:newTranslations.
       
  1705 
       
  1706     "Modified: / 16-02-2015 / 16:54:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1714 !
  1707 !
  1715 
  1708 
  1716 importExistingTranslationsFromFile
  1709 importExistingTranslationsFromFile
  1717     self information:'The import function is not available in this release'.
  1710     self information:'The import function is not available in this release'.
  1718 !
  1711 !