Package com.aaspring.translation.model

Examples of com.aaspring.translation.model.Path


    }

    FileAccessor fac = new FileAccessorContainer();

    for (LanguageFile lf : ls.getLanguageFiles().getLanguageFile()) {
      Path path = lf.getPath();
      String basePathId = path.getBasePathId();
      Map<String, String> propsOfPath = getPropertiesOfPath(path,
          basePaths.get(basePathId));
      for (Locale locale : locales) {
        for (Locale currentLocale : getLocaleWithParents(locale)) {
          try {
            fac.addFile(new FileAccessorProperties(propsOfPath,
                path.getType(), currentLocale));
          } catch (InvalidStateException e) {
            throw new RuntimeException("Should never happen", e);
          }
        }
      }
    }

    for (LanguageFile lf : ls.getLanguageFiles().getLanguageFile()) {
      Path path = lf.getPath();
      String basePathId = path.getBasePathId();
      Map<String, String> propsOfPath = getPropertiesOfPath(path,
          basePaths.get(basePathId));
      List<Bundle> bundles = new ArrayList<Bundle>(locales.length);
      for (Locale locale : locales) {
        bundles.add(BundleFactory.getBundle(new BundleProps(
            new FileAccessorProperties(propsOfPath, path.getType(),
                locale)), lf.getType().value(), fac));
      }
      Enumeration<String> keys = bundles.get(0).getKeys();
      while (keys.hasMoreElements()) {
        String key = keys.nextElement();
View Full Code Here


    FileAccessor fac = new FileAccessorContainer();

    for (String field : fieldKeyLocaleValueMap.keySet()) {

      LanguageFile lf = lfById.get(field);
      Path path = lf.getPath();
      String basePathId = path.getBasePathId();
      Map<String, String> propsOfPath = getPropertiesOfPath(path,
          basePaths.get(basePathId));
      for (Locale targetLocale : localeMapping.values()) {
        try {
          fac.addFile(new FileAccessorProperties(propsOfPath, path
              .getType(), targetLocale));
        } catch (InvalidStateException e) {
          // Should never happen
          e.printStackTrace();
        }
      }
    }

    Map<FileAccessorProperties, OutputStream> outStreamMap = fac
        .getOutputStreams();
    for (String field : fieldKeyLocaleValueMap.keySet()) {
      LanguageFile lf = lfById.get(field);
      Path path = lf.getPath();
      String basePathId = path.getBasePathId();
      Map<String, String> propsOfPath = getPropertiesOfPath(path,
          basePaths.get(basePathId));
      Map<Locale, Map<String, String>> localeKeyValueMap = fieldKeyLocaleValueMap
          .get(field);
      for (Locale sourceLocale : localeMapping.keySet()) {
        Map<String, String> keyValueMap = localeKeyValueMap
            .get(sourceLocale);
        FileAccessorProperties fap = new FileAccessorProperties(
            propsOfPath, path.getType(), localeMapping
                .get(sourceLocale));

        Bundle bundle = BundleFactory.createEmptyBundle(
            new BundleProps(fap), lf.getType().value());
        for (String key : keyValueMap.keySet()) {
View Full Code Here

TOP

Related Classes of com.aaspring.translation.model.Path

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.