2022.2

Table Of Contents
Pluralization
Ideally,intemplateswithvariabledata,thetextautomaticallyadjuststonumbersinthedata.Takefor
examplethefollowinglineinatemplate:
"Thisordercontains@num_products@product."
Intheoutput,thetext"@num_products@"willbereplacedwiththevalueofadatafield,anumberin
thiscase.(See"Variabledatainthetext"onpage297.)
Theword"product"shouldonlyremainthesamewhentheactualnumberofproductsis1:
"Thisordercontains1product".
Inallothercasesitshouldbechangedinto"products",e.g.:
"Thisordercontains10products".
ThistopicexplainshowtomakeOLConnectdynamicallyselectasingularorpluralword,dependingon
thevalueofadatafield.
Addingplurals
Enteringplurals,ortextwithplurals,isanaturalpartofthetranslationprocessofatemplate.Thispro-
cessstartsbycreatingtranslationentriesasdescribedinthefollowingtopic:"Translatingtemplates"on
page415.
Notethatitisn'trequiredtotranslatethetemplateeffectively.Youmayalsocreateatranslationfilefor
theoriginallanguageofatemplateanduseitjustforpluralizationbyenteringpluralsonly.
Toenablepluralizationonatranslationentry:
1. Double-clicktherespectiveentryontheTranslationspane.
2. CheckthePluralizationoption.
3. Selectthedatafieldthatholdsthenumber.
Note: Pluralizationcannotbebasedonadatafieldinadetailtable.
4. Nowtherearetwopossibilities:
l
ClickOK.Proceedwiththetranslationprocessafteryou'vecreatedalltranslationentries
andenabledpluralizationasneeded.Forfurtherinstructionssee"Translatingtemplates"
onpage415.
l
EnterthesingularandpluralandclickOK.Theentriesarestoredinthetemplateitself.
OLConnectwillautomaticallyfallbacktotheseentrieswhenthereisnotranslationfile
(.po)thatmatchesthe"Locale"onpage295.Thesingularisusedwhenthevalueofthe
datafieldis1,andthepluralisusedinallothercases.
Page 420