Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multilingual setup #11

Open
xplosionmind opened this issue Dec 25, 2023 · 1 comment
Open

Multilingual setup #11

xplosionmind opened this issue Dec 25, 2023 · 1 comment

Comments

@xplosionmind
Copy link

Hi! First of all, allow me to thank you for creating this wonderful template, it is really cool!

I would be super interested in having a unified and consistent system to have the YAML data and the CV compiled both in English and other language(s).

I would be very happy to contribute to the project, but I would need some guidance. Could you give me some suggestions about the first steps to achieve this?

Thanks a lot!

@jskherman
Copy link
Owner

jskherman commented Dec 26, 2023

Thank you. As for multilingual support, there's a fork by jmml97 that changes the language of this template to Spanish with code es.

One way that could be done is to define the language in a lang field within the uservars variable. This should follow the format of ISO 639-1/2/3. This lang value can then be passed to a show rule and used to set the lang parameter for the text function for the entire template, as per the docs.

Next, using the same lang value, we can create a function that sets variables containing the strings for specific parts of the template, such as txt.education, txt.experience, txt.awards, and so on. Instead of hardcoding these strings in the template, we can use these variables.

The source for these text variables could be a dictionary of arrays that contains the strings, organized by ISO 639-1/2/3 language code. Alternatively, for simplicity, this data could be stored in a JSON or YAML file instead.

Edit: I forgot to mention the dates. I'm not sure if Typst automatically changes the strings output by the display() method for datetime types to be same as the language set in the text() function. Probably not. Since the template uses this method, this is another issue to look out for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants