Languages and alternative language support ⇒ i18n - l10n (languages) :: Archives ⇒ Why i have to speak english language to 'Toggle Content' ?!! :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Indexi18n - l10n (languages)

Archived ⇒ Why i have to speak english language to 'Toggle Content' ?!!


Hello every i18n user Flirt

This is maybe just a stupid remark, but since the i18n concept and the main reason of this excellent CMS (i think)..., I’m still wondering WHY coders continue to ‘hard code’ messages directly in the sources!?

My example here (and it's not the only one) concerns the ability to open or close a menu window.
... The ‘Toggle Content' appears in the sources... and of course the Greek or Arabian customer have to speak English to understand what it means !!!
Weird…. Isn’t it?

Well, for that... I try to find my solution: Here it is:

Somewhere in language\YOURLANGUAGES\main.php

define('_Toggle','Toggle Content'); or define('_Toggle','Basculez l\'affichage du contenu'); or define('_Toggle','Αλλάξτε την αφισοκόλληση του περιεχομένου'); etc…

In themes\YOURTHEME\theme.php
Example based on default theme version:
$Source: /cvs/html/themes/default/theme.php,v $
$Revision: 1.4 $
$Author: djmaze $
$Date: 2006/01/09 11:51:34 $

Replace lines (start at about 48) with:

if (blocks_visible('l')) { $img = hideblock('600') ? 'plus.gif' : 'minus.gif'; $imgl = '<img align="left" alt="'._Toggle.'" title="'._Toggle.'" id="pic600" src="themes/'.$CPG_SESS['theme'].'/images/'.$img.'" onclick="blockswitch(\'600\');" style="cursor:pointer" />'; } // right blocks ? if (blocks_visible('r')) { $img = hideblock('601') ? 'plus.gif' : 'minus.gif'; $imgr = '<img align="right" alt="'._Toggle.'" title="'._Toggle.'" id="pic601" src="themes/'.$CPG_SESS['theme'].'/images/'.$img.'" onclick="blockswitch(\'601\');" style="cursor:pointer" />'; }


In the section Array: (line 59) $cpgtpl->assign_vars(array(

Add line:
'TOGGLE' => _Toggle,


In themes\YOURTHEME\template\header.html
(Always from the cvs default example)

Replace line 44 with:
<img align="right" alt="{TOGGLE}" title="{TOGGLE}" id="pic{leftblock.S_BID}" src="{leftblock.S_IMAGE}" onclick="blockswitch('{leftblock.S_BID}');" style="cursor:pointer" />

And finaly:
In themes\YOURTHEME\template\footer.html
(Always from the cvs default example)

Replace line 11 with:

<img align="right" alt="{TOGGLE}" title="{TOGGLE}" id="pic{rightblock.S_BID}" src="{rightblock.S_IMAGE}" onclick="blockswitch('{rightblock.S_BID}');" style="cursor:pointer" />


This is a solution… An important job, just for two words!!!

But the question to the staff is:

Can we find this solution (or a better one) and all the other ‘hard coded’ messages in i18n external files in the near future?

αΩ

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
OS: Linux/Apache: v2.2.23/SQL v5.1.68/PHP: v5.3.20/DF CMS: v10.0.02 (Mod aK R4)


Yep.
I had already done it on my website.
Oh, and using _TOGGLE instead of _Toggle, is a bit more like Dragonfly in my case Rolling Eyes , doesn't matter really, I think, but still.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


Hello Estonia...

Realy good think to work with greek et cyrillic (i think) characters !

Well... about the capitals...

As you can see i start differently, just to say that this in MY personal values and not the GPC ones...
But after that, as usual, unconsciously ... i restart the caps... It was 05 o'clock in the morning !!!

Well... that's life... Whistling

Greetings

αΩ

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
OS: Linux/Apache: v2.2.23/SQL v5.1.68/PHP: v5.3.20/DF CMS: v10.0.02 (Mod aK R4)


kendavros wrote
Hello Estonia...
Realy good think to work with greek et cyrillic (i think) characters !

Sorry, I'm an idiot, I didn't understand what that sentence must to mean. Confused

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-

Last edited by Eestlane on Thu May 18, 2006 6:54 pm; edited 1 time in total


Oh yes... sorry
Well, we don't really speak Greek in Paris, but (as you can see from the Athens-Acropolis picture of my Avatar) I am Greek...

Thats the reason...

Bye , Γειά Χαρά.

Κένταυρος.

αΩ

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
OS: Linux/Apache: v2.2.23/SQL v5.1.68/PHP: v5.3.20/DF CMS: v10.0.02 (Mod aK R4)


Umm...but Estonia isn't Greek...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-

All times are UTC