Joined: Mon Sep 05, 2005 8:58 am Posts: 186 Location: Madrid
The following tips apply for Joomfish 1.7 stable & joomla 1.0.7. Not tested with other configuration
------------------------------------------------------------------------------------------------------------------------------ TIP 1 - HOW TO LOAD A CSS DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ------------------------------------------------------------------------------------------------------------------------------
1. Add the following tag in your template index.php file:
This will write CSS files, depending of the selected language: english.css, spanish.css, german.css, italian.css, portuguese.css, etc...
2. If your defaut joomla language is set to english, then leave english.css empty & place it in the /templates/YOUR TEMPLATE NAME/css/ directory. Customize the other css files according to your needs. The most natural use is to change the path to an image file:
#whatever { background-image: url("../images/header_german.gif"); for the german.css file }
#whatever { background-image: url("../images/header_spanish.gif"); for the spanish.css file }
Place the produced CSS files into the /templates/YOUR TEMPLATE NAME/css/ directory
THAT's IT
------------------------------------------------------------------------------------------------------------------------------------------------------------------ TIP 2 - HOW TO LOAD AN IMAGE IN YOUR TEMPLATE DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ------------------------------------------------------------------------------------------------------------------------------------------------------------------
Use the same method lo load images placed in the template (please note that images placed in text are correctly managed with joomfish 1.7 stable):
Produce the different images with text, and name them
--------------------------------------------------------------------------------------------------------------------- TIP 3 - HOW TO LOAD SITE WIDE TITLE, META KEYWORDS & DESCRIPTION DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ----------------------------------------------------------------------------------------------------------------------
This one is a bit more tricky. We will need a core hack
THAT's IT This should work, and not erase dynamic titling & meta keywords&description per page appending
--------------------------------------------------------------------------------------------------------------------- TIP 4 - HOW TO LOAD A MODULE DEPENDING OF THE LANGUAGE ----------------------------------------------------------------------------------------------------------------------
muy! lindo señor, this is going to be SO usefull for many site designers! Do you mind if this gets "fished" into french and posted on joomla.fr (credits given of course)?
_________________ Sometimes one pays most for the things one gets for nothing. The important thing is not to stop questioning. Curiosity has its own reason for existing. AE http://joomla15.blogspot.com for J! 1.5 screenshots http://www.eyezberg.com
Joined: Fri Aug 12, 2005 6:15 am Posts: 1551 Location: Munich, Germany
Very well done 55,
just one side note.
In some circumstances the $mosConfig_lang variable isn't directly accessable in the template.
In that case you need to make sure the template script knows it by using a:
global $mosConfig_lang;
prior the first use.
about TIP 3: The more effective and cleaner solution would be to overwrite those variables (e.g $mosConfig_sitename) within your language file.
The a bit crapy thing is - you would need to create a new instance of the $mainframe object or set the head array manually. But I would prefer this solution as it is less changes in core files.
Alex
_________________ Joomla! Community Oversight Committee Member, follow me on twitter @akempkens Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish Think Network, Munich - http://www.ThinkNetwork.com
I'm glad to see some of my innovations are being found useful
Something else I want to use on this french-english site is a cookie that stores a user's language preference once they choose which one they want (currently I have that stored in a splash html file ie. http://www.kendryden.ca/index.html )
Joined: Fri Aug 12, 2005 6:15 am Posts: 1551 Location: Munich, Germany
This cookie is already set by the Joom!Fish. It's set per computer/browser of course.
Joomla! 1.5 will provide language selection per user, which is then stored in the user profile.
Alex
_________________ Joomla! Community Oversight Committee Member, follow me on twitter @akempkens Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish Think Network, Munich - http://www.ThinkNetwork.com
Thans for your tips. I tried to use "TIP 3 - HOW TO LOAD SITE WIDE TITLE, META KEYWORDS & DESCRIPTION DEPENDING OF THE LANGUAGE FRONT-END SWITCH ?".
Actually, it seems to work only on some pages, and not on the home page. I tried to also change joomla.php line 422: "$this->_head['title'] = $GLOBALS['mosConfig_sitename'];" -> "$this->_head['title'] = _SITENAME; "
but the problem is that language file has not been read yet when this line is executed. So it displays "_SITENAME".
I tried to put put : "include_once( $mosConfig_absolute_path .'/language/' . $mosConfig_lang . '.php' );"
before the call to : $mainframe = new mosMainFrame( $database, $option, '.' );
in index.php
Then _SITENAME is replaced, but the titles remains only in the default language.
Joined: Fri Aug 12, 2005 6:15 am Posts: 1551 Location: Munich, Germany
Hi,
just a short questions? Are those hints already implemented in our WIKI?
Thx Alex
_________________ Joomla! Community Oversight Committee Member, follow me on twitter @akempkens Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish Think Network, Munich - http://www.ThinkNetwork.com
Joined: Tue Jun 06, 2006 7:46 am Posts: 110 Location: Seoul
Woah, very cool tips! Thanks!
1) Does anyone know of any documentation that explains how to make a 3rd party app joomfish-able?
I am using a great calendar component by http://www.extrosoft.com/ called Thyme Calendar. Problem is, it is not multi-language programed... and I have 3 different asian audiences viewing my website.
2) How, therefore, can I hack thyme to use Joomfish's language files for calendar dates etc? 3) Also, how can I make the calendars content to allow for multiple translations through joomfish?
Please, how TO LOAD A CONTENT ITEM DEPENDING OF THE LANGUAGE ?
with Joomfish, is it possible to select just the ID of a content item in the translation page ? So we don't translate the content but we switch to another content item.
PS: thanks to Pasamio for helping me resolving some issues.
_________________ Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1 Qui vult dare parva non debet magna rogare. --------------------------------- Joomla! Translation Coordination Team
The following tips apply for Joomfish 1.7 stable & joomla 1.0.7. Not tested with other configuration
------------------------------------------------------------------------------------------------------------------------------ TIP 1 - HOW TO LOAD A CSS DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ------------------------------------------------------------------------------------------------------------------------------
1. Add the following tag in your template index.php file:
This will write CSS files, depending of the selected language: english.css, spanish.css, german.css, italian.css, portuguese.css, etc...
2. If your defaut joomla language is set to english, then leave english.css empty & place it in the /templates/YOUR TEMPLATE NAME/css/ directory. Customize the other css files according to your needs. The most natural use is to change the path to an image file:
#whatever { background-image: url("../images/header_german.gif"); for the german.css file }
#whatever { background-image: url("../images/header_spanish.gif"); for the spanish.css file }
Place the produced CSS files into the /templates/YOUR TEMPLATE NAME/css/ directory
THAT's IT
------------------------------------------------------------------------------------------------------------------------------------------------------------------ TIP 2 - HOW TO LOAD AN IMAGE IN YOUR TEMPLATE DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ------------------------------------------------------------------------------------------------------------------------------------------------------------------
Use the same method lo load images placed in the template (please note that images placed in text are correctly managed with joomfish 1.7 stable):
Produce the different images with text, and name them
--------------------------------------------------------------------------------------------------------------------- TIP 3 - HOW TO LOAD SITE WIDE TITLE, META KEYWORDS & DESCRIPTION DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ----------------------------------------------------------------------------------------------------------------------
This one is a bit more tricky. We will need a core hack
THAT's IT This should work, and not erase dynamic titling & meta keywords&description per page appending
--------------------------------------------------------------------------------------------------------------------- TIP 4 - HOW TO LOAD A MODULE DEPENDING OF THE LANGUAGE ----------------------------------------------------------------------------------------------------------------------
if ($mosConfig_lang== english ) {mosLoadModules ( 'inside_r', -2 );} ?>
if ($mosConfig_lang== french ) {mosLoadModules ( 'inside_rfr', -2 );} ?>
Feel free to add your own tips in the thread below!!!
NEXT PENDING ISSUE FOR ME IS NOW A FULL COMPATIBILITY BETWEEN JOOMFISH & OPEN-SEF
help! I am a total newbie to joomla, I am trying to change the language of my site (to Hebrew) - I just dont get it - when you say add... replace... Am I taking the source of the site created by joomla, editing it and then using it as any other website I created before the days of Joomla? can I then go back to Joomla (say to add another category) or will it then only be able to handle its own creations and I will have to re-edit the the lines each time?
In some circumstances the $mosConfig_lang variable isn't directly accessable in the template.
In that case you need to make sure the template script knows it by using a:
global $mosConfig_lang;
prior the first use.
I require a bit of help here, I do not fully understand what it is I need to do exactly...
I need to use the $mosConfig_lang variable, but it I need to call it in a place that is out of reach, or "not directly accessable in the template", I need to call it on VirtueMart template (browse_1.php template), it's simply not returning anything if I do a
Can you help me, Alex? I have a bit of an urgency here
Regarding TIP 4 - HOW TO LOAD A MODULE DEPENDING OF THE LANGUAGE...
Imagine I wanted 2 "Random Image" modules. One picking random English images and one picking random Spanish Images, I could use this tip to do this but how can I install 2 random image modules. Surely they cannot co exist as they will be called the same thing.
Joined: Fri Aug 12, 2005 6:15 am Posts: 1551 Location: Munich, Germany
Ifrit wrote:
I require a bit of help here, I do not fully understand what it is I need to do exactly...
I need to use the $mosConfig_lang variable, but it I need to call it in a place that is out of reach, or "not directly accessable in the template", I need to call it on VirtueMart template (browse_1.php template), it's simply not returning anything if I do a
Can you help me, Alex? I have a bit of an urgency here
Just add a
global $mosConfig_lang;
before the first use. This should make it available in general.
I do not know anything about virtualmart, just that there are some special things to have a look on. Have you seen the other threads about it?
Alex
_________________ Joomla! Community Oversight Committee Member, follow me on twitter @akempkens Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish Think Network, Munich - http://www.ThinkNetwork.com
Joined: Fri Aug 12, 2005 6:15 am Posts: 1551 Location: Munich, Germany
dweezil99 wrote:
Regarding TIP 4 - HOW TO LOAD A MODULE DEPENDING OF THE LANGUAGE...
Imagine I wanted 2 "Random Image" modules. One picking random English images and one picking random Spanish Images, I could use this tip to do this but how can I install 2 random image modules. Surely they cannot co exist as they will be called the same thing.
Any thoughts?
You do not need to install them. You can copy modules in the module manager. With that you can create more than one instance of the module in your system.
BTW: nice idea
Alex
_________________ Joomla! Community Oversight Committee Member, follow me on twitter @akempkens Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish Think Network, Munich - http://www.ThinkNetwork.com
_________________ Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1 Qui vult dare parva non debet magna rogare. --------------------------------- Joomla! Translation Coordination Team
if ($mosConfig_lang== italian ) {mosLoadModules ( 'advert1', 0 );} ?>
if ($mosConfig_lang== english ) {mosLoadModules ( 'advert3', -1 );} ?>
Works, but error reported: Use of undefined variable italian - assumed 'italian' in
..templates\nametemplate\index.php line ...
I tryed inserting the line global $mosConfig_lang;
above the if declaration, but it's the same.. Why does it say it's an undefined variable (or constant, after global $mosConfig_lang; declaration) if it can properly read it?
About the position of modules: is it possible to load the order of modules in the same position horizontally?
I found it, it wasn't a var, it was a constant, the _LANGUAGE constant. I consider this piece of code very useful to segment sites in search engines depending on the language. The code below is used in the index.php template file. If you are interested, I grab it from http://www.compassdesigns.net/tutorials ... orial.html
@Joom!Fish Devs. please review and correct if needed.
NOTE! There seems to be an issue with 3. pd components for site title, the meta tags are translated but not site title - any idea why and what to do about it? On core Joomla! components the title is translated correctly..
Joined: Fri Aug 12, 2005 6:15 am Posts: 1551 Location: Munich, Germany
As far as I know there is an overall issue with the Metatag information and site title in general. This should be solved in 1.8 release.
I'm still not 100% sure where to place those dialogs. They are supossed to be related to the language configuration. But I do not want to blow up this table with those information as I think they do not really belong there.
I don't have a clear idea in mind yet. Suggestions welcome
Alex
PS: As the forge seems to be very slow again I will review your entry a bit later
_________________ Joomla! Community Oversight Committee Member, follow me on twitter @akempkens Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish Think Network, Munich - http://www.ThinkNetwork.com
I'm still not 100% sure where to place those dialogs. They are supossed to be related to the language configuration. But I do not want to blow up this table with those information as I think they do not really belong there.
I don't have a clear idea in mind yet. Suggestions welcome
As I newer has been digging deeper into the Joom!Fish code, I can't tell you whats best to do from a coders view. But for me as an site admin and/or user I would expect to find those in the list with the rest of the translations, maybe under the name "Site Title/Metas" (or something like that) in the drop down list.
Joined: Fri Aug 12, 2005 6:15 am Posts: 1551 Location: Munich, Germany
Joop helps a lot as this is definitly one option.
Alex
_________________ Joomla! Community Oversight Committee Member, follow me on twitter @akempkens Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish Think Network, Munich - http://www.ThinkNetwork.com
Users browsing this forum: No registered users and 3 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum