Package org.zanata.common

Examples of org.zanata.common.LocaleId


        return localeDAO.findByLocaleId(locale);
    }

    @Override
    public HLocale getByLocaleId(@Nonnull String localeId) {
        return this.getByLocaleId(new LocaleId(localeId));
    }
View Full Code Here


    public Set<HLocale> convertCustomizedLocale(Map<String, String> var) {
        Set<HLocale> result = new HashSet<HLocale>();
        for (String op : var.keySet()) {
            String[] list = op.split("\\[");
            String seVar = list[1].split("\\]")[0];
            HLocale entity = localeDAO.findByLocaleId(new LocaleId(seVar));
            result.add(entity);
        }
        return result;
    }
View Full Code Here

        }
        return result;
    }

    public HLocale getSourceLocale(String projectSlug, String iterationSlug) {
        return localeDAO.findByLocaleId(new LocaleId("en-US"));
    }
View Full Code Here

     *            filter constraints
     * @return list of matching text flows
     */
    private List<HTextFlow> findTextFlowsByDocumentPaths(WorkspaceId workspace,
            List<String> documentPaths, FilterConstraints constraints) {
        LocaleId localeId = workspace.getLocaleId();
        String projectSlug = workspace.getProjectIterationId().getProjectSlug();
        String iterationSlug =
                workspace.getProjectIterationId().getIterationSlug();

        // TODO consider whether to allow null and empty search strings.
View Full Code Here

        if (constraints.isSearchInSource()) {
            // Source locale
            // NB: Assume the first document's locale, or the same target locale
            // if there are no documents
            // TODO Move source locale to the Project iteration level
            LocaleId sourceLocaleId = localeId;
            HProjectIteration projectIteration =
                    projectIterationDAO.getBySlug(projectSlug, iterationSlug);
            if (!projectIteration.getDocuments().isEmpty()) {
                sourceLocaleId =
                        projectIteration.getDocuments().values().iterator()
                                .next().getLocale().getLocaleId();
            }

            // Content query for source
            String sourceAnalyzerName =
                    TextContainerAnalyzerDiscriminator
                            .getAnalyzerDefinitionName(sourceLocaleId.getId());
            Analyzer sourceAnalyzer =
                    entityManager.getSearchFactory().getAnalyzer(
                            sourceAnalyzerName);

            Query srcContentPhraseQuery;
View Full Code Here

    }

    public void joinOrUpdateRoleInLanguageTeam(String locale, Long personId,
            boolean isTranslator, boolean isReviewer, boolean isCoordinator)
            throws ZanataServiceException {
        LocaleId localeId = new LocaleId(locale);
        HPerson currentPerson = personDAO.findById(personId, false);

        boolean alreadyJoined =
                localeMemberDAO.isLocaleMember(personId, localeId);
        HLocaleMember localeMember;
View Full Code Here

        localeMemberDAO.makePersistent(localeMember);
        localeMemberDAO.flush();
    }

    public boolean leaveLanguageTeam(String locale, Long personId) {
        HLocale lang = localeDAO.findByLocaleId(new LocaleId(locale));
        HPerson currentPerson = personDAO.findById(personId, false);
        final HLocaleMember membership =
                localeMemberDAO.findById(new HLocaleMemberPk(currentPerson,
                        lang), true);
View Full Code Here

                localeIds[i] = loc.getLocaleId();
            }
        } else {
            localeIds = new LocaleId[locales.length];
            for (int i = 0; i < locales.length; i++) {
                localeIds[i] = new LocaleId(locales[i]);
            }
        }

        HProjectIteration iteration =
                projectIterationDAO.getBySlug(projectSlug, iterationSlug);
View Full Code Here

                localeIds[i] = loc.getLocaleId();
            }
        } else {
            localeIds = new LocaleId[locales.length];
            for (int i = 0; i < locales.length; i++) {
                localeIds[i] = new LocaleId(locales[i]);
            }
        }

        HDocument document =
                documentDAO.getByProjectIterationAndDocId(projectSlug,
View Full Code Here

                        version.getId(), person.getId(), fromDate, toDate);

        for (Object[] entry : data) {
            int count = ((BigDecimal) entry[0]).intValue();
            ContentState state = ContentState.values()[(int) entry[1]];
            LocaleId localeId = new LocaleId(entry[2].toString());

            BaseTranslationCount stats;
            if (localeStatistics.containsKey(localeId)) {
                stats = localeStatistics.get(localeId);
            } else {
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.