Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-12-29 16:08:59

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Characters encoding and posted format tag

Hi folks ;)

When I try this: <txp:posted format="%B %Y" lang="fr-fr" />
I got this result: décembre 2016

Am I missing something? How to get this expective result: décembre 2016 before the new year?

:)

Note: the website is utf-8 encoding without any other character problems.

Edit: using <txp:posted format="%B %Y" lang="fre" /> display: December 2016

Last edited by Pat64 (2016-12-29 17:06:54)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2016-12-29 22:04:57

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

Re: Characters encoding and posted format tag

I’d say it’s a bug. I f you have access to txplib_misc.php, could you please replace

    @list($lang, $charset) = explode('.', $locale);

with

    @list($lang, $charset) = explode('.', setlocale(LC_TIME, 0));

around line 3058, and report back? Thanks.

Offline

#3 2016-12-30 05:32:59

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: Characters encoding and posted format tag

Hi Oleg ;)

Nope. With TXP 4.6.2 <txp:posted format="%B %Y" lang="fre" /> display December 2016 even when changes had been made into the txplib_misc.php file (line #3131).

Could you try yourself for confirmation? Thank you.

Last edited by Pat64 (2016-12-30 05:48:10)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#4 2016-12-30 10:28:09

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

Re: Characters encoding and posted format tag

Hi Patrick,

yes, I confirm for <txp:posted format="%B %Y" lang="fre" />, but could you confirm for <txp:posted format="%B %Y" lang="fr-fr" /> and/or <txp:posted format="%B %Y" lang="fr_FR" />?

Offline

#5 2016-12-30 12:33:47

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: Characters encoding and posted format tag

Sure. Only <txp:posted format="%B %Y" lang="fr-fr" /> works but without the first letter capitalized. So, I use the ucfirst() function within a txp:php> piece of code.

Thank you Oleg and congratulation for your recent promotion as a Core Dev ;)

Edit: With your latest commit changes (12c347d) for the dev version, all choices work: <txp:posted format="%d %B %Y" lang='<txp:lang />' /> <txp:posted format="%d %B %Y" lang="fre" /> <txp:posted format="%d %B %Y" lang="fr_FR" /> <txp:posted format="%d %B %Y" lang="fr-fr" />. Good job!

Last edited by Pat64 (2016-12-31 06:14:35)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB