About / Multilanguage module

Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Fri, 2011-06-17 16:21

would it be possible for the About module to be compatible with the multilanguage module?
I've set up my entire site English/Dutch and would very much like to be able to do the same with the About page.

I've tried to edit the page directly but can't find the correct code to create an if/then construction :(

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2011-06-17 17:15

Here is how I did it.
1. edit about_block.html.php so it look like:

<?php defined("SYSPATH") or die("No direct script access.") ?>
<?= t("YOUR text goes here.") ?>
<?= module::get_var("about", "code"); ?>

2. save.
3. Change to the non English language you want to change the text to. UK in my case.
4. start the translation module: admin -> Settings -> Languages. Clink the start translation mode button.
5. Navigate to where the block shows. In my case the root album. Verify you are editing the language you want (UK in my case)
6. On the left you should see text 'YOUR text goes here.' click it.
7. Click 'copy source text'
8. Edit the text that is in English to what you want. In my case I did: 'YOUR text goes here this is UK words '
9. Save translation.

See in action:
http://www.langleycom.com/gallery3/index.php/
The "about' block is in the sidebar. Change the Language settings from English US to English UK and you will see the text change.

Similar to the About page you will have to edit that page as well.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Fri, 2011-06-17 17:37

I'm beginning to feel like a complete idiot... I really don't understand this, sorry :(

I'd been working on doing it like this:

if($_COOKIE['g_locale']==nl_NL

***HTML CONTENT DUTCH***


if($_COOKIE['g_locale']==en_US

***HTML CONTENT ENGLISH***

but quite obviously it doesn't work or I wouldn't be tearing my hair out.. heh...
maybe I'll just skip the whole bi-lingual about page and just add google translate :p

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2011-06-17 19:51

I gave you steps to try did those not work?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Fri, 2011-06-17 20:00

I did exactly as you described but when I went to translation mode all I could translate was the actual name of the module, not the actual content of the page.

I know I must be doing something wrong but I'm trying to add a completely new system to the several languages in my head and it seems they're just not able to play nice :p

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Fri, 2011-06-17 20:02

maybe a very bold question: if I give you the html I put in the admin of About, could you edit it for me so I might actually understand what's going on?
or maybe in a Teamviewer session, where I could see you do it? Maybe then I'll understand?

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Fri, 2011-06-17 21:15

the translation trick works for several other things, like my edited credit line.
it's just this About text that's not showing. Could this be because it contains quite a bit of html?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-06-18 16:41
Quote:
Could this be because it contains quite a bit of html?

Could be I never tired to add html to the t()function <?= t("YOUR text goes here.") ?>
I think it will accept <i> and <em> perhaps. Don't know never tired.
I think you might be getting confused.
The translation function will only work for text and #s in the t() function.
You can have multi t() functions in some page like:

<table border="0">
<tbody>
<tr>
<td><?= t("This is some text") ?></td>
<td><?= t("and some more") ?></td>
<td><?= t("even more") ?></td>
</tr>
<tr>
<td><?= t("next") ?></td>
<td><?= t("column") ?></td>
<td><?= t("has text") ?></td>
</tr>
</tbody>
</table>

Save that to the view file ( not the UI for the module ) and you should be able to translate the text.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-06-18 16:50
Quote:
if I give you the html I put in the admin of About, could you edit it for me so I might actually understand what's going on?

Sure post it here as an attachment or via PM

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Sat, 2011-06-18 16:53

ah, so basically this only works with text... I'm in trouble then, since it's not only the text that needs to change but also the images displayed.

for example

EN:

<br>
Should you have any questions or if you just want to keep posted on updates:
<br>
<br>
   <a
href="http://www.facebook.com/pages/Amalaswintas-Abyss/220185631338420" target="_blank"><img src="http://www.amalaswinta.com/gallery3/about thumbs/facebookEN.png"></a>        <a
href="mailto:contact@amalaswinta.com"><img src="http://www.amalaswinta.com/gallery3/about thumbs/EmailEN.png"></a>
<br>

NL:

<br>
Mocht je vragen hebben of wil je gewoon op de hoogte blijven van updates:
<br>
<br>
   <a
href="http://www.facebook.com/pages/Amalaswintas-Abyss/220185631338420" target="_blank"><img src="http://www.amalaswinta.com/gallery3/about thumbs/facebook.png"></a>        <a
href="mailto:contact@amalaswinta.com"><img src="http://www.amalaswinta.com/gallery3/about thumbs/Email.png"></a>
<br>

that's why I was hoping there'd be an "if locale==en_EN" function I could use

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Sat, 2011-06-18 16:55

you're an absolute angel!!!

here's the EN code:

<p style="margin-left: 45px; margin-right: -125px;">
<br>
<br>
<img src="http://www.amalaswinta.com/gallery3/about thumbs/welcome.png">
<br>
<br>


All images in this gallery were created using various applications (mainly <i>Poser</i> and <i>Photoshop</i>).<br>
Quite a large number of them is for sale, either as postcard(set) or as poster.
<br>
<br>
<i>I only sell digital versions of my images in exceptional cases, after signing a contract on
proper use.</i>
<br>
<br>
On occasion I create per request.
<br> 
In those cases the image <i>will</i> most likely be added to the gallery but will <i>not</i> be for sale.
<br>
<br>
<br>
Should you have any questions or if you just want to keep posted on updates:
<br>
<br>
   <a
href="http://www.facebook.com/pages/Amalaswintas-Abyss/220185631338420" target="_blank"><img src="http://www.amalaswinta.com/gallery3/about thumbs/facebookEN.png"></a>        <a
href="mailto:contact@amalaswinta.com"><img src="http://www.amalaswinta.com/gallery3/about thumbs/EmailEN.png"></a>
<br>






<p style="margin-left: 45px; margin-right: -110px;">

<img src="http://www.amalaswinta.com/gallery3/about thumbs/rule.png">

<p style="margin-left: 45px; margin-right: -125px;">
<br>
Click on any of the images below to get started. 
<br>
Enjoy browsing the gallery and feel free to leave a comment.
<br>
</p>
<p style="margin-left: 30px; margin-right: -125px;">
<br>
<a href="http://www.amalaswinta.com/gallery3/index.php/gothic"><img src="http://www.amalaswinta.com/gallery3/about thumbs/gothic.png"></a>
<a href="http://www.amalaswinta.com/gallery3/index.php/fantasy"><img src="http://www.amalaswinta.com/gallery3/about thumbs/fantasy.png"></a>
<a href="http://www.amalaswinta.com/gallery3/index.php/other"><img src="http://www.amalaswinta.com/gallery3/about thumbs/other.png"></a>
<a href="http://www.amalaswinta.com/gallery3/index.php/Portraits"><img src="http://www.amalaswinta.com/gallery3/about thumbs/portraits.png"></a>
<a href="http://www.amalaswinta.com/gallery3/index.php/humor"><img src="http://www.amalaswinta.com/gallery3/about thumbs/humor.png"></a>
</center>
</p>

and the NL code:

<p style="margin-left: 45px; margin-right: -125px;">
<br>
<br>
<img src="http://www.amalaswinta.com/gallery3/about thumbs/welcome.png">
<br>
<br>


Alle afbeeldingen op deze site zijn gemaakt met behulp van verschillende programma's (voornamelijk <i>Poser</i> en <i>Photoshop</i>).<br>
Een behoorlijk aantal afbeeldingen is te koop, hetzij als kaart (in setjes) of als poster<br>
<br>
<i>Ik verkoop alleen bij hoge uitzondering de digitale versie van mijn afbeeldingen, alleen na het ondertekenen van een contract over het toegestane gebruik.</i>
<br>
<br>
Bij gelegenheid maak ik ook afbeeldingen op verzoek.
<br> 
In die gevallen zal de afbeelding zeer waarschijnlijk wél aan de site worden toegevoegd maar zal dan niet te koop zijn.
<br>
<br>
<br>
Mocht je vragen hebben of wil je gewoon op de hoogte blijven van updates:
<br>
<br>
   <a
href="http://www.facebook.com/pages/Amalaswintas-Abyss/220185631338420" target="_blank"><img src="http://www.amalaswinta.com/gallery3/about thumbs/facebook.png"></a>        <a
href="mailto:contact@amalaswinta.com"><img src="http://www.amalaswinta.com/gallery3/about thumbs/Email.png"></a>
<br>






<p style="margin-left: 45px; margin-right: -110px;">

<img src="http://www.amalaswinta.com/gallery3/about thumbs/rule.png">

<p style="margin-left: 45px; margin-right: -125px;">
<br>
Klik op een van de afbeeldingen hieronder om te beginnen.
<br>
Veel plezier met het bekijken van de afbeeldingen. Voel je vrij om een reactie achter te laten.
<br>
</p>
<p style="margin-left: 30px; margin-right: -125px;">
<br>
<a href="http://www.amalaswinta.com/gallery3/index.php/gothic"><img src="http://www.amalaswinta.com/gallery3/about thumbs/gothic.png"></a>
<a href="http://www.amalaswinta.com/gallery3/index.php/fantasy"><img src="http://www.amalaswinta.com/gallery3/about thumbs/fantasy.png"></a>
<a href="http://www.amalaswinta.com/gallery3/index.php/other"><img src="http://www.amalaswinta.com/gallery3/about thumbs/other.png"></a>
<a href="http://www.amalaswinta.com/gallery3/index.php/Portraits"><img src="http://www.amalaswinta.com/gallery3/about thumbs/portraits.png"></a>
<a href="http://www.amalaswinta.com/gallery3/index.php/humor"><img src="http://www.amalaswinta.com/gallery3/about thumbs/humor.png"></a>
</center>
</p>
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-06-19 04:04
<? $locale = Gallery_I18n::instance()->locale(); 
if ($locale == "en_US") { ?>
Yankey :-) English content here.
<? } if ($locale == "en_GB") { ?>
Brit :-) English content here.
<? } ?>

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Sun, 2011-06-19 04:12

thankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthank
youthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouth
ankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyo
uthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthan
kyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyout
hankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthanky
outhankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyoutha
nkyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyou
thankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthank
youthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyou
:-D

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Sun, 2011-06-19 04:25

and the best thing is: I actually (sort of) understand what's happening so I can use if to solve some other problems too :D

so, again, thank you so much for your help, you've made it to the credit page on my site ;)