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

[REQ] Adapt language configuration options #34

Open
mhatzl opened this issue Jul 23, 2023 · 3 comments
Open

[REQ] Adapt language configuration options #34

mhatzl opened this issue Jul 23, 2023 · 3 comments

Comments

@mhatzl
Copy link
Contributor

mhatzl commented Jul 23, 2023

At the moment there are two options to specify languages used in a document:

  1. lang ... The default language of the document
  2. multi-langs ... List of other languages the document should be translated to (e.g. used to create columns in .umi files)

While the lang option is clear, multi-langs is not so, because there is a difference between possible other languages used in a document, and other languages the document should be rendered in.
Therefore, this option should be divided into two options:

  • used-langs ... List of languages used in the document
  • render-langs ... List of languages the document should be rendered in

Note: render-langs contains natural languages, while formats defines output formats the document is rendered to.

The render-langs option must also not be allowed in the preamble, because this option makes no sense for inserted files.
The options lang and `used-langs´ should be allowed in the preamble, because they are related to the file content.

@mhatzl
Copy link
Contributor Author

mhatzl commented Jul 23, 2023

Maybe translate-to would be a better name instead of render-langs.
render could be misleading, because rendering is used to describe the process of transforming Unimarkup content into an output format.

@mhatzl
Copy link
Contributor Author

mhatzl commented Aug 27, 2023

Alternative option names:

  • lang ... The language the document is written in

  • used-langs ... List of languages used in the document (lang is optional for this list, and must be added automatically if absent)

  • output-langs ... List of natural languages the document must be output to

    This option is also useful if a .umi file is used as input, because all output formats can now be created for all languages given in the list. Given languages must be present as columns in the ".umi" file.

    If input is a regular ".um" file, this option defines the columns that must be created for a .umi file.
    Otherwise, this option has no effect on other output formats.

@mhatzl
Copy link
Contributor Author

mhatzl commented Aug 29, 2023

As mentioned in issue unimarkup/unimarkup-rs#102, all locales will be supported by default.
This makes used-langs, locale-file and download obsolete.

For clarity, langs should be renamed to output-langs with the behaviour described above.
The locale of lang must always be implicitly added to this list if not present.

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

1 participant