#OTHER expecco_2_8_0 expecco_2_8_0a expecco_2_8_0b
authorStefan Vogel <sv@exept.de>
Tue, 15 Dec 2015 15:04:07 +0100
changeset 3248e92c9691ef33
parent 3247 ef343ef8ebad
child 3249 a322cc9c9193
#OTHER
class: Tools::InternationalLanguageTranslationEditor
changed:
#extractTranslationsFromClass:
#extractTranslationsFromMenuSpecMethod:
Do not translte subMenu labels
Tools__InternationalLanguageTranslationEditor.st
     1.1 --- a/Tools__InternationalLanguageTranslationEditor.st	Mon Dec 14 22:11:05 2015 +0100
     1.2 +++ b/Tools__InternationalLanguageTranslationEditor.st	Tue Dec 15 15:04:07 2015 +0100
     1.3 @@ -2151,12 +2151,15 @@
     1.4      newTranslations := Set new.
     1.5  
     1.6      self withWaitCursorDo:[
     1.7 -	"/ now, the hard part:
     1.8 -	"/ possible translations are in the specs,
     1.9 -	"/ and all arguments to (resources string:) messages.
    1.10 -	aClass instAndClassMethodsDo:[:eachMethod |
    1.11 -	    newTranslations addAll:( self extractTranslationsFromMethod:eachMethod ).
    1.12 -	].
    1.13 +        "/ now, the hard part:
    1.14 +        "/ possible translations are in the specs,
    1.15 +        "/ and all arguments to (resources string:) messages.
    1.16 +        aClass instAndClassMethodsDo:[:eachMethod |
    1.17 +            newTranslations addAll:( self extractTranslationsFromMethod:eachMethod ).
    1.18 +        ].
    1.19 +    ].
    1.20 +    newTranslations := newTranslations select:[:eachTranslation|
    1.21 +        (aClass resources at:eachTranslation ifAbsent:nil) isNil
    1.22      ].
    1.23      ^ newTranslations
    1.24  !
    1.25 @@ -2225,16 +2228,16 @@
    1.26      menu isNil ifTrue:[ ^ #() ].
    1.27  
    1.28      (menu isKindOf:Menu) ifFalse:[
    1.29 -	menu := Menu new fromLiteralArrayEncoding:menu
    1.30 +        menu := Menu new fromLiteralArrayEncoding:menu
    1.31      ].
    1.32  
    1.33      resourceKeys := Set new.
    1.34      menu allItemsDo:[:aMenuItem |
    1.35 -	aMenuItem translateLabel ifTrue:[
    1.36 -	    aMenuItem isSeparatorItem ifFalse:[
    1.37 -		resourceKeys add:aMenuItem label.
    1.38 -	    ]
    1.39 -	]
    1.40 +        aMenuItem translateLabel ifTrue:[
    1.41 +            (aMenuItem isSeparatorItem or:[aMenuItem isMenuSlice])  ifFalse:[
    1.42 +                resourceKeys add:aMenuItem label.
    1.43 +            ]
    1.44 +        ]
    1.45      ].
    1.46      ^ resourceKeys
    1.47  !