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?
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).
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