Package org.olat.core.util.i18n

Examples of org.olat.core.util.i18n.I18nItem


   * @param toBeActivatedItem
   */
  public void initialzeI18nitemAsCurrentItem(UserRequest ureq, I18nItem toBeActivatedItem) {
    // find item in list
    for (int i = 0; i < i18nItems.size(); i++) {
      I18nItem item = (I18nItem) i18nItems.get(i);
      if (item.equals(toBeActivatedItem)) {
        currentItemPosition = i;
        currentItem = i18nItems.get(currentItemPosition);
        initOrUpdateCurrentItem(ureq);
        return;
      }
View Full Code Here


   * org.olat.core.gui.components.form.flexible.impl.FormEvent)
   */
  protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == bundlesSelection) {
      for (int i = 0; i < i18nItems.size(); i++) {
        I18nItem item = i18nItems.get(i);
        if (item.getBundleName().equals(bundlesSelection.getSelectedKey())) {
          currentItemPosition = i;
          currentItem = item;
          break;
        }
      }
      // in new bundle, load new keys to prevent problem in update method
      updateKeysSelectionAndProgress();
      // update everything
      initOrUpdateCurrentItem(ureq);

    } else if (source == keysSelection) {
      for (int i = 0; i < i18nItems.size(); i++) {
        I18nItem item = i18nItems.get(i);
        if (item.getBundleName().equals(bundlesSelection.getSelectedKey()) && item.getKey().equals(keysSelection.getSelectedKey())) {
          currentItemPosition = i;
          currentItem = item;
          break;
        }
      }
View Full Code Here

      FormLink link = (FormLink) source;
      TranslationToolI18nItemEditCrumbController i18nItemEditCrumbCtr = new TranslationToolI18nItemEditCrumbController(ureq,
          getWindowControl(), i18nItems, referenceLocale, customizingMode);
      activateAndListenToChildCrumbController(i18nItemEditCrumbCtr);
      // Set item from link as to be activated item
      I18nItem firstBundleItem = (I18nItem) link.getUserObject();
      i18nItemEditCrumbCtr.initialzeI18nitemAsCurrentItem(ureq, firstBundleItem);
    }
  }
View Full Code Here

    checkForEmptyPropertyAndDelete(locale, bundleName);
    checkForEmptyBundleAndDelete(bundleName);
  }

  private void addKey(Locale locale, String bundleName, String key, String value) {
    I18nItem i18nItem = new I18nItem(bundleName, key, locale, I18nManager.DEFAULT_BUNDLE_PRIORITY, I18nManager.DEFAULT_KEY_PRIORITY);
    i18nMgr.saveOrUpdateI18nItem(i18nItem, value);
  }
View Full Code Here

      //get All items from sourceLocale, copy to targetLocale and delete sourceLocale
      List<I18nItem> items = i18nMgr.findExistingI18nItems(sourceLocale, null, true);
      for (I18nItem item : items) {
        String bundleName = item.getBundleName();
        String itemKey = item.getKey();
        I18nItem targetTempItem = new I18nItem(bundleName, itemKey, targetLocale, item.getBundlePriority(), item.getKeyPriority());
        Properties prop = i18nMgr.getPropertiesWithoutResolvingRecursively(sourceLocale, bundleName);
        String value = prop.getProperty(itemKey);
        i18nMgr.saveOrUpdateI18nItem(targetTempItem, value);
        deleteKey(sourceLocale, bundleName, itemKey);
      }     
View Full Code Here

    return doupList;
  }
 
 
  public I18nItem searchForReusableItemByKey(String key){
    I18nItem resultItem = null;
   
   
    return resultItem;
  }
View Full Code Here

TOP

Related Classes of org.olat.core.util.i18n.I18nItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.