Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

 W.I.P.

Guide to OFBiz-i18n, Internationalisation of OFBiz

Looking around the WIKI there are few hints (and even less concrete guides) towards what needs to be done in order to add more locales to an OFBiz setup, namely the current release or SVN trunk.

Most generally, there are three areas of concern when starting a translation of OFBiz into a different locale, i.e. a language and possibly a specific sub-locale:

  • Translation of Application labels
  • Translation of OFBiz assets with built-in i18n options (Catalog, Product)
  • Translation of Text Elements (DataResources) using CMS

However, i18n goes even beyond that as there is a clear (natural) preference for US standards-based demo data, e.g. in the area of PaymentGateways, ShippingInterfaces and Accounting in general (tax allocation, general ledger configuration). Hence a fourth section tries to address these areas:

  • Re-configuration of General Ledger 
  • Tax configuration
  • Extension of GeoData

Note that this document focusses on the CONFIGURATION of OFBiz Entities in order to display Text in a different Locale and possibly pay attention to different Legislation & Taxing in other Locales. This document does NOT aim to talk about technical localisation (Tech Folks, make sure you start at Adrian's Internationalization) or adding more local payment or shipping gateways, as t his is considered regular customisation.

A final section covers tools that can be used for the translations tasks and documents present in this wiki which refer to translations.

Translation of Application labels

The labels for the OFBiz GUI applications are the most evident part to change for an i18n project. They are part of the release and serve the purpose of 'resource packs' known from claqssic Java development.

Also refer to Tips for UI labels translation.

Some POS labels are handled by XUI not OFBIz. You can use a plugin like RBE to edit those XuiLabels.properties

Location of config files

located in the configuration subdirectories as follows:OFBIZ_HOME/applications/<appname>/config

OFBIZ_HOME/framework/<appname>/config

OFBIZ_HOME/specialpurpose/<appname>/config

The naming convention is <appname>UiLabels.xml.

Most likely there will also be <appname>HelpUiLabels.xml, <appname>EntityLabels.xml and possibly other files there. Just check through an see what merits your translation.

Activation

 The activation of changed configuration files is easy: Restart the OFBiz application. These configuration files are read in every time the OFBiz application container starts. Hence: Edit > Save > Restart > Use is the activation sequence.

References to other Wiki Documents

Interested to understand how you make references to the i18n labels in code? Then read this: Text Translation.

Translation of OFBiz assets with built-in i18n options

This section assumes you have understood the relationship of Content, ContentAssociations and DataResources. Also, you should understand how a DataResource can be provided to the system.

Some OFBiz entities have built-in i18n options, the most prominent (and evident) are Catalog-Categories and Product. Check out how to translate Products or Categories Name and Descriptions, have a look at How to localize Product and Categories descriptions.
You can find out which entities provide this option when searching for "*Content" in the entitymodel.xml configuration files (which will then list out all occurencies of a <entityname>Content entity). Search in the current trunk (rev 811440) resulted in the following Content-Entities:

  • applications / order --> OrderContent
  • applications / party --> PartyContent
  • applications / party --> CommunicationsEventContent
  • applications / product --> ProductCategoryContent
  • applications / product --> ProductConfigurationItemContent
  • applications / product --> ProductContent
  • applications / workeffort --> WorkEffortContent

Most typically, the entity.name, entity.description and entity.longdescription attributes can be internationalized. A table listing the i18n options of respective entity attributes will be worked in here soon.

Be Careful

When using i18n on these entities, the "direct" attributes must be empty, otherwise the CMS lookup will not occur.

Naming Conventions for ContentId and DataSourceId

Each of your Content and DataSource items will need a unique ID, so make up your mind about naming conventions for the ContentId and DatasourceId that are related to your entities!

ProductContent special remarks

The ProductContent entity will be the most interesting one for ecommerces since working on the product descriptions will be the most of an online editor's work. Also customizing text for different locales when you run a multi-locale shop will be a huge task. Best results are achieved when an XML template is used that defines all relevant entities for a new product (make sure you use a single XML per single product).
Aside the regular relationships of a given product (configuration elements, category placement etc.), the i18n content elements should be added with the same XML. Then at least a template CMS structure will be present with each product that is uploaded.
Unfortunately the Demo data just places rudimentary i18n. The relevant attributes to i18n on a Product are:

  • Product.name
  • Product.description
  • Product.longDescription

The corresponding relationships are built using the ProductContent entity where the productContentTypeId should be set to 'NAME', 'DESCRIPTION' or 'LONG_DESCRIPTION' for the content  that will map to name, description or longDescription respectively (attention, the Demo Data does not define the LONG_DESCRIPTION content items, so you will need to touch this, sorry!).
 

HTML META tags for default Product-pages

The content of HTML Meta tags on product pages are handled in

applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy

The following content will be handled as i18n content, i.e. locale/fallback locale applies in <HTML><HEAD>...<META type="keyword" ...> tags:

  • product.name (content items mapped as "PRODUCT_NAME" type)
  • catalog.name (not i18n)
  • productCategory.description (content items mapped as "DESCRIPTION" to all categories that this product is a member of)

The following content will be handled as i18n content, i.e. locale/fallback locale applies in <HTML><HEAD>...<META type="description" ...> tags:

  • product.description (content items mapped as "DESCRIPTION" type)

Using this will help you with localized SEO (=Search Engine Optimisation) projects.

Translation of Text Elements using the CMS

This section assumes you have understood the relationship of Content, ContentAssociations and DataResources. Also, you should understand how a DataResource can be provided to the system.

w.i.p

Beyond Translation

As mentioned earlier, certain elements of i18n go beyond text translation. These elements typically comprise regionalized rules (e.g. for tax calculation) or entity instances (e.g. for general ledger). This section will discuss some general items in this.

Re-configuration of General Ledger

Actually, reconfiguring GL is a big step and dives deep into the data configuration of the Accounting module.
First of all, an understanding is required as to which of the accounting data entities require either customizations (changes that are related to the ORGANIZATION party that is using the GL) or localizations (changes that are related to the primary market that the ORGANIZATION is working in).

The requirements to provide a standard way of localizing General Ledger are also tracked on JIRA OFBIZ-3411 Introduce Localization Packages in General Ledger.

The following list shows all Entities that are defined in the files on OFBIZ_HOME/applications/accounting/data sorted by filename and then by occurence in the data files:

Filename

Entity

data character

relevant for

AccountingSecurityData(.xml)

SecurityPermission

seed

 

SecurityGroupPermission

seed

AccountingTypeData(.xml)

AcctgTransType

seed

 

StatusType, StatusItems ACCTG_ENREC_STATUS

seed

 

BudgetItemType

cust

 

BudgetItem

cust

 

EnumerationType, Enumeration GC_FULFILL

seed

 

EnumerationType, Enumeration PGT_CODE

seed

 

EnumerationType, Enumeration FARP_TYPE

seed

 

EnumerationType, Enumeration FARP_METHOD

seed

 

FinAccountTransType

seed

 

FinAccountType

seed

 

StatusType, StatusItems, StatusValidChange FINACCT_STATUS

seed

 

StatusType, StatusItems, StatusValidChange FINACCT_TRNS_STATUS

seed

 

EnumerationType, Enumeration FINACCT_TRANS_REASON

seed

 

FixedAssetType

demo

 

EnumerationType, Enumeration FXAST_CLASS

demo

 

EnumerationType, Enumeration FXAST_COMPU_HARDWARE

demo

 

EnumerationType, Enumeration FXAST_COMPU_SOFTWARE

demo

 

FixedAssetIdentType

demo

 

StatusType, StatusItems FIXEDAST_MNT_STATUS

demo

 

Scheduled Job, Roles for Fixed Assets

demo

 

FixedAssetProductType

demo

 

GlAccountClass

demo

 

GlAccountType

demo

 

GlResourceType

demo

 

GlXbrlClass

demo

 

GlFiscalType

demo

localize

 

GlAccountCategoryType

demo

 

InvoiceItemType

seed

 

InvoiceItemAssocType

demo

 

InvoiceType

demo

 

InvoiceItemTypeMap

demo

 

EnumerationType, Enumeration TAXABLE_INV_ITM_TY

demo

 

PaymentMethodType

seed

localize?

 

PaymentType

seed

localize

 

PaymentGroupType

seed

localize

 

PaymentGatewayConfigType

demo

 

PaymentGatewayConfig

demo

 

PaymentGateway<PROVIDER>

demo

 

CustomMethodType, CustomMethod

seed

 

EnumerationType, Enumeration CREDIT_CARD_TYPE

seed

 

StatusType BUDGET_STATUS

seed

 

StatusType PARTY_ASSET_STATUS

seed

 

StatusType, StatusItems, StatusValidChange INVOICE_STATUS

seed

 

StatusType, StatusItems, StatusValidChange PMNT_STATUS

seed

 

SettlementTerm

demo

 

EnumerationType, Enumeration TAX_FORMS

demo

localize

 

EnumerationType, Enumeration COGS_METHODS

seed

 

EnumerationType, Enumeration INVOICE_SEQ_MD

seed

 

FixedAssetStdCostType

seed

 

TaxAuthorityAssocType

demo

localize

 

TaxAuthorityRateType

demo

localize

 

RateType

seed

 

PeriodType

seed

 

WebSite

seed

 

EnumerationType, Enumeration PTSOFTTFR

seed

 

ProductAverageCostType

demo

 

EnumerationType, Enumeration STR_CRDT_ACT

demo

 

StatusType, StatusItems, StatusValidChange GLREC_STATUS

demo

DemoFinAccountData.xml

FinAccount

cust

 

FinAccountStatus

cust

 

FinAccountTrans

demo

 

Payment

demo

DemoGeneralChartOfAccounts.xml

GlAccount

demo

DemoGlSetupData.xml

InvoiceItemType

seed

 

PaymentMethodType

seed

 

CostComponentCalc

cust

 

GlJournal

cust

 

PartyAcctgPreference

seed

 

GlAccountOrganization

seed

 

GlAccountTypeDefault

seed

 

GlAccountCategory

seed

 

PaymentGlAccountTypeMap

seed

 

PaymentMethodsTypeGlAccount

seed

 

CreditCardTypeGlAccount

seed

 

FinAccountTypeGlAccount

seed

 

VarianceReasonGlAccount

seed

 

CustomTimePeriod

demo

 

UomConversionDated

demo

 

GlReconciliation

demo

 

GlAccountCategoryMember

demo

DemoOrganisationData.xml

/any org data for accounting/

demo

PaymentsInvoices.xml

/Example Invoices/

demo

UsTaxAccountGroups.xml

GlAccountGroupType

demo

localize

 

GlAccountGroup

demo

localize

Tax configuration

w.i.p.

Tools and Documents in this WIKI

Some language communities have started common dictionaries in order to align translation options and agree on some special terms. Examples are:

  • No labels

1 Comment

  1. Hi Carsten,

    I'd like to relate this page to related subject in FAQ. I'm not sure how for now. I guess putting this page directly under the FAQ and putting a link from bottom of Tips for UI labels translation. Or maybe rearrange all related pages in yours and then put under FAQ...