Page 1 of 2

Language Files // Cached Entries

Posted: Mon May 06, 2013 11:04 pm
by johncanary
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.

Re: Language Files // Cached Entries

Posted: Tue May 07, 2013 9:55 am
by garvinhicking
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

Re: Language Files // Cached Entries

Posted: Tue May 07, 2013 10:13 am
by johncanary
Hey Garvin,
Thanks a bunch!
Makes totally sense, great.
Yours
John

Re: Language Files // Cached Entries

Posted: Wed May 08, 2013 3:18 am
by johncanary
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.

Re: Language Files // Cached Entries

Posted: Wed May 08, 2013 8:59 am
by yellowled
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

Re: Language Files // Cached Entries

Posted: Wed May 08, 2013 9:12 am
by Timbalu
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...)

Re: Language Files // Cached Entries

Posted: Wed May 08, 2013 1:32 pm
by johncanary
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?

Re: Language Files // Cached Entries

Posted: Wed May 08, 2013 1:35 pm
by johncanary
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.

Re: Language Files // Cached Entries

Posted: Wed May 08, 2013 3:35 pm
by yellowled
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

Re: Language Files // Cached Entries

Posted: Thu May 09, 2013 12:52 am
by johncanary
Excellent!
Merci.

Re: Language Files // Cached Entries

Posted: Fri May 10, 2013 1:45 am
by johncanary
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.

Re: Language Files // Cached Entries

Posted: Fri May 10, 2013 9:42 am
by yellowled
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

Re: Language Files // Cached Entries

Posted: Fri May 10, 2013 2:11 pm
by johncanary
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.

Re: Language Files // Cached Entries

Posted: Sat May 11, 2013 5:21 am
by Don Chambers
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!

Re: Language Files // Cached Entries

Posted: Sun May 12, 2013 12:57 am
by johncanary
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. :-)