Package org.zanata.common

Examples of org.zanata.common.LocaleId


         * entity listener methods. In this case, the drools engine will attempt
         * to access the 'members' collection from inside the security
         * listener's postLoad method to evaluate rules.
         */
        HLocale locale =
                localeServiceImpl.getByLocaleId(new LocaleId(language));
        if (locale != null) {
            locale.getMembers();
        }
        return locale;
    }
View Full Code Here


        }
        return locale;
    }

    public List<HLocaleMember> getLocaleMembers() {
        return localeMemberDAO.findAllByLocale(new LocaleId(language));
    }
View Full Code Here

    @Override
    public TransMemoryDetailsList execute(GetTransMemoryDetailsAction action,
            ExecutionContext context) throws ActionException {
        identity.checkLoggedIn();
        LocaleId locale = action.getWorkspaceId().getLocaleId();
        HLocale hLocale;
        try {
            hLocale =
                    localeServiceImpl
                            .validateLocaleByProjectIteration(locale, action
View Full Code Here

            extensions.add("comment");

            // Perform translation of Hibernate DTOs to JAXB DTOs
            TranslationsResource transRes =
                    (TranslationsResource) this.translatedDocResourceService
                            .getTranslations(docId, new LocaleId(locale),
                                    extensions, true, null).getEntity();
            Resource res = this.resourceUtils.buildResource(document);

            StreamingOutput output =
                    new POStreamingOutput(res, transRes,
                            FILE_TYPE_OFFLINE_PO.equals(fileType));
            response =
                    Response.ok()
                            .header("Content-Disposition",
                                    "attachment; filename=\""
                                            + document.getName() + ".po\"")
                            .type(MediaType.TEXT_PLAIN).entity(output).build();
        } else if (FILETYPE_TRANSLATED_APPROVED.equals(fileType)
                || FILETYPE_TRANSLATED_APPROVED_AND_FUZZY.equals(fileType)) {
            if (!filePersistService.hasPersistedDocument(id)) {
                return Response.status(Status.NOT_FOUND).build();
            }
            final Set<String> extensions = Collections.<String> emptySet();
            TranslationsResource transRes =
                    (TranslationsResource) this.translatedDocResourceService
                            .getTranslations(docId, new LocaleId(locale),
                                    extensions, true, null).getEntity();
            // Filter to only provide translated targets. "Preview" downloads
            // include fuzzy.
            // New list is used as transRes list appears not to be a modifiable
            // implementation.
View Full Code Here

        ShortString abbrev = new ShortString(searchText);
        SearchType searchType = action.getSearchType();
        log.debug("Fetching Glossary matches({}) for \"{}\"", searchType,
                abbrev);

        LocaleId localeID = action.getLocaleId();
        ArrayList<GlossaryResultItem> results;

        try {
            List<Object[]> matches =
                    glossaryDAO.getSearchResult(searchText, searchType,
View Full Code Here

                            + "\".");
        }
    }

    private HLocale findHLocale(String localeString) {
        LocaleId localeId;
        try {
            localeId = new LocaleId(localeString);
        } catch (IllegalArgumentException e) {
            throw new ChunkUploadException(Status.BAD_REQUEST,
                    "Invalid value for locale", e);
        }
View Full Code Here

    public String deleteGlossary(String localeId) {
        int rowCount = 0;
        if (StringUtils.isNotEmpty(localeId)) {
            rowCount =
                    glossaryDAO.deleteAllEntries(new LocaleId(localeId));
            log.info("Glossary deleted (" + localeId + "): " + rowCount);
        }
        FacesMessages.instance().add(Severity.INFO,
                msgs.format("jsf.Glossary.deleted", rowCount, localeId));
        return FacesContext.getCurrentInstance().getViewRoot().getViewId();
View Full Code Here

            return getLocaleId(getSourceLang());
        }

        private LocaleId getLocaleId(String lang) {
            if (StringUtils.isNotEmpty(lang)) {
                return new LocaleId(lang);
            }
            return null;
        }
View Full Code Here

        return new ProjectIterationId(projectSlug, iterationSlug, null);
    }

    public static LocaleId getLocaleId() {
        String localeId = Window.Location.getParameter("localeId");
        return localeId == null ? null : new LocaleId(localeId);
    }
View Full Code Here

            this.localeId = localeId;
            return this;
        }

        public Builder setLocaleId(String localeString) {
            this.localeId = new LocaleId(localeString);
            return this;
        }
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.