Problems displaying translations of some plugins

Creating and modifying plugins.
Post Reply
amosbatto
Posts: 3
Joined: Thu Nov 27, 2008 2:57 pm

Problems displaying translations of some plugins

Post by amosbatto »

I'm using Serendipity 1.3.1 on Debian Lenny at http://66.150.224.204/amos/blog

I have set English as the default language for my blog. When I select Spanish with the Choose Language plugin from the sidebar of my blog, I see that almost all the interface turns to Spanish, but the days of the week and the names of months stay in English. Most of the titles of the sidebar, also display in Spanish, but "choose language", "syndicate this blog" and "categories" all remain in English. If I login as administrator and go to the Configure Plugins page, I see that the titles for plugins "Sindicate this Blog" and "Categories" are displayed in Spanish, but the title for the "Choose Language" plugin remains in English.

Any idea what is the problem?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problems displaying translations of some plugins

Post by garvinhicking »

Hi!

Check your "dpkg-reconfigure locale" output - you are missing the spanish locales. Only when those are installed, the date names will be translated.

Some plugins are not translated in spanish, so this is a reason why choose language is still english, though.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
amosbatto
Posts: 3
Joined: Thu Nov 27, 2008 2:57 pm

Where are the plugin translation files located?

Post by amosbatto »

Where can I translate the plugins? I would be willing to help translate from English to Spanish. I looked through the file lang/serendipity_lang_es.inc.php, and didn't find many phrases like "Syndicate this blog" which need to be translated.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Where are the plugin translation files located?

Post by garvinhicking »

Hi!

You can take a look at the lang_*.inc.php files inside each plugin subdirectory.

You can take the lang_en.inc.php as a starting point and create translations as lang_es.inc.php - once in ISO-8859-1 format, and once in a UTF-8 subdirectory in UTF-8 charset. But if you only are able to write translations in ISO OR UTF-8, I can also easily create the other variant to add them to Serendipipty.

In /lang/serendpity_lang_es.inc.php you should find all other strings that are not plugin related (or only for a few core plugins). The syndication plugin definitely is mentioned there, the constant "SYNDICATE_THIS_BLOG'" is used for that.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Garvin - I checked the language file.... the constant "SYNDICATE_THIS_BLOG'" *IS* translated to Spanish.... yet, choosing Spanish from amosbatto's site using the sidebar language select does not change that plugin's title to Spanish.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

There are some plugin where you can enter your own string as the title. Once you enter a fixed string, this will be used in all languages. To prevent that, one would need to patch the sidebar.tpl file and instead of the user's ttle use a constant, along the lines of this:

http://board.s9y.org/viewtopic.php?t=13 ... idebar+tpl
http://board.s9y.org/viewtopic.php?t=11 ... idebar+tpl
http://board.s9y.org/viewtopic.php?t=13 ... idebar+tpl

(Sorry, partially in german, but the code might be enough already to understand)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
amosbatto
Posts: 3
Joined: Thu Nov 27, 2008 2:57 pm

Trouble translating plugins

Post by amosbatto »

I translated the file plugins/serendipity_event_multilingual/lang_en.inc.php into Spanish and saved the file as plugins/serendipity_event_multilingual/lang_es.inc.php, but the translations fail to display when I select Spanish as the interface language. If I modify the strings in lang_en.inc.php, the changes appear in all languages. How can I make the plugin use the strings in the translated file?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Trouble translating plugins

Post by garvinhicking »

Hi!

When your blog uses the UTF-8 charset, you must also save your file (in UTF-8 charseT) inside the UTF-8 subdirectory.

Best regards,
garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Garvin - I read the posts referenced above. While I did not translate them, I get the basic concept being proposed. IMHO that is a lot to ask - modifying tpls, requiring a template to have config.inc.php, creating a function, etc.

I'm thinking out loud here - what if the plugins that permit changing titles that are otherwise defined in language files (ie, comments, syndication, etc) had a radio button option labeled, something like: "Force title from language file if defined y/n" or something like that? Then have the plugin set $item.title to the CONST.VALUE???
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
Don Chambers wrote:Garvin - I read the posts referenced above. While I did not translate them, I get the basic concept being proposed. IMHO that is a lot to ask - modifying tpls, requiring a template to have config.inc.php, creating a function, etc.
Yes, definitely some work is needed there, because matchmaking of a title is quite complex. And involves many definitions. The alternative, to create 20 or so title input fields for each language that could happen is IMHO even more bad.

I'm thinking out loud here - what if the plugins that permit changing titles that are otherwise defined in language files (ie, comments, syndication, etc) had a radio button option labeled, something like: "Force title from language file if defined y/n" or something like that? Then have the plugin set $item.title to the CONST.VALUE???
That would work, but would require editing each available plugin. This is a task that would take up too much of my time right now, so I can't offer to implement that as the benefit is IMHO quite small and not many people ask for that. And those that do ask usually get along with the proposed template changes. Tough call. :(


Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply