Examples of TransUnit


Examples of com.dubture.symfony.index.model.TransUnit

    List<TransUnit> translations = new ArrayList<TransUnit>();

    while (it.hasNext()) {
      String key = (String) it.next();
      String value = transUnits.get(key);
      TransUnit unit = new TransUnit(key, value, lang);
      translations.add(unit);
    }

    indexTranslations(translations);
  }
View Full Code Here

Examples of org.zanata.rest.editor.dto.TransUnit

        for (HTextFlow htf : hTextFlows) {
            LocaleId localeId = htf.getDocument().getLocale().getLocaleId();
            EditorTextFlow tf = new EditorTextFlow(htf.getResId(), localeId);
            transUnitUtils.transferToTextFlow(htf, tf);
            transUnits.put(htf.getId().toString(), new TransUnit(tf));
        }
        return Response.ok(transUnits).build();
    }
View Full Code Here

Examples of org.zanata.rest.editor.dto.TransUnit

    }

    public TransUnit buildTransUnitFull(@Nonnull HTextFlow hTf,
            HTextFlowTarget hTft, LocaleId localeId) {

        TransUnit tu = new TransUnit();

        // build source
        tu.putAll(buildSourceTransUnit(hTf, localeId));

        // build target
        tu.putAll(buildTargetTransUnit(hTf, hTft, localeId));

        return tu;
    }
View Full Code Here

Examples of org.zanata.rest.editor.dto.TransUnit

        return tu;
    }

    public TransUnit buildSourceTransUnit(HTextFlow hTf, LocaleId localeId) {
        TransUnit tu = new TransUnit();
        EditorTextFlow tf =
                new EditorTextFlow(hTf.getResId(), localeId);
        transferToTextFlow(hTf, tf);
        tu.put(TransUnit.SOURCE, tf);
        return tu;
    }
View Full Code Here

Examples of org.zanata.rest.editor.dto.TransUnit

        return tu;
    }

    public TransUnit buildTargetTransUnit(HTextFlow hTf, HTextFlowTarget hTft,
            LocaleId localeId) {
        TransUnit tu = new TransUnit();

        if (hTft != null) {
            TextFlowTarget target = new TextFlowTarget(hTf.getResId());
            resourceUtils.transferToTextFlowTarget(hTft, target,
                    Optional.of("Editor"));
            tu.put(hTft.getLocaleId().toString(), target);
        } else {
            tu.put(localeId.toString(),
                    new TextFlowTarget(hTf.getResId()));
        }
        return tu;
    }
View Full Code Here

Examples of org.zanata.rest.editor.dto.TransUnit

        List<Object[]> results =
                textFlowDAO.getTextFlowAndTarget(idList, locale.getId());

        for (Object[] result : results) {
            HTextFlow textFlow = (HTextFlow) result[0];
            TransUnit tu;

            if (result.length < 2 || result[1] == null) {
                tu = transUnitUtils.buildTransUnitFull(textFlow, null,
                        locale.getLocaleId());
            }
View Full Code Here

Examples of org.zanata.rest.editor.dto.TransUnit

        List<Object[]> results =
                textFlowDAO.getTextFlowAndTarget(idList, locale.getId());

        for (Object[] result : results) {
            HTextFlow hTextFlow = (HTextFlow) result[0];
            TransUnit tu;
            if (result.length < 2 || result[1] == null) {
                tu = transUnitUtils.buildTargetTransUnit(
                        hTextFlow, null, locale.getLocaleId());
            } else {
                HTextFlowTarget hTarget = (HTextFlowTarget) result[1];
View Full Code Here

Examples of org.zanata.webtrans.shared.model.TransUnit

                    matchingTUs.get(textFlow.getDocument().getId());
            if (listForDoc == null) {
                listForDoc = new ArrayList<TransUnit>();
            }

            TransUnit transUnit =
                    transUnitTransformer.transform(textFlow, hLocale);
            listForDoc.add(transUnit);
            matchingTUs.put(textFlow.getDocument().getId(), listForDoc);
            docPaths.put(textFlow.getDocument().getId(), textFlow.getDocument()
                    .getDocId());
View Full Code Here

Examples of org.zanata.webtrans.shared.model.TransUnit

            return;
        }

        TransUnitTransformer transUnitTransformer =
                serviceLocator.getInstance(TransUnitTransformer.class);
        TransUnit transUnit =
                transUnitTransformer.transform(textFlow, target,
                        target.getLocale());

        DocumentId documentId =
                new DocumentId(document.getId(), document.getDocId());
        int wordCount = textFlow.getWordCount().intValue();

        TransUnitUpdateInfo updateInfo =
                createTransUnitUpdateInfo(transUnit, documentId, wordCount,
                        previousVersionNum, previousState);

        CacheValue context =
                updateContext.getIfPresent(new CacheKey(transUnit.getId(),
                        transUnit.getLocaleId()));
        TransUnitUpdated updated;
        if (context != null) {
            updated =
                    new TransUnitUpdated(updateInfo, context.editorClientId,
                            context.updateType);
View Full Code Here

Examples of org.zanata.webtrans.shared.model.TransUnit

    /**
     * Check if the editor is ready and selected. See gotoRow in
     * TargetContentsPresenter
     */
    private void copyTranslationToEditor() {
        TransUnit selectedTransUnit = navigationService.getSelectedOrNull();

        if (selectedTransUnit != null
                && selectedTransUnit.getId().equals(transUnitId)) {
            timer.cancel();
            eventBus.fireEvent(new CopyDataToEditorEvent(targets));
            if(saveAsFuzzyOpt) {
                listener.saveAsFuzzy(transUnitId);
            }
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.