Joomla! Discussion Forums



It is currently Sun Nov 08, 2009 6:12 am (All times are UTC )

 




Post new topic Reply to topic  [ 11 posts ] 
Author Message
Posted: Wed Oct 11, 2006 10:02 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Sep 28, 2005 11:34 am
Posts: 163
I want the "You are here" text to appear in Spanish and English.

It is wise to add a definition to the language files?  Or is there a better way to do this?

_________________
http://www.boiledsweets.com


Last edited by infograf768 on Sat Oct 14, 2006 9:01 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Wed Oct 11, 2006 10:34 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 11542
Location: **Translation Matters**
Usually, this is provided in the template index.php as:
Quote:

You are here:


Adding the Spanish text after (or before) the English one will do

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
---------------------------------
Joomla! Translation Coordination Team


Top
  E-mail  
 
Posted: Wed Oct 11, 2006 10:35 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Sep 28, 2005 11:34 am
Posts: 163
Hi,

but there is one index.php used for both English and Spanish so I cannot have "you are here" hard coded in there.  Is there a better way?

_________________
http://www.boiledsweets.com


Top
  E-mail  
 
Posted: Wed Oct 11, 2006 10:44 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 11542
Location: **Translation Matters**
Do you mean you are using Joomfish and switching languages?
Your original post is unclear.

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
---------------------------------
Joomla! Translation Coordination Team


Top
  E-mail  
 
Posted: Wed Oct 11, 2006 10:51 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Sep 28, 2005 11:34 am
Posts: 163
I am using Joom!Fish and switching languages.  However please let me explain the problem further...

I have some static text on my site in the index.php, for example "You are here".  As this is not content stored in the database (and therefore would NOT be translated by Joom!Fish) it always shows as "You are here" regardless of the language.

I figured I could add a definition to each language file something along the lines of

define('_YOUAREHERE','You are here');

in the english.php and

define('_YOUAREHERE','Qui esta');

in the spanish.php

then in the index.php use "echo _YOUAREHERE"

That way the correct text would be shown.  However I'm told that editing the language files is not a good idea as they might change in the next Joomla release so wondering what a better way of doing this is.

_________________
http://www.boiledsweets.com


Top
  E-mail  
 
Posted: Wed Oct 11, 2006 12:06 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 11542
Location: **Translation Matters**
I'll move this topic to the multilanguages forum.

But, in that case you have a very simple solution:

Add these lines where you want the pathway to show in your template:
Code:
<div id="path">
   <?php  if($mosConfig_lang == 'english') { echo '<div id="pathwaynest" align="left"><p class="pathwaytext">You are here: '; include "pathway.php"; echo '</p></div>'; }?>

<?php  if($mosConfig_lang == 'spanish') { echo '<div id="pathwaynest" align="left"><p class="pathwaytext">Qui esta : '; include "pathway.php"; echo '</p></div>'; }?>
</div>


Hope it helps.

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
---------------------------------
Joomla! Translation Coordination Team


Top
  E-mail  
 
Posted: Wed Oct 11, 2006 12:15 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Sep 28, 2005 11:34 am
Posts: 163
That is certainly a possible solution but that mean I now have language specific stuff defined in my index.php which is not great is it?

I thought it might be better to have a completely separate set of language files (with all the static text in) and 'import' this somehow something like this...

Have a lang_custom_english.php containing...

DEFINE('CL_YOUAREHERE', 'You are here : ');
?>

and a similar one for spanish then in the index.php do this...



and then

 


But it doensn't seem to show the actual text defined.  Any thoughts?  I have a few static text and possibly several languages to support.  It just doesn't seem right to have hard coded strings in the index.php

_________________
http://www.boiledsweets.com


Top
  E-mail  
 
Posted: Wed Oct 11, 2006 2:18 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 11542
Location: **Translation Matters**
dweezil99 wrote:
That is certainly a possible solution but that mean I now have language specific stuff defined in my index.php which is not great is it?

And why that?  ???

It is a simple solution. What is simpler is better. Just modifying one non-core file.
If you know another solution, please try it and implement it, then let us know.

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
---------------------------------
Joomla! Translation Coordination Team


Top
  E-mail  
 
Posted: Thu Oct 12, 2006 10:11 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Sep 28, 2005 11:34 am
Posts: 163
Many thanks!  I REALLY APPRECIATE YOUR HELP.

:)

_________________
http://www.boiledsweets.com


Top
  E-mail  
 
Posted: Thu Oct 12, 2006 10:20 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 11542
Location: **Translation Matters**
NP  ;)

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
---------------------------------
Joomla! Translation Coordination Team


Top
  E-mail  
 
Posted: Sat Oct 14, 2006 9:00 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 11542
Location: **Translation Matters**
I have hacked another solution for you (and for all  ;) ).

I modified Stingrey Pathway Module in order to include a Text parameter (as well as css class suffix).

This needs a slight modification in the Joomfish following file (modif included in the archive attached, just replace the old one with the new manually).
administrator/components/com_joomfish/contentelements/module.xml

Then install the module (zip included in the archive) and display/publish it in a specific position in your template and translate that text field for each language through joomfish usual method.
As this is a db parameter, do not forget to separate the moduleclass sfx param and the text param by a return.
The "You are here" or whatever you like will be placed before the pathway.

To get the module.xml file and the module zip package, first unzip the archive and the module.xml

That should avoid adding quite a few language "ifs" in the template when many languages are at stake.

I'll now change the Title of this thread to reflect the issue.


You do not have the required permissions to view the files attached to this post.

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Qui vult dare parva non debet magna rogare.
---------------------------------
Joomla! Translation Coordination Team


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 1 guest


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

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group