Closed bluepuma77 closed 11 months ago
It is now possible to pass the mapping explicitly as a second argument:
const characters = {
...latinize.characters,
'Ä': 'Ae', 'Ö': 'Oe', 'Ü': 'Ue', 'ä': 'ae', 'ö': 'oe', 'ü': 'ue'
};
latinize('ÄÖ', characters) // => "AeOe"
I need to work with two different translation tables:
One translates only non-German characters not included in the PDF embedded font:
const umlauts = {'Ä': 'Ä', 'Ö': 'Ö', 'Ü': 'Ü', 'ä': 'ä', 'ö': 'ö', 'ü': 'ü', 'ß': 'ß'};
Another one is used to make search easier, it translates German characters:
const umlauts = {'Ä': 'Ae', 'Ö': 'Oe', 'Ü': 'Ue', 'ä': 'ae', 'ö': 'oe', 'ü': 'ue', 'ß': 'ss'};
I am using typescript and did
import latinize from 'latinize';
in two different files, but changinglatinize.characters
always changes the values in both instances. Usingvar latinize = require('latinize');
did not help on the high level, only when put into the function using the translation. But now it is initialised new every time.Is it possible to use multiple instances at the same time?