I don't think there is a way to do it but we have ...
# advancedpdf
c
I don't think there is a way to do it but we have a required to display the sales description in a specific set language. We have items with metric / imperial dimensions within the description. A couple of languages are used (Dutch, German, English). Now we use the standard English (US) for the English text with imperial dimensions and the English (UK) for the English text with metric dimensions. As said, I don't think there is a way to accomplish this (besides the regular way of creating a specific custom field with the English UK description in it). Or does anyone have a way?
s
How many different sales descriptions do you have? Depending on the #, you could use a translation collection to hold the sales description for each language. You can also use placeholders in the translation strings, so that {1} .. {2} can be substituted with values, such as the imperial or metric dimensions.
c
Multiple thousands so not really an option. Currently thinking of a script to automatically set another custom field and just use that in the template.
s
okay, just thinking through options … there are thousands of descriptions. Is it multiple language that is the concern, or really just the imperial vs metric units, or are there language differences in the description that vary as well, apart form just the units?
Because if it’s only the units, then I’d probably store those each in their own fields, and then just dynamically insert the right one based on country or locale. Do you have multiple languages set up in your NetSuite account, though? If so, then on each Item there should be a Translation subtab under the System Information tab. You’ll have an Item Translation line for each Language (locale) that has been added to the account. You can set a different Display Name and Sales Description (and several other fields) for each language. Printing the PDF in the customer’s locale should then choose and display the correct locale-specific Sales Description. That’s especially useful if you actually want to display different language text, and not just different units.
f
If you can translate on the fly, another option would be to a script to create the object that gets rendered by the PDF and then pass that into the PDF as a custom object like this:
Copy code
let myObject = {
    translatedText : "Lorem Ipsum"
};

const mypdf = render.create();

mypdf.addCustomDataSource({
    format: render.DataSource.OBJECT,
    alias: "catchyObjectName",
    data: myObject
});

## Then in your pdf template you can just call :

${catchyObjectName.translatedText}