Textpattern CMS support forum

You are not logged in. Register | Login | Help

#81 2018-10-05 15:39:22

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,020
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Maybe sticking with language convention is the smart way. Certainly efficient. I wouldn’t worry about it.


The text persuades, the *notes prove。

Offline

#82 2018-10-05 15:44:22

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,020
Website

Re: smd_article_stats: Article stats to count words 'n stuff

I must have used en-GB before when seeing the comma, because when switching from fr to en just now I get this yellow warning:

No locale available for language English. Using default locale instead.

What would be the default in that case, British?


The text persuades, the *notes prove。

Offline

#83 2018-10-05 16:03:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,458
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Destry wrote #314421:

when switching from fr to en just now I get [a] warning.

Yeah this is where our locale/language thing breaks down a bit. Or where the entire locale/language thing breaks down, I’m not sure which it is.

Basically we have a giant lookup table that maps a language designator to a locale. When we used full language designators (en-GB, en-US etc) it was easy because they usually have a direct locale analogue. Now we have “short” designators there’s not always a mapping. There’s no explicit locale for OED English en for example.

If you look in textpattern/vendors/Textpattern/L10n/Locale.php you’ll see the table near the top of the file. Notice that the entry for ‘en’ is missing? That’s probably why you get that warning. And this leads to your next point…

What would be the default in that case, British?

… if the system can’t find a locale it reverts to the system default which is usually ‘C’. For, uhhh, “Common” or “Can’t find it” … I’m not sure.

What do we do about this? I don’t know. Do we add an entry for our short langs and just pick a locale even though it might not be right? Do we leave it up to the system (as we do now) and issue the warning, which delivers correct information to you, but is potentially confusing? Or do we do something else?

I’m a little ignorant in this department so if anyone is more clued up then please open a topic for discussion somewhere.

P.S. if you want to see all locales your system supports, open a Terminal and issue:

locale -a


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#84 2018-10-06 18:30:12

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,020
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Bloke,

If I may offer… I’d suggest using the Modern Humanities Research Association,‘s recommendation for handling the generic en dates, numbers, currency, etc.

The MHRA is largely based on the Oxford Style Manual, and some of it’s board members are even Oxford researchers. So if you’re considering the en spelling as OED, then this is just another pea in the same pod.

(This is the style manual I use for all my sites too.)

Dates are of the format 6 October 2018.

For numbers, they define no separator up to 9999, then a comma beginning 10,000.

While this is not what I wanted to do from a design standpoint, I will be the first to say this is a solid way to address the missing en format for Txp, and especially as it’s based on the Oxford U way of things.

I would be happy to use smd_article_stats under the en language by the above format. I’m a sucker for convention.


The text persuades, the *notes prove。

Offline

Board footer

Powered by FluxBB