23452 Posts in 18901 Topics by 2877 members
|Go to End|
7 January 2009 at 5:09pm
Is there anyway to avoid using HTTP::set_cache_age(0) in the config.php file when switching between multi-lingual pages where translated pages share the same URL as the original page? I don't want to disable the cache on the CMS because of the performance hit.
If not, what are the alternatives? Should I append a ?lang=en at the end of each href link in the HTML code to specify the language and prevent the page from being loaded from the cache whenever user switches languages? What is the best way to avoid using set_cache_age(0) in config.php?
8 January 2009 at 2:25pm
Putting ?lang=en explicitly on the end of the URL is probably the best way.
9 January 2009 at 1:09am
My question then is how can I automatically put ?lang=en at the end of the URLs created using the WYSIWYG editor in the CMS?
15 January 2009 at 5:10pm
Okay, I found a simple solution to this problem using JQuery.
3 February 2009 at 11:42pm
there are many comments in the forum on the 'translatable' being overhauled in the 2.4 release - for now, it's still kind of a mess - UI troubles and the url problem you mentioned kept me away from using it.
nevertheless, the cms itself is great work, so i stayed with it and found a way around based on this (2 years old) thread:
in short, it enables me to have separate fields for the translated content, which will be shown when you have a language prefix in your url like 'mysite.com/en/about' or 'mysite.com/de/about'.
presumably not the most clever solution, but it works - i'd be willing to share the code in case anyone's interested (just reply).
4 February 2009 at 3:13am
@schellmax: I would be appreciate if you can share this implementation!
I totally agree with your comments to the unfinished translation module.
Many thanks, Bjoern
4 February 2009 at 11:11am
A similar solution can be found in the comments at:
5 February 2009 at 6:57am
@bschmitt: i've just added a recipe in the docs: http://doc.silverstripe.com/doku.php?id=recipes:multilingual_content
@Fuzz10: thanks for the hint, in fact my solution is pretty similar to yours (re-invention of the wheel...) but not exactly the same (regarding the more generalized approach of translatable fields and the url building) - i'd love to hear your comments on this.
i created a thread for this topic, please feel free to post there: http://www.silverstripe.org/general-questions/show/253576
have a nice day
|Go to Top|