Custom serendipity language file

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Frandy

Custom serendipity language file

Post by Frandy »

Hi,

Is it possible to specify a custom language file for serendipity ?
I use french supplied language file but i'd like to custom it.
is it possible to put my custom language file in my custom template directory instead of edit serendipity default french language file ?

Thanks for help

Frandy
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Custom serendipity language file

Post by garvinhicking »

You cannot put the language file into your template, no.

There are two ways for doing this:

1. You edit the french language file. Before you upgrade serendipity you save your file and compare it with the new french file, merge the changes and use your own file again.

2. You copy the french file to /lang/serendipity_lang_fr2.inc.php, then you edit the serendipity_config.inc.php file and search for "fr". You will see an array of defined languages. Add a new line for "fr2" => "My French" and save the file. Then go to your configuration panel and change the language to "My French".

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/
Martin
Regular
Posts: 90
Joined: Mon Sep 27, 2004 1:30 am
Location: Oslo
Contact:

Post by Martin »

I've edited the enlglish language file a little myself because I wanted a pretty specific date-format amongst other things. Using a tool like BBEdit it's really not a big problem to manually correct the files after updating.

-M
Trograin
Regular
Posts: 17
Joined: Sun Oct 09, 2005 9:57 pm
Location: Helsinki in Finland
Contact:

Post by Trograin »

While talking about language files ehre I thought of posting my question. Swedish language file? will that for some weird reason come up some day...considering the finnish one allready exists :)

I live in FInland but the peopel that will be using my blog are swidish speaking people mostly and rather likes everything to be in swedish :D

any idea if it will happend that there will be a swedish language file added to s9y?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

A basic swedish translation is contained in Serendipity 0.9 versions. Volunteers who contribute to the language files are heartly welcome; none of our core developers are speaking swedish, so it's all up to you, the community! :)

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/
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: Custom serendipity language file

Post by Huhu »

Same question, but with an addendum: I would like to edit the default output for certain plug-ins (Spamblock in connection with contact form for example, see http://www.jugger.se/index.php?/pages/kontakt.shtml ).
Because one ends up in a heap of different lang files with small changes, it is quite a thing to blend the changes in after every update.

So, my question: Is it planned for the future to use one central lang file under /templates/[custom template]/ where all customized changes can be put, as the first poster has asked? Which then would not be deleted with an update, saving at least a considerable amount of work?
Or could there be a "master lang file" that overwrites the entries in individual plug-in lang files? Then only one file would have to be updated.

@Garvin I would love to contribute localized lang files, yet mine are far from complete up to now.
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Custom serendipity language file

Post by garvinhicking »

Hi!

You can set $serendipity['useTemplateLanguage'] = true in your serendipity_config_local.inc.php, this should enable you to use a "lang_en.inc.php" inside your custom template directory to specify any constant you'd like to use.

Another possibility is to simply set all your language constants also directly inside serendipity_config_local.inc.php - this file will not get overwritten by updates, and it is loaded before any other language file.

HTH,
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/
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: Custom serendipity language file

Post by Huhu »

Great! Thanks! (or as the Swedes say: Kanon! :) )
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: Custom serendipity language file

Post by Huhu »

Short question ... I am quite sure I had asked this once a while ago but can't find any posting matching this, so it might have been another system where that has been about.

I would like to change the language of the blog. Doing this through Configuration -> General Settings doesn't work, a change of the language is not saved (switches back to English when saving).

Editing the lang settings in serendipity_config.inc.php also doesn't help it seems.

Any help? Thanks!
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Custom serendipity language file

Post by Timbalu »

Personal Preferences lang option setting overwrites blog lang.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: Custom serendipity language file

Post by Huhu »

Timbalu wrote:Personal Preferences lang option setting overwrites blog lang.
That was it! Right!
Strange thing is, if the admin account is set to one language in the personal settings, it seems the blog config (which should show the basic configuration, not teh personal) resets itself to that language?
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Custom serendipity language file

Post by Timbalu »

Yes. See my and Garvins answers here
http://board.s9y.org/viewtopic.php?f=4& ... #p10438794
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Custom serendipity language file

Post by yellowled »

challpagal wrote:I would like to change the language of the blog. Doing this through Configuration -> General Settings doesn't work, a change of the language is not saved (switches back to English when saving). ???
You might need to switch it in “Personal Settings” as well.

YL
Post Reply