2012-11-08 1 views

답변

2

예를 찾을 수 있습니다. (번들 및 병합 기본 저장 새 로컬 리 제이션 병합 L10N (이 객체는 hashTable 임)

if (themeName != null && !themeName.equals(this.currThemeName)) { 
      try { 
       if (themeName.equals(DEFAULT_THEME_NAME)) { 
        defaultTheme = Resources.open(DEFAULT_THEME_NAME); 
        bundle = null; 
       } else { 
        defaultTheme = Resources.open(DEFAULT_THEME_NAME); 
        bundle = Resources.open(themeName); 
       } 
       mergeL10N = defaultTheme.getL10N("Localization (L10N) 1", "iw"); 
       if (bundle != null) { 
        mergeHashtable(mergeL10N, bundle.getL10N("Localization (L10N) 1", "iw")); 
       } 
        UIManager.getInstance().setResourceBundle(mergeL10N); 

             } 
      } catch (Exception e) { 
       e.printStackTrace(); 
      } 
     } 
1

당신은 당신의 입술을 열고 사용하려는 테이블을 사용해야합니다, 여기 당신이 코드는 하나에 두 개의 diffrent 지역화를 병합 할 수 있습니다

try { 
     Constants.res = Resources.open("/Lang.res"); 
    } catch (Exception e){ 
     System.err.println("can't load resource file:" + e); 
    } 
Hashtable h = Constants.res.getL10N("English.res","en");