FR [1786994] - 2Pack can handle translations now
https://sourceforge.net/tracker/?func=detail&atid=883808&aid=1786994&group_id=176962
This commit is contained in:
parent
7e06648e08
commit
d5b8ad7d0e
|
@ -1,6 +1,6 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. *
|
||||
* Copyright (C) 1999-2006 Adempiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
|
@ -10,7 +10,7 @@
|
|||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*
|
||||
* *
|
||||
* Copyright (C) 2005 Robert Klein. robeklein@hotmail.com *
|
||||
* Contributor(s): Low Heng Sin hengsin@avantz.com *
|
||||
*****************************************************************************/
|
||||
|
@ -26,10 +26,9 @@ import java.util.logging.Level;
|
|||
|
||||
import javax.xml.transform.sax.TransformerHandler;
|
||||
|
||||
import org.compiere.model.MSequence;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.model.POInfo;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -391,14 +390,4 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
return ("".equals(s) ? null : s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns option - Is export-import of AD translations is needed
|
||||
* @param ctx
|
||||
* @param entityType
|
||||
* @return boolean
|
||||
*/
|
||||
protected boolean isHandleTranslations(Properties ctx) {
|
||||
|
||||
return "true".equalsIgnoreCase(Env.getContext(ctx, "isHandleTranslations"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ import org.adempiere.pipo.handler.TableElementHandler;
|
|||
import org.adempiere.pipo.handler.TaskElementHandler;
|
||||
import org.adempiere.pipo.handler.WindowElementHandler;
|
||||
import org.adempiere.pipo.handler.WorkflowElementHandler;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.X_AD_Element;
|
||||
import org.compiere.model.X_AD_FieldGroup;
|
||||
import org.compiere.model.X_AD_Package_Exp;
|
||||
|
@ -785,7 +786,7 @@ public class PackOut extends SvrProcess
|
|||
*/
|
||||
public void createTranslations (String parentTableName, int parentID, TransformerHandler packOutDocument) throws SAXException
|
||||
{
|
||||
if("true".equals(getCtx().getProperty("isHandleTranslations"))){
|
||||
if (MSysConfig.getBooleanValue("2PACK_HANDLE_TRANSLATIONS", false)) {
|
||||
|
||||
Env.setContext(getCtx(), CommonTranslationHandler.CONTEXT_KEY__PARENT_TABLE,
|
||||
parentTableName);
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.adempiere.pipo.AbstractElementHandler;
|
|||
import org.adempiere.pipo.AttributeFiller;
|
||||
import org.adempiere.pipo.Element;
|
||||
import org.adempiere.pipo.ElementHandler;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.xml.sax.Attributes;
|
||||
|
@ -32,7 +33,7 @@ public class CommonTranslationHandler extends AbstractElementHandler implements
|
|||
|
||||
public void startElement(Properties ctx, Element element) throws SAXException {
|
||||
|
||||
if(! isHandleTranslations(ctx)){
|
||||
if(! MSysConfig.getBooleanValue("2PACK_HANDLE_TRANSLATIONS", false)){
|
||||
return;//translation import option is disabled
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue