citation-style-language/Sheldon

Check for language in parentheses for default locales other than en

adam3smith opened this issue · 10 comments

I also think it would be a good requirement to only allow default-locale values for which we have a matching CSL locale. Would protect against typos and defining valid locale codes for which we don't have CSL locales.

If the default-language is af-ZA, what would we expect to see in the title?

If the default-language is af-ZA, what would we expect to see in the title?

Good question. I think

(Afrikaans - SuidAfrika)

That's not in https://github.com/citation-style-language/locales/wiki (and there are a few more with parens). Is there a list that maps default-locales to the desired parenthesized text?

I also think it would be a good requirement to only allow default-locale values for which we have a matching CSL locale. Would protect against typos and defining valid locale codes for which we don't have CSL locales.

Does "matching CSL locale" mean a peek into the locales repo?

Is there a list that maps default-locales to the desired parenthesized text?

I'm afraid not, at least not that I know of

Does "matching CSL locale" mean a peek into the locales repo?

Yes

Is there a list that maps default-locales to the desired parenthesized text?

I'm afraid not, at least not that I know of

That would mean the best that can currently be done is

  1. match a default-locale against a sheldon-private list of languages
  2. If not in the list, and not en-*, just simply test for any parenthesized text

That sounds good! We'd just have to remember to add to the list whenever we add a locale, which is not that often

The langmap lives here. Since sheldon is fetched from its github repo for every run, changes to that file will be available in all subsequent runs.

I've done some testing, and everything seems to work. The actual feedback being presented to the user is hard-coded here.

(meaning, I think #30 is done)