This pull request improves the maintainability of transliteration to various Interslavic scripts, e.g.:
"Tutoj kod možete viděti na {GitHub}."
The goal is to preserve substitutions ({GitHub}) while applying appropriate transliteration based on the selected alphabet (Latin, Cyrillic, or Glagolitic).
Introduced utility functions:
parseI18nString: Parses the translation string into an array of strings and substitutions for easier handling.
createTaggedTemplate: Creates a tagged template literal, allowing the application of transliteration functions to static string parts or interpolated values based on the passed transformation function (unknown => string). In our case, that are transliteration functions.
This pull request improves the maintainability of transliteration to various Interslavic scripts, e.g.:
The goal is to preserve substitutions (
{GitHub}
) while applying appropriate transliteration based on the selected alphabet (Latin, Cyrillic, or Glagolitic).Introduced utility functions:
parseI18nString
: Parses the translation string into an array of strings and substitutions for easier handling.createTaggedTemplate
: Creates a tagged template literal, allowing the application of transliteration functions to static string parts or interpolated values based on the passed transformation function (unknown => string). In our case, that are transliteration functions.Example of tagged template literals:
Pros:
@interslavic/utils
Cons: