Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-09 20:14:13

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

How to display archive by months in languages other then english?

Hello, I’m having this problem for some time and looking for any plugin or way to do this.

I was using rss_suparchive to display archive by months. Everything works fine, but months are in english, which is also fine, but somethimes I need some other language. And as I’ve been told thats got something to do with adjusting PHP’s strftime function.

But I dont know PHP that much. So I asked about this on a php forum, and it seems that this function uses the other, setlocale(), which then depends from server and so on…

I dont have to use rss_suparchive, maybe there is some other plugin or way to to this, where I can easily adjust languages for monthly archive.

Thanks!

Offline

#2 2008-02-10 08:01:37

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: How to display archive by months in languages other then english?

This might be of help.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2008-02-10 17:20:27

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: How to display archive by months in languages other then english?

No, I dont think this can help me. This is outputing a list of all articles in one month, and even here I dont know how to custimize month name to display in other languages.

OK, maybe I didnt explain good what I need. I need something that is common on almost every blog arround the world. Something like this:

Archive

January 2007(24)
February 2007(13)
.
.
.

This can be on home page of a site or any other page, on blog page left or right. It is just an archive by months and displays how many articles are in one month( 24, 13…).

Using rss_suparchive it is not a problem to make it like this. But I need to display names of montsh in other languages. That is my problem.

Any help, please?

Last edited by AndrijaM (2008-02-10 17:21:00)

Offline

#4 2008-02-11 12:05:26

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to display archive by months in languages other then english?

Customizing month names: with Textpattern it depends upon the language you have chosen for your site and the locales available on your server.

The link Yiannis provided is most of what you want to achieve.

Offline

#5 2008-02-11 13:35:42

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: How to display archive by months in languages other then english?

Well I just tried to change the language I’ve chosen for my site, but the month names are the same. At least with using rss_suparchive. So that doesnt help me.

I already know that month names are depending from locales available on my server. But what exactly am I suppose to do now? How to fix that. And what about multilangual web site?

I have to say I feel disappointed about txp. Can somebody correct me if I’m wrong, but wasnt txp supposed to be for non-programers?
That is the reason I started to learn txp in the first place. Now, all I want is very simple archive with months written in language of my choise, and it is not possible in txp, unless I’m a php guru or something.

This is very serious disadvantage of txp. How can I now trust txp that few months down the line something else similar to this doesnt happend?

Last edited by AndrijaM (2008-02-11 13:37:39)

Offline

#6 2008-02-11 13:48:42

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: How to display archive by months in languages other then english?

Hi AndrijaM

but wasnt txp supposed to be for non-programers?

I am no programmer myself and my scripting abilities are minimal

If the problem lies with the rss_superarchive plugin maybe posting in that thread will be more appropriate as that might be a problem with the plugin itself and not textpattern. The link I posted for you does the archives and as you might have noticed no php is required.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2008-02-11 14:43:03

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: How to display archive by months in languages other then english?

Thanks, problem is not with rss_superarchive, it does what it does the way its supposed to.

Please, take a look at this web site:

http://blog.venture-skills.co.uk/2007/05/09/top-5-css-layout-tips/

this is just a random site I found after clicking 2-3 times on stumble button. On the left side, there is archive with months and a number of articles in every month.

That is what I need, only not in english, but in language of my choice. Is this possible to do in txp? For someone who is not programmer, of course :)

Offline

#8 2008-02-11 15:31:57

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: How to display archive by months in languages other then english?

The site you found was a wordpress site. PHP skills are required to use that software.

We all see sites in the net which seem simple to do. It’s another thing doing it though.

Last edited by colak (2008-02-11 19:57:27)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2008-02-13 15:44:40

shi
Member
Registered: 2005-12-09
Posts: 34

Re: How to display archive by months in languages other then english?

Maybe this can help you…

http://forum.textpattern.com/viewtopic.php?pid=157416#p157416

Offline

#10 2008-02-13 17:16:44

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: How to display archive by months in languages other then english?

Looks like this could help me, but I dont know just how to use that code:

<txp:php>
global $locale;
setlocale(LC_ALL, ‘nl_NL.UTF-8’);
</txp:php>

where should I put it?

And “the locale string (nl_NL.UTF-8) and format to suit”, where is that string, in database maybe?

Offline

#11 2008-02-13 18:21:01

shi
Member
Registered: 2005-12-09
Posts: 34

Re: How to display archive by months in languages other then english?

I guess you need month names in Serbian language. In that case you should use

<txp:php>
global $locale;
setlocale(LC_ALL, 'sr_YU.UTF-8');
</txp:php>

I wrote this code long time ago, so if I remember well – you need to set Locale before displaying months in your txp code.

<txp:output_form form="header"/>

<txp:php>
global $locale;
setlocale(LC_ALL, 'sr_YU.UTF-8');
</txp:php>


<txp:glx_if_section_frontpage>
<div class="desniArhiva">
<txp:rss_suparchive_menu section="politika,hronika,drustvo,svet,zabava,sport" />
<div class="desniBoxLink"><txp:article_custom section="arhiva" limit="1" pgonly="0" form="samo_link" />
</div>
</div>
<txp:rss_suparchive section="politika,hronika,drustvo,svet,zabava,sport"  dateformat="%d. %B %Y." class="arhivaLista" limit="600" />
</txp:glx_if_section_frontpage>


<txp:if_individual_article>
<txp:article_custom section="arhiva" limit="1" form="body" />
</txp:if_individual_article>

<txp:output_form form="footer"/>

Offline

#12 2008-02-14 10:17:07

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: How to display archive by months in languages other then english?

Just tried, but no luck. Still not working, I put it in my code like this:

<txp:php>
global $locale;
setlocale(LC_ALL, ‘sr_YU.UTF-8’);
</txp:php>
<txp:rss_suparchive_menu section=“blog” linktosection=“arhiva” showheader=“1” headerlabel=“Arhiva” headerlevel=“4” />

It says on txp faq, http://textpattern.com/faq/30/how-do-i-display-time-and-date-formats-in-my-local-language

“If you’ve selected the appropriate language in textpattern > admin > preferences and are still not seeing dates in your language, it most probably means that your web server’s operating system has limited support for your language.”

I selected appropriate language in admin/prefs, and the funny thing is that server is supposed to be in Serbia, and I still can get serbian language.

Offline

Board footer

Powered by FluxBB