Package org.zanata.common

Examples of org.zanata.common.LocaleId


        return false;
    }

    private HLocaleMember getLocaleMember() {
        return localeMemberDAO.findByPersonAndLocale(authenticatedAccount
                .getPerson().getId(), new LocaleId(language));
    }
View Full Code Here


    public String save() {
        if (!isLanguageNameValid()) {
            return null; // not success
        }
        LocaleId locale = new LocaleId(language);
        localeServiceImpl.save(locale, enabledByDefault);
        return "success";
    }
View Full Code Here

        // Cannot use FacesMessages as they are request scoped.
        // Cannot use UI binding as they don't work in Page scoped beans
        // TODO Use the new (since 1.7) FlashScopeBean

        // Check that locale Id is syntactically valid
        LocaleId localeId;
        try {
            localeId = new LocaleId(language);
        } catch (IllegalArgumentException iaex) {
            this.languageNameValidationMessage =
                    msgs.get("jsf.language.validation.Invalid");
            return false;
        }
View Full Code Here

    }

    private static Optional<LocaleId> getSourceLocale(TransMemoryUnit tu) {
        String tuSourceLanguage = tu.getSourceLanguage();
        if (tuSourceLanguage != null) {
            return Optional.of(new LocaleId(tuSourceLanguage));
        }
        return Optional.absent();
    }
View Full Code Here

            if (!adminExists) {
                log.warn("No admin users found. Admin users can be enabled in zanata.properties");
            }

            // Enable en-US by default
            LocaleId localeId = new LocaleId("en-US");
            if (localeDAO.findByLocaleId(localeId) == null) {
                HLocale en_US = new HLocale(localeId);
                en_US.setActive(true);
                en_US.setEnabledByDefault(false);
                if (localeDAO.makePersistent(en_US) == null) {
View Full Code Here

            Resource doc =
                    translationFileServiceImpl.parseUpdatedPotFile(
                            sourceFileUpload.getFileContents(), docId,
                            sourceFileUpload.getFileName(), useOfflinePo);

            doc.setLang(new LocaleId(sourceFileUpload.getSourceLang()));

            // TODO Copy Trans values
            documentServiceImpl.saveDocument(projectSlug, versionSlug, doc,
                    new StringSet(ExtensionType.GetText.toString()), false);
View Full Code Here

        return Optional.fromNullable(Strings.emptyToNull(sourceFileUpload
                .getAdapterParams()));
    }

    public void setSelectedLocaleId(String localeId) {
        this.selectedLocale = localeDAO.findByLocaleId(new LocaleId(localeId));
    }
View Full Code Here

                        translationFileServiceImpl
                                .parseUpdatedAdapterDocumentFile(
                                        tempFile.toURI(), docId, fileName,
                                        getOptionalParams());
            }
            doc.setLang(new LocaleId(sourceFileUpload.getSourceLang()));
            Set<String> extensions = Collections.<String> emptySet();
            // TODO Copy Trans values
            document =
                    documentServiceImpl.saveDocument(projectSlug, versionSlug,
                            doc, extensions, false);
View Full Code Here

    }

    private void prepareTransUnitUpdatedEvent(int previousVersionNum,
            ContentState previousState, HTextFlowTarget target) {
        LocaleId localeId = target.getLocaleId();
        HTextFlow textFlow = target.getTextFlow();
        HDocument document = textFlow.getDocument();
        HProjectIteration projectIteration = document.getProjectIteration();
        String iterationSlug = projectIteration.getSlug();
        String projectSlug = projectIteration.getProject().getSlug();
View Full Code Here

    @Override
    public GetGlossaryDetailsResult execute(GetGlossaryDetailsAction action,
            ExecutionContext context) throws ActionException {
        identity.checkLoggedIn();
        LocaleId locale = action.getWorkspaceId().getLocaleId();
        HLocale hLocale;
        try {
            ProjectIterationId projectIterationId =
                    action.getWorkspaceId().getProjectIterationId();
            hLocale =
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.