Closed HernandoR closed 1 year ago
Thanks for the PR here. Just let you know that this brings another breaking change on the existing project, for which I will be extremely prudent.
Is your intention to be able to use languageSwitch
outside template.typ
, and to decouple it with varLangauge
by abstracting it to a varVersion
? Can you provide more use case of why we will want to use the notion of version switch
instead of language switch
?
Hi,
Yes, it is indented to use languageSwich
outside template.typ
Current varVersion
is for controlling the module*
folder to use. During the usage, I feel it is too decoupled to split different languages into different folders, it's frustrating to compare two files and make them syncing in different languages.
I therefore consider different folder should be abstract as different versions, such as a one page resume side by a more detailed one, or different types of jobs require different emphasis. You can, of course, consider different languages as different version, such that there will be barely any breaking change but varLanguage
rename to varVersion
in the metadata.typ
I can commit an example to show how to use (or not) this feature, though it is a composite change in both the example repo and template repo. Let me know if you would like me to submit PR individually or include the template in the example.
I see. The original method has indeed its pros and cons, and while squeezing information of all languages into a single file, you lose readability and structure. I think making a single page version will be an edge case here, as the functionality is intended to manage and switch languages, instead of "versions" (as the current user base perceives).
I will tend to not impose this breaking change for now, but I will leave this open to see how others feel about it and if further update in Typst can resolve this conflict in a more elegant way.
introduced a
varVersion
to split the duties of the language switch and version switch.Detailed usage is in the Readme file.
Basically,
varVersion
is for switch between folder of modules,varlanguage
is for the different content.languageSwtich()
would be used too many times, consider make a shorter name.