Examples of LanguageFile


Examples of com.aaspring.translation.model.LanguageFile

    Exporter.export(ls, locales, new Callback<LocaleItem>() {
      int i = 0;

      public void processItem(final LocaleItem item) {
        i++;
        LanguageFile lf = item.getLanguageFile();
        String key = item.getKey();
        Map<Locale, String> values = item.getValues();
        HSSFRow row = sheet.createRow(i);

        for (Attribute attr : lf.getAttribute()) {
          int attributeIndex = attributeIds.indexOf(attr.getId());
          if (attributeIndex >= 0) {
            row.createCell((short) attributeIndex).setCellValue(
                new HSSFRichTextString(attr.getContent()));
          }
        }
        int attrSize = attributeIds.size();

        row.createCell((short) (attrSize)).setCellValue(
            new HSSFRichTextString(lf.getId()));

        row.createCell((short) (attrSize + 1)).setCellValue(
            new HSSFRichTextString(key));

        for (int j = 0; j < locales.length; j++) {
View Full Code Here

Examples of com.aaspring.translation.model.LanguageFile

    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()) {
          bundle.setValue(key, keyValueMap.get(key));
        }
        try {
          bundle.exportCurrent(outStreamMap.get(fap));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.