Package org.zanata.common

Examples of org.zanata.common.LocaleId


        // only message1 has translation
        TranslationsResource translationsResource =
                buildTranslationResource(buildTextFlowTarget("hello",
                        "translated"));
        restCaller.postTargetDocResource(projectSlug, iterationSlug, "prop1",
                new LocaleId("pl"), translationsResource, "auto");

        // dryRun creates nothing
        File transDir = Files.createTempDir();
        client.callWithTimeout(workDir,
                "mvn -B org.zanata:zanata-maven-plugin:pull -DdryRun -Dzanata.userConfig="
View Full Code Here


            transResource.getTextFlowTargets().add(
                    buildTextFlowTarget(resId, content));
        }
        restCaller.asyncPushSource(projectSlug, iterationSlug, sourceResource, false);
        restCaller.asyncPushTarget(projectSlug, iterationSlug, docId,
                new LocaleId("pl"), transResource, "import");

        assertThat(true, Matchers.is(true));

        // create another version
        restCaller.createProjectAndVersion(projectSlug, "2", projectType);
        restCaller.asyncPushSource(projectSlug, "2", sourceResource, false);
        restCaller.asyncPushTarget(projectSlug, "2", docId, new LocaleId("pl"),
                transResource, "import");

        // push to old version again
        restCaller.asyncPushSource(projectSlug, iterationSlug, sourceResource,
                COPYTRANS);
View Full Code Here

            transResource.getTextFlowTargets().add(
                    buildTextFlowTarget(resId, content));
        }
        restCaller.asyncPushSource(projectSlug, iterationSlug, sourceResource,
                false);
        LocaleId localeId = new LocaleId("pl");
        restCaller.asyncPushTarget(projectSlug, iterationSlug, docId,
                localeId, transResource, "auto");
        restCaller.runCopyTrans(projectSlug, iterationSlug, docId);

        assertThat(true, Matchers.is(true));
View Full Code Here

        for (Object[] count : stats) {
            TransUnitWords stat;
            ContentState state = (ContentState) count[0];
            Long word = (Long) count[1];
            LocaleId locale = (LocaleId) count[2];
            if (!result.containsKey(locale.getId())) {
                stat = new TransUnitWords();
                result.put(locale.getId(), stat);
            } else {
                stat = result.get(locale.getId());
            }

            stat.set(state, word.intValue());
        }
View Full Code Here

                new HashMap<String, TransUnitCount>();

        for (Map row : stats) {
            ContentState state = (ContentState) row.get("state");
            Long count = (Long) row.get("count");
            LocaleId localeId = (LocaleId) row.get("locale");

            TransUnitCount transUnitCount = retVal.get(localeId.getId());
            if (transUnitCount == null) {
                transUnitCount = new TransUnitCount();
                retVal.put(localeId.getId(), transUnitCount);
            }

            transUnitCount.set(state, count.intValue());
        }
View Full Code Here

        htmlMessage = "";
    }

    public void setLanguage(String language) {
        this.language = language;
        locale = localeServiceImpl.getByLocaleId(new LocaleId(language));
    }
View Full Code Here

    @Test
    public void canGetReviewComments() {
        GetTranslationHistoryAction action =
                new GetTranslationHistoryAction(new TransUnitId(1L));
        action.setWorkspaceId(TestFixture.workspaceId());
        LocaleId localeId = action.getWorkspaceId().getLocaleId();
        when(
                reviewCommentsDAO.getReviewComments(action.getTransUnitId(),
                        localeId)).thenReturn(
                Lists.newArrayList(makeCommentEntity(localeId, "a comment"),
                        makeCommentEntity(localeId, "another comment")));
View Full Code Here

        if (hasAdapterFor(fileName)) {
            FileFormatAdapter adapter = getAdapterFor(fileName);
            Resource doc;
            try {
                doc =
                        adapter.parseDocumentFile(documentFile, new LocaleId(
                                "en"), params);
            } catch (FileFormatAdapterException e) {
                throw new ZanataServiceException(
                        "Error parsing document file: " + fileName, e);
            }
View Full Code Here

            boolean offlinePo) {
        PoReader2 poReader = new PoReader2(offlinePo);
        // assume english as source locale
        Resource res =
                poReader.extractTemplate(new InputSource(fileContents),
                        new LocaleId("en"), docId);
        return res;
    }
View Full Code Here

    public List<LocaleId> getAllJavaLanguages() {
        ULocale[] locales = ULocale.getAvailableLocales();
        List<LocaleId> addedLocales = new ArrayList<LocaleId>();
        for (ULocale locale : locales) {
            String id = locale.toLanguageTag();
            LocaleId localeId = new LocaleId(id);
            addedLocales.add(localeId);
        }
        return addedLocales;
    }
View Full Code Here

TOP

Related Classes of org.zanata.common.LocaleId

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.