In my project, I am using TypeScript with localisations nested within classes and objects, meanwhile the available integration doesn’t support anything that doesn’t resemble a simple key-value object. I researched custom modules, I tried to find a guide on how to create one, but I wasn’t able to find anything. I also wasn’t able to find any existing example of a custom file format parser for Crowdin.
An example of what one of such localisations looks like:
class Commands {
static readonly game = typedLocalisations({
name: {
'English': 'game',
'Polish': 'gra',
'Romanian': 'joc',
},
description: {
'English': 'Pick the correct word out of four to fit in the blank.',
'Polish': 'Wybierz słowo, które pasuje do luki w zdaniu.',
'Romanian': 'Alege cuvântul care se potrivește cu spațiul gol din propoziție.',
},
strings: {
sentence: {
'English': 'Sentence',
'Polish': 'Zdanie',
'Romanian': 'Propoziție',
},
translation: {
'English': 'Translation',
'Polish': 'Tłumaczenie',
'Romanian': 'Traducere',
},
noSentencesAvailable: {
'English': 'There are no sentences available in the requested language.',
'Polish': 'Nie ma zdań dostępnych w tym języku.',
'Romanian': 'Nu sunt propoziții disponibile în această limbă.',
},
},
});
}
Many of the localisations’ values are anonymous functions that resolve to strings, and aren’t strings themselves, too.
Any pointers to guides with such parsers would be appreciated.