Hi All, is there a way to configure advanced pdf i...
# advancedpdf
n
Hi All, is there a way to configure advanced pdf in different languages no matter where the user and/or customer's locale is?
t
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" /> <#elseif .locale == "zh_TW"> <link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" /> <#elseif .locale == "ja_JP"> <link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" /> <#elseif .locale == "ko_KR"> <link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" /> <#elseif .locale == "th_TH"> <link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" /> </#if>
n
I think this is still based on the user's locale, no?
p
This can be used for language based on customer card settings (well or directly on invoice but would usually be sourced)
<#if record.shipaddress?has_content>
<tr>
<td style="margin-top: 20px;">
<b><#if record.entity.language == "Suomi" || record.entity.language == "Finnish" || record.entity.language == "Finsk" || record.entity.language == "Finne">Toimitusosoite<#elseif record.entity.language == "Svenska" || record.entity.language == "Swedish" || record.entity.language == "Svensk" || record.entity.language == "Ruotsi">Leveransadress<#elseif record.entity.language == "Norsk" || record.entity.language == "Norwegian" || record.entity.language == "Norska" || record.entity.language == "Norja">Leveringsadresse<#elseif record.entity.language == "Dansk" || record.entity.language == "Danish" || record.entity.language == "Danska" || record.entity.language == "Tanska">Sendes til<#else>${record.shipaddress@label}</#if></b>
<br />${record.shipaddress}<br />
</td>
</tr>
</#if>
That sample is for the 4 Nordic languages but you should be able to see the structure
Note that it is also making sure it catches the entity setting if user is using local language also