Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2018-10-04 15:42:12

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

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

gaekwad wrote #314395:

You can with VirtualBox.

Interesting. Was just reading the Wikipedia page on it.

Ditto on the 1-2-3 steps vs. a video. I can’t sit through them either.

I have some heavy domestic objectives on my plate (not just these trivial sites of mine), so it will be a while before I bother with anything like this, but I will look to learn more.

Offline

#74 2018-10-04 16:44:56

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

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

etc wrote #314387:

<txp:php>dmp(get_loaded_extensions());</txp:php>...

Thanks for that. I added that to the ‘Debug’ article Bloke suggested setting up.

I also upgraded my Liip package to PHP 7.2.

But my debug info is still showing 7.0.x, and the intl extension is not showing as added.

So apparently Apache is using a different php package, but damn if I can figure out how and where.

Offline

#75 2018-10-04 19:09:41

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

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

Finally got this php f-er figured out.

In my httpd.conf file there’s the regular DSO line, which is normally supposed be uncommented:

LoadModule php7_module libexec/apache2/libphp7.so

But when using the Liip package there’s an include at the very bottom of the file:

Include /private/etc/apache2/other/*.conf

Which refers to a couple of other .conf files, one of which includes a path for the Liip version of the php DSO.

Apparently the include DSO does not override the first instance, so after commenting out the first instance in the main .conf file — Boom! — proper php 7.2.x being used and intl extension as well. Whew!

Now, one last question: The word count is showing up with a comma, like 7,346. Where do you change the locale? (France is set in the Language and Region tab of my Mac’s settings.) I can live with that but I’d prefer 7 346.

Also, do visitors see it differently to their locale too, or am I defining how everyone sees it?

Last edited by Destry (2018-10-04 19:13:16)

Offline

#76 2018-10-04 19:23:10

etc
Developer
Registered: 2010-11-11
Posts: 5,255
Website GitHub

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

Champagne!

Destry wrote #314403:

Now, one last question: The word count is showing up with a comma, like 7,346. Where do you change the locale? (France is set in the Language and Region tab of my Mac’s settings.) I can live with that but I’d prefer 7 346.

Also, do visitors see it differently to their locale too, or am I defining how everyone sees it?

It’s a server thing, should match your txp site public language, not clients settings.

Offline

#77 2018-10-04 19:40:11

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

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

Ah, of course.

Offline

#78 2018-10-04 20:52:44

etc
Developer
Registered: 2010-11-11
Posts: 5,255
Website GitHub

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

Ahem… the 4.7.1 implementation is slightly flawed, sorry. Will be fixed in 4.7.2.

Offline

#79 2018-10-05 15:22:25

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

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

etc wrote #314407:

Ahem… the 4.7.1 implementation is slightly flawed, sorry. Will be fixed in 4.7.2.

It seems relying on locale influences language in dates too. So while 10 684 looks good as a word count, IMO, 12 février 2018, doesn’t work as well in an English language article.

I’m not complaining, just observing aloud. I can easily go with 10,684 on the en pack (and will need to).

But it does return to the question of potentially being able to personalize word counts as a design consideration independent of local language settings.

Offline

#80 2018-10-05 15:31:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,475
Website GitHub

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

Destry wrote #314417:

But it does return to the question of potentially being able to personalize word counts as a design consideration independent of local language settings.

Noted. Could do this as an attribute to the tag. Some sort of separator or something. But since we use that for other purposes in core tags, it’d need a better name and perhaps be applicable to any other things you might wish to customize about the counts (if there is anything?) Ideas welcome.


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

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

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
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.

Offline

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

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
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?

Offline

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,475
Website GitHub

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
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
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.

Offline

Board footer

Powered by FluxBB