Examples of HLocale


Examples of org.zanata.model.HLocale

        localeDAO.flush();
    }

    @Override
    public void disable(@Nonnull LocaleId localeId) {
        HLocale entity = localeDAO.findByLocaleId(localeId);
        if (entity != null) {
            entity.setActive(false);
            localeDAO.makePersistent(entity);
            localeDAO.flush();
        }
    }
View Full Code Here

Examples of org.zanata.model.HLocale

        }
        return addedLocales;
    }

    public void enable(@Nonnull LocaleId localeId) {
        HLocale entity = localeDAO.findByLocaleId(localeId);
        if (entity != null) {
            entity.setActive(true);
            localeDAO.makePersistent(entity);
            localeDAO.flush();
        }
    }
View Full Code Here

Examples of org.zanata.model.HLocale

            localeDAO.flush();
        }
    }

    public boolean localeExists(@Nonnull LocaleId locale) {
        HLocale entity = localeDAO.findByLocaleId(locale);
        return entity != null;
    }
View Full Code Here

Examples of org.zanata.model.HLocale

        return locales;
    }

    @Override
    public boolean localeSupported(@Nonnull LocaleId locale) {
        HLocale entity = localeDAO.findByLocaleId(locale);
        return entity != null && entity.isActive();
    }
View Full Code Here

Examples of org.zanata.model.HLocale

    @Override
    public @Nonnull
    HLocale validateLocaleByProject(@Nonnull LocaleId locale,
            @Nonnull String project) throws ZanataServiceException {
        List<HLocale> allList = getSupportedLanguageByProject(project);
        HLocale hLocale = localeDAO.findByLocaleId(locale);
        if (hLocale == null || !hLocale.isActive()) {
            throw new ZanataServiceException("Locale " + locale.getId()
                    + " is not enabled on this server. Please contact admin.",
                    403);
        }
        if (!allList.contains(hLocale)) {
View Full Code Here

Examples of org.zanata.model.HLocale

    HLocale validateLocaleByProjectIteration(@Nonnull LocaleId locale,
            @Nonnull String project, @Nonnull String iterationSlug)
            throws ZanataServiceException {
        List<HLocale> allList =
                getSupportedLanguageByProjectIteration(project, iterationSlug);
        HLocale hLocale = localeDAO.findByLocaleId(locale);
        if (hLocale == null || !hLocale.isActive()) {
            throw new ZanataServiceException("Locale " + locale.getId()
                    + " is not enabled on this server. Please contact admin.",
                    403);
        }
        if (!allList.contains(hLocale)) {
View Full Code Here

Examples of org.zanata.model.HLocale

    }

    @Override
    public HLocale validateSourceLocale(LocaleId locale)
            throws ZanataServiceException {
        HLocale hLocale = getByLocaleId(locale);
        if (hLocale == null || !hLocale.isActive()) {
            throw new ZanataServiceException("Locale " + locale.getId()
                    + " is not enabled on this server. Please contact admin.",
                    403);
        }
        return hLocale;
View Full Code Here

Examples of org.zanata.model.HLocale

    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

Examples of org.zanata.model.HLocale

        // TODO consider whether to allow null and empty search strings.
        // May want to fork to use a different method to retrieve all targets if
        // empty targets are required.

        // check that locale is valid for the workspace
        HLocale hLocale;
        try {
            hLocale =
                    localeServiceImpl.validateLocaleByProjectIteration(
                            localeId, projectSlug, iterationSlug);
        } catch (ZanataServiceException e) {
View Full Code Here

Examples of org.zanata.model.HLocale

        HTextFlow sampleHTextFlow =
                entityManager.find(HTextFlow.class, translationRequests.get(0)
                        .getTransUnitId().getValue());
        HProjectIteration projectIteration =
                sampleHTextFlow.getDocument().getProjectIteration();
        HLocale hLocale = validateLocale(localeId, projectIteration);

        // single permission check - assumes update requests are all from same
        // project
        validateReviewPermissionIfApplicable(translationRequests,
                projectIteration, hLocale);
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.