Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...


Agora a literal de tradução está mais simplificadasimples, conforme apresentado pela tabela abaixo.

...

Para não prejudicar o legado já desenvolvido em Flex, na utilização da metodologia de tradução, foram reaproveitados os métodos já existentes.

São eles: 

  1. Classe I18nUtil.as
    Método getLabel

    Bloco de código
    themeEclipse
    languagejavascript
    linenumberstrue
    public static function getLabel(label:String, stringID:String=null):String {
    	var uLabel:String = "";
    	var runtimeMode:String = PropertyUtil.getInstance().getProperty("runtime.mode", "production");
    	var trans:String = "";
    	if(stringID==null){
    		if(label!=null){
    			uLabel = stringReplaceAll(label, " ", "_");
    			trans = I18NService.translate(uLabel);	
    		}else{
    			label = "";
    		}				
    		
    		if(trans == uLabel){
    			trans = label;
    		}				
    	}else{
    		uLabel = stringReplaceAll(stringID, " ", "_");
            trans = I18NService.translate(uLabel);
                    
            if (trans == uLabel) {
                trans = label;
                if (runtimeMode != "production") {
                    trans += "#";
                }
            }
    	}
    	
    	return trans;
    }


  2. Classe I18NService.as
    Método translate

    Bloco de código
    themeEclipse
    languagejavascript
    linenumberstrue
    public static function translate(key:String):String {
    	var result:String = strings.getValue(key) as String;
    	
    	if (result == null) {	
    		result = literals[key] as String;				
    	}
    	
    	if(result == null){
    		result = key;
    	}
    	
    	return result;
    }



...

Bloco de código
languagenone
DEFINE VARIABLE translatedText AS CHARACTER. 
translatedText = GET-TRANSLATION("universal.close.button").

...

Novo:

Bloco de código
languagenone
DEFINE VARIABLE translatedText AS CHARACTER. 
translatedText = GET-TRANSLATION("Fechar").

...