English 中文(简体)
Alfresco的多语文文件分享?
原标题:Multilingual documents in Alfresco Share?
最佳回答

在一个可从您的网页上查阅的物体中加以校正。 这里的例子就是,它已经做到:

package com.someco.web.jscript;

import org.alfresco.repo.jscript.ScriptNode;
import org.alfresco.repo.processor.BaseProcessorExtension;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.ml.MultilingualContentService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.Locale;

public final class MultilingualScript extends BaseProcessorExtension
{
    private static final Log logger = LogFactory.getLog(MultilingualScript.class);

   private MultilingualContentService multilingualContentService;
   private ServiceRegistry serviceRegistry;

   public MultilingualScript()
   {
      if (logger.isDebugEnabled()) {
         logger.debug("MultilingualScript Constructor Called");
      }
   }   

   //path = path of the original document
   //language = required language
   //returns the noderef for the translation content for the given language   
   public ScriptNode multilingualContent(String path, String language, ScriptNode companyHome) {
      if (logger.isDebugEnabled()) {
         logger.debug("MultilingualScript - parameters - " + path + " , " + language);
      }
      NodeRef nodeRef =  new ScriptNode(companyHome.getNodeRef(), serviceRegistry)
         .childByNamePath(path).getNodeRef();      
      nodeRef = multilingualContentService.getTranslationForLocale(nodeRef, new Locale(language) );      
      return new ScriptNode(nodeRef, serviceRegistry);
   }

   public MultilingualContentService getMultilingualContentService() {
      return multilingualContentService;
   }

   public void setMultilingualContentService(
         MultilingualContentService multilingualContentService) {
      this.multilingualContentService = multilingualContentService;
   }

   public ServiceRegistry getServiceRegistry() {
      return serviceRegistry;
   }

   public void setServiceRegistry(ServiceRegistry serviceRegistry) {
      this.serviceRegistry = serviceRegistry;
   }
}

The Spring bean:

<bean id="multilingualScript" parent="baseJavaScriptExtension" class="com.someco.web.jscript.MultilingualScript">
       <property name="extensionName">
           <value>multilingual</value>
       </property>
      <property name="serviceRegistry">
         <ref bean="ServiceRegistry" />
      </property>
      <property name="multilingualContentService">
         <ref bean="MultilingualContentService" />
      </property>
   </bean>

最后,用它来做:

var multilingualArticle = multilingual.multilingualContent("/myarticle", "es", companyhome);
问题回答

I guess showing the actual content shouldn t be to hard, because every content has his own uuid. The difficulty will be in creating a UI to upload a different language.

The first thing I would do is analyze how the action upload new version works. So what we need is a custom action to upload a different language file and a popup to select which language that is. So the upload new version does almost exactly the same, you can browse to a file and fill in versioning comment.

我不知道探索者是否有网上文字储存多语的内容,如果你不能够开发这些内容的话。

第二,制作一个网络文字,把所有多语文文件(如上所示,可能胜数)归还给你们。

然后确定一个编组,如工作流程或版本组,因此链接将出现在档案中。





相关问题
Translation of labels

I already have one application running (in English language). I want to translate those application text to some native langauges with my program. It it possible to change it?

Implementing multi languages with CSS and PHP

I m building a small site, that needs to support 2 languages for the same page. Each language has different buttons on the page, the buttons are basically some images with text inside. The positioning ...

Multilingual virtual keyboard in java

I am planning to create a multi lingual keyboard using Java. can u give some ideas or suggestions for doing that? Is there any open source code or interface which i can use in my code?

How to make multilingual login in django?

I need to create multilingual website. But there is a problem with the login address. Do you know, how I can have /login/ for EN and /prihlasit/ for CS, etc... ? I can specify just one login url in ...

SEO of multi-language website

i am building a website with a multi-language feature. it would be hard if each of the pages are to be created manually for each language so instead, i have different php files for each language ...

Drupal Multi-language: Simple strings not translated

I m adding additional languages to a Drupal site that I m building. Getting the translation of content working is fairly easy using the Internationalisation module. Yet, simple things such as date ...

PHP - Mulilingual application design

There are many ways to design a multilingual application in PHP. Some language file based, others database based. I am looking to use it for mostly small amounts of text e.g errors - at most a ...

热门标签