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

Add localization controls to YAML template #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ysndr
Copy link

@ysndr ysndr commented Feb 4, 2018

Localization had to be done by editing the latex template and can now be done clearer and more efficiently via (optional) configuration keys

Note:
lang was renamed to language as pandoc yelled at me how I dared to use lang with a value different from IETF style which isodate is not okay with..
commasep has become part of the localization object

I really like this tool, it came very handy recently

@pedro-nonfree
Copy link

lang was renamed to language as pandoc

question: this affects pandoc v1 and v2 ?

Just to share my preferences I like the format iso 8601 YYYY-MM-DD

@ysndr
Copy link
Author

ysndr commented Nov 23, 2018

The internal localization is of strings in pandoc is handled here and expects a BCP47 identifier behind the lang meta attribute.

I use the non standard language tag to set the polyglossia language manually. Yet looking at pandoc source code setting the polyglossia language manually shouldn't be necessary as done internally already.
I will look into this again.

Just to share my preferences I like the format iso 8601 YYYY-MM-DD

What do you mean by that?

@pedro-nonfree
Copy link

pedro-nonfree commented Nov 23, 2018

given here says proper date format

Just to share my preferences I like the format iso 8601 YYYY-MM-DD

What do you mean by that?

I mean that if I set my language format my date format is not going to behave as I want (iso 8601 YYYY-MM-DD)

That's how I solved it in my own version https://gitlab.com/pedrolab/invoice-boilerplate/blob/master/template.tex#L97-99 -> the thing is: I don't know if I can handle this with pandoc more transparently

@ysndr
Copy link
Author

ysndr commented Nov 25, 2018

With date format, the locale specific date format is meant eg. 11/25/18 is printed for en-US in contrast to 25.11.2018 for European locales (don't take theese examples too literally, I couldn't write a paper example in code atm)

For date formatting the isodate packege is currently used. Additionally the date is hardcoded to be numeric but I could add support for specifying the isodate style in the config.

The language selection can also be changed I learned as pandoc provides converted language versions for polyglossia and babel

@ysndr
Copy link
Author

ysndr commented Nov 25, 2018

the template now uses datetime2 for printing dates
the config can have a datetime2 key which content is inserted as package options for datetime 2
additionally a datestyle key was added to allow quick change of date formats defined by datetime2 (see its manual for more info)

a \date{<iso>} command was added to be used in texts to print dates according to the current regional preferences (again see datetime2 manual \DTMdate{...}

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

Successfully merging this pull request may close these issues.

None yet

2 participants