Language Files // Cached Entries

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Language Files // Cached Entries

Post by johncanary » Mon May 06, 2013 11:04 pm

Hi everybody,

Finally I have upgraded to 1.6.2. myself. Since I ran 1.1.2 (!), I did a clean installation and imported the data step by step directly into the database respectively installed plugins and configured them manually.

Done. The blog runs fine without any issues

Two questions:

(1) I needed to change "a lot" in the global ./lang/UTF-8/serendipity_lang_en.inc.php language file. Just have a ton of customized definitions.

Now, is there an option to keep "personal" settings in a local version of the file similar to the serendipity_config_local.inc.php configuration?

E.g. either ./lang/UTF-8/serendipity_lang_en.local.inc.php or
./templates/{my_template_name}/UTF-8/serendipity_lang_en.inc.php

Or do I have to reapply my local changes with every update?

(2) Where are the cached entries stored?

Cheers.

P.S.: Needless to say that I will grab the 1.7. release once it is stable enough … and play with the 2k11 responsive template, of course.
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Language Files // Cached Entries

Post by garvinhicking » Tue May 07, 2013 9:55 am

Hi!

Yes, one way is to actually declare them in your serendpity_config_local.inc.php - language files would be loaded after that file, and since constants are declared upon first usage and cannot be overwritten, that would be possible.

Another way it to create a lang_en.inc.php file in your custom template directory, this one should also get loaded before the global language.

Entries are stored in the serendipity_entryproperties database table, with the "ep_cache_body" and "ep_cache_extended" fields.

1.7 will actually be released in a few days :-)

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/

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: Language Files // Cached Entries

Post by johncanary » Tue May 07, 2013 10:13 am

Hey Garvin,
Thanks a bunch!
Makes totally sense, great.
Yours
John
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: Language Files // Cached Entries

Post by johncanary » Wed May 08, 2013 3:18 am

Garvin,

I could successfully define a local constants and overwrite the global value from the language file by putting it into the serendipilty_config_local.inc.php file as you described.

I only use one language, therefore, the solution with the configuration file is good enough for me.

However, I didn't get it to work in the template directories!
I tried both names for the file: lang_en.inc.php and serendipity_lang_en.inc.php
Tried all those directories, one at the time:
.../template/{my_template}/.
.../template/{my_template}/lang/.
.../template/{my_template}/lang/UTF-8/.
.../template/{my_template}/UTF-8.
The value did not get picked up from those locations.

Cheers.
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
yellowled
Regular
Posts: 7056
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Language Files // Cached Entries

Post by yellowled » Wed May 08, 2013 8:59 am

johncanary wrote:The value did not get picked up from those locations.
The correct values for those template lang files would be lang_*.inc.php and UTF-8/lang_*.inc.php, * being a placeholder for the language shortcode (e.g. “en” for English).

Does your theme have a config.inc.php and does it contain code for loading these lang files? Some older template don't have that. Please see Bulletproof's or 2k11's config.inc.php for example code.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Language Files // Cached Entries

Post by Timbalu » Wed May 08, 2013 9:12 am

I dimly do remember (in the context of global nav lang constants) that core lang files constants are loaded prior like described by John.... (maybe lang_en.inc.php only? but that would not make sence either...)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: Language Files // Cached Entries

Post by johncanary » Wed May 08, 2013 1:32 pm

yellowled wrote:
johncanary wrote:The value did not get picked up from those locations.
Does your theme have a config.inc.php and does it contain code for loading these lang files? Some older template don't have that. Please see Bulletproof's or 2k11's config.inc.php for example code.
YL
Thanks, yellowled,
That must be it. I did not try it out, yet, but looking into our 2k11 plugin it makes sense. And the config file was missing. My current template is based on the good old "competition" style with the coffee cup. Just too ancient. :-)
Yours
John

P.S.: Seems like your 2k11 will do a lot of tricks.
Will there be any docu/FAQ for that template?
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: Language Files // Cached Entries

Post by johncanary » Wed May 08, 2013 1:35 pm

yellowled wrote:
johncanary wrote:The value did not get picked up from those locations.
Does your theme have a config.inc.php and does it contain code for loading these lang files? Some older template don't have that. Please see Bulletproof's or 2k11's config.inc.php for example code.
YL
Thanks, yellowled,
That must be it. I did not try it out, yet, but looking into our 2k11 plugin it makes sense. And the config file was missing. My current template is based on the good old "competition" style with the coffee cup. Just too ancient. :-)
Yours
John

P.S.: Seems like your 2k11 will do a lot of tricks.
Will there be any docu/FAQ for that template? I remember you talked about it on s9yinfocamp, but that was some time ago and only for the German speaking peeps.
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
yellowled
Regular
Posts: 7056
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Language Files // Cached Entries

Post by yellowled » Wed May 08, 2013 3:35 pm

johncanary wrote:P.S.: Seems like your 2k11 will do a lot of tricks. Will there be any docu/FAQ for that template?
https://github.com/yellowled/s9y-2k11#readme covers pretty much all I have to say about 2k11. You might find more on 2k11 here in the forums.

If you really want to get into it, modify or fork it, you're gonna have to be up to speed on current web techniques (HTML5, CSS3, a bit of JS/jQuery). That's not to show off my skills or something, it's just necessary in order to provide a state-of-the-art template for s9y.

If you just want to create your own color scheme (highly recommended) or tweak the layout a little, http://yellowled.github.io should help with that.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: Language Files // Cached Entries

Post by johncanary » Thu May 09, 2013 12:52 am

Excellent!
Merci.
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: Language Files // Cached Entries

Post by johncanary » Fri May 10, 2013 1:45 am

yellowled wrote:
johncanary wrote:The value did not get picked up from those locations.
The correct values for those template lang files would be lang_*.inc.php and UTF-8/lang_*.inc.php, * being a placeholder for the language shortcode (e.g. “en” for English).

Does your theme have a config.inc.php and does it contain code for loading these lang files? Some older template don't have that. Please see Bulletproof's or 2k11's config.inc.php for example code.
YL
Now I have tested it with the latest 2k11 theme, version1.2.7.
I can add new constants via the template but cannot overwrite any global language definitions. Obviously the global language file gets loaded before the template specific ones. That means I cannot change globally defined language terms with the template.

I either change the global language file myself or use the serendipity_config.local.inc.php file to take care of changes.

I think for future updates I will use the diff and patch utilities and keep modifying the global language files to my liking myself. With those tools it should be easier to track all the changes.

Thanks for your support anyway.
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
yellowled
Regular
Posts: 7056
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Language Files // Cached Entries

Post by yellowled » Fri May 10, 2013 9:42 am

johncanary wrote:I think for future updates I will use the diff and patch utilities and keep modifying the global language files to my liking myself. With those tools it should be easier to track all the changes.
I imagine this to be quite a bit of work still. of course we don't have very frequent updates to the core, so one would only need to do this once or twice a year max, but still – we should think about a mechanism (a plugin, probably) to make this easier in the future.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: Language Files // Cached Entries

Post by johncanary » Fri May 10, 2013 2:11 pm

yellowled wrote:I imagine this to be quite a bit of work still. […] we should think about a mechanism (a plugin, probably) to make this easier in the future. ~YL
I used the notepad++ text editor to do that. With the compare plugin installed you see the differences between the old and new language files easily and can edit the new file right away. But, yeah, it is tedious work. And I was prepared to know what files I had changed (not only language files but that's a different story.)

A minimum requirement would be to make sure local changes to language files don't get wiped out by any update process. And a tool that lists those files that have changed similar to the integrity check for core files. Maybe that only needs to be extended to themes and plugins.
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
Don Chambers
Regular
Posts: 3633
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Language Files // Cached Entries

Post by Don Chambers » Sat May 11, 2013 5:21 am

Nice to see you posting here again John!

I have tried different ways of changing global constants. I too wanted to do it via a template, but it never worked. I have been so busy with "life" lately that I just don't have much time for testing, but I will be following this thread and will help in any way I can!

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: Language Files // Cached Entries

Post by johncanary » Sun May 12, 2013 12:57 am

Hi Don,

Yes, that was probably the reason why I did not upgrade to a current version earlier. I did not want to mess with all those things. I knew it takes more time but now I must say it was not too bad of a time sucker. I have even cloned the blog to create a test bed for 2k11 (<blogdev1.fcon21.biz>).

Good to see that you are still breathing, too. :-)
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

Post Reply