Is it possible to skip some translation when using joomfish?
Asked Answered
C

1

19

I'm using Joomla 1.5.26 with Joom!Fish 2.1.7.

Does any Joom!Fish and/or joomla guru know if it is possible to do a call to JRoute::_() so that it is not intercepted and translated by Joom!Fish ?

If so, please explain. Thanks !

Side note:
What I'm trying to achieve is to make Joom!Fish use the language that I tell it to use rather than the one that site is currently displayed in. I need it to build a specific URl, which is the reason for the JRoute::_() call. If you have a more general solution I would appreciate that as well.

Callender answered 20/9, 2012 at 19:36 Comment(8)
Do you need a solution that requires no hacking, or small changes can be made to 'core' Joomla libraries?Oshaughnessy
Well, right now what I am doing is I manually build the URL by fetching the needed information from "my_table" if the language is the default one or from "jf_contents" if it is not. I'm not very fond of modifying the library files since it makes it troublesome to upgrade to newer versions. If you have a solution that is more "elegant" than what I've described though, I'll gladly hear it anyway.Callender
AFAIK, the url translator is the JFRouter class (plugins/system/jfrouter.php). I haven't deeply hacked it, but if your're in luck (and have a debugger), you can step through it and find the setting that it uses in order to determine the language. If this setting is changeable, you can then cache and change the value prior to the JRoute::_ call and restore it afterwards.Bibliophage
@Bibliophage Thank you for your comment. The call to JRouter is intercepted by Joom!Fish so no, it is not "changeable". What I want is a non-hack solution or an explanation why it cannot be done.Callender
What I meant is that JF determines the language based on some property (when it responds to the translation event). As the code is fairly convoluted and I don't know exactly what your setup is, I don't know which property that is. The best I can offer is a pointer to the main suspect (the jfrouter plugin) and since I do not have the time to analyze the code myself, I can suggest that you try and break execution in this plugin (using a debugger) and figure out which parameter determines the language. Then, if this parameter is writable, you can change it prior to translation.Bibliophage
Thanks again for taking the time comment. Joom!Fish uses a cookie as the parameter. What you are describing is almost what I am looking for. I don't want to overwrite the cookie but I will attempt to patch jfrouter so that it ignores the cookie if an additional parameter is given, and uses that parameter instead. I'll report back if I get anywhere with it.Callender
do you want to change the uri, but what do you want to change? injecting a custom parameter like index.php?option=com_foobar becomes index.php?option=com_foobar&customparameter=hellyes ?Geek
@Geek I'm thinking more along the lines of JRoute::_("index.php?option=com_foobar", "hellyes"). I haven't actually tried it yet thoughCallender
N
2

I think this could be help to you.,

The localization of content is one of these organizational issues which is closely related to organization of your website. In fact it all depends all on the structure of sections, categories and articles you choose for your site.

Please refer the following location :

Setup your site to use different information per language with core JoomFish

Nalchik answered 4/1, 2013 at 7:13 Comment(1)
Thank you for your reply John. The article you linked describes how to load content that is inherently different when a language is switched. I.e. it explains that joomfish is capable of loading a completely new article on a language change instead of just translating current one. What I'm looking for is an ability to load something in a language that is different from the one that the site is currently displayed in. If I missed something, please elaborate on your reply. Thanks!Callender

© 2022 - 2024 — McMap. All rights reserved.