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

Wrong mapping for portuguese language #72

Closed
rgcv opened this issue Jun 19, 2021 · 3 comments
Closed

Wrong mapping for portuguese language #72

rgcv opened this issue Jun 19, 2021 · 3 comments
Assignees
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@rgcv
Copy link

rgcv commented Jun 19, 2021

Hey there!

First off, great extension, I love it, awesome stuff with LATEX support.

I've seemed to have identified what looks to be an issue when trying to enclose portuguese text using babel commands. I've tried them all: foreignlanguage, selectlanguage, the otherlanguage environment. Magic comments work fine with the language tag, but that had me thinking.

I resorted, as documented, to use the babeltags command in my document's preamble like so

\babeltags{pt=portuguese}

To my surprise, and confusion, when using textpt or the now available pt environment, checking worked wonderfully.

I tracked down when support for babel commands were introduced and noticed this line over here when initializing the babelLanguageMap

The language portugese is not made available by babel, only making available the codenames portuguese (spelled correctly) and the historically short portuges. I'm not sure this is either a typo or that babel used to support portugese as well in the past. If it was a typo, I suggest its removal, keeping it otherwise.

Regardless, I would recommend adding the proper mappings. While I'm at it, I'd also suggest adding the historical aliases for compatibility reasons, if those are interesting to support as well. Some java pseudo-code follows:

babelLanguageMap.put("brazil", "pt-BR");
babelLanguageMap.put("brazilian", "pt-BR");
babelLanguageMap.put("portuges", "pt");
babelLanguageMap.put("portuguese", "pt");

Quick disclaimer: I'm not sure this is enough to fix the whole problem, but from what little I've looked at, it seems to be enough. If it is, I can gladly submit a PR adding the missing mappings. Removing the portugese mapping is up for debate. I honestly don't recall if that language codename was supported once, but it doesn't appear to be documented in the most recent version of the documentation.

@valentjn valentjn added 1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX labels Jun 19, 2021
@valentjn valentjn self-assigned this Jun 19, 2021
@valentjn valentjn added this to the 12.2.1 milestone Jun 19, 2021
@valentjn
Copy link
Owner

valentjn commented Jun 19, 2021

Thanks for the report. I copied the languages from the babel manual by hand, so that was a typo. Also, I think pt-PT should be used instead of pt. Not using the regional variant, if one exists, results in specific errors (mostly spelling errors) not being displayed, at least for other languages.

@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Jun 19, 2021
@rgcv
Copy link
Author

rgcv commented Jun 19, 2021

No problem, thank you for the quick solution! I'm a typist myself, I understand it perfectly. And I agree, if one exists, the regional variant should be used, sounds sensible.

@valentjn
Copy link
Owner

Fix released in 12.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants