There isn’t a way to tell Blogsome you are writing in a different language, but with things like dates, that are generated using Smarty tags, there is a way to replace the English words with those of your chosen language.
Where you’d normally use a tag like: {the_time d='l, j F Y'}, which would generate something like: Thursday, 23rd March 2006, you can set up your template with:
{capture name=the_date}{the_time d='l, j F Y'}{/capture}
Then, assign this captured text to a new variable, after translating each word you know might appear in the text using |replace:"old":"new", which you can repeat for each word.
For example, to replace all of the day names with their Spanish equivalent, and assign the result to $la_fecha, I used:
{assign var=la_fecha value=$smarty.capture.the_date|replace:"Monday":"Lunes"|replace:"Tuesday":"Martes"|replace:"Wednesday":"Miércoles"|replace:"Thursday":"Jueves"|replace:"Friday":"Viernes"|replace:"Saturday":"Sábado"|replace:"Sunday":"Domingo"}
Then, wherever you want to use {the_date} in the Spanish format: {$la_fecha}.
Obviously, you’ll need to repeat this for month names as well, which I will leave as an exercise to the reader.
I never thought that you go so far on doing this kind of stuff, like taking nearly 1 week to help the one who has problems with this kind of stuff.
I’ll help you back:
That’s for your learning. Knowing spanish in a globalized world is like knowing english…
Greets and keep on trackin’
15 hours, 12 minutes after the fact.
It would be nice to have it so it would automatically handle shortened/abbreviated months too, but I think this is beyond what is ‘nice’ to do in Smarty.
I’ll look into the modifier plugin, as that’s a much nicer solution.
17 hours, 38 minutes after the fact.
Oh thanks. Very useful for me.
But, to change months names in:
- archives monthly.
- titles of categories name in posts.
Is it the same way?
2 days, 6 hours after the fact.
In archives monthly, I don’t know exactly. It didn’t work to me.
And I didn’t understand the last question…
But it can be donde in some manner…
2 days, 22 hours after the fact.
Marco: En la segunda pregunta me refiero al elemento ‘title’ que se despliega en los enlaces de las categorÃas de cada post (en las del mené ya lo conseguÃ).
Matthew: The title atribute in the categories of sidebar show the description (in spanish) of the category. Is the same way in posts?
Muchas gracias, thanks. This the best blog to help to blogsome users. I try to save de wall of the language.
3 days, 5 hours after the fact.
jugular103: Okay, I get you now. The title attribute, or the tooltip that appears when you hover over a link.
This code is generated by
{the_category seperator=", "}.You could use the same trick:
{capture name=cats}{the_category seperator=", "}{/capture}and then:
{$smarty.capture.cats|replace:"View all posts in":"Opinion todos los postes adentro"}This looks to be the only way to do so, since the_category has few arguments (the one listed above, and
parents, which shows the hierarchal tree of categories).4 days, 1 hour after the fact.
As for monthly archives, I’ve played with it and got the following:
And then, where I want the dropdown to be:
{$monthly_archives}You could use
format='html'instead, or whatever you already use in your template.4 days, 1 hour after the fact.
Okay, I’ve played with the modifier, and it isn’t working too well. I’ve also tried to create a function that will set the locale for the current process, but that didn’t work either.
The trick seems to be that Blogsome uses a file called locale.php, where all of the data is stored. I’m giving up on this one, as the solution I’ve provided is better than anything I can come up with as a more complete solution for now.
4 days, 4 hours after the fact.
It works perfect. Thank you very much.
1 week after the fact.
Good work
2 weeks, 6 days after the fact.
Thank you so much
It’s working great!
1 month, 3 weeks after the fact.