From: Matthew M. <ma...@tu...> - 2002-10-21 12:13:37
|
Suggested procedure question. Say you are making a template for something. Inside the template you may want to include some text. The problem is that you also want that text translated. How should it be handled? o The module itself has a text area for you to add data to a template, it is stored in the database, translated, then sent to the template tag. o INCLUDE a php file that allows extra template tags with your module. This file allows the admin to add extra data. For example: <?php // The admin knows the template array is named 'myTemp' $myTemp["text1"] = $_SESSION["translate"]->it("Welcome to my website"); $myTemp["text2"] = $_SESSION["translate"]->it("Blah Blah"); ?> Then in the template file {TEXT1} {REG_TAG} {TEXT2} o Create a tag for the template function that translates text. Should we plan for this? Matthew McNaney Internet Systems Architect Electronic Student Services Email: ma...@tu... URL: http://phpwebsite.appstate.edu Phone: 828-262-6493 ICQ: 141057403 |
From: Steven L. <st...@tu...> - 2002-10-21 13:57:37
|
I have just been building this text within my modules. Most of the time I just put an _TEXT at the end of the template tag to designate text. Then I just put these directly in the template. I am not sure if we need another file to take care of this. If someone wants it to say something else, they can either go make a translation or just remove the template tag from the template and add their text to the template. Just my 2 cents. Open for suggestions. > Suggested procedure question. > > Say you are making a template for something. Inside the template you may > want to include some text. The problem is that you also want that text > translated. How should it be handled? > > o The module itself has a text area for you to add data to a template, > it is stored in the database, translated, then sent to the template tag. > > o INCLUDE a php file that allows extra template tags with your module. > This file allows the admin to add extra data. > For example: > <?php > // The admin knows the template array is named 'myTemp' > > $myTemp["text1"] = $_SESSION["translate"]->it("Welcome to my website"); > $myTemp["text2"] = $_SESSION["translate"]->it("Blah Blah"); > > ?> > > Then in the template file > {TEXT1} > {REG_TAG} > {TEXT2} > > > o Create a tag for the template function that translates text. > > Should we plan for this? > > > Matthew McNaney > Internet Systems Architect > Electronic Student Services > Email: ma...@tu... > URL: http://phpwebsite.appstate.edu > Phone: 828-262-6493 > ICQ: 141057403 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers -- Steven Levin Electronic Student Services Appalachian State University Phone: 828.262.2431 PhpWebsite Development Team URL: http://phpwebsite.appstate.edu Email: st...@NO... |
From: Matthew M. <ma...@tu...> - 2002-10-21 14:22:45
|
> If someone wants it to say > something else, they can either go make a translation or just remove the > template tag from the template and add their text to the template. That's what I was thinking but if people are running a multiple language site, they may complain that they are stuck with the text hardcoded in the template. I suppose it is up to the module developer. Matthew McNaney Internet Systems Architect Electronic Student Services Email: ma...@tu... URL: http://phpwebsite.appstate.edu Phone: 828-262-6493 ICQ: 141057403 |
From: Steven L. <st...@tu...> - 2002-10-21 14:31:26
|
Well I think in this case they would just have to provide another translation in the language module. >> If someone wants it to say >> something else, they can either go make a translation or just remove >> the template tag from the template and add their text to the template. > > That's what I was thinking but if people are running a multiple language > site, they may complain that they are stuck with the text hardcoded in > the template. > > I suppose it is up to the module developer. > > > Matthew McNaney > Internet Systems Architect > Electronic Student Services > Email: ma...@tu... > URL: http://phpwebsite.appstate.edu > Phone: 828-262-6493 > ICQ: 141057403 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers -- Steven Levin Electronic Student Services Appalachian State University Phone: 828.262.2431 PhpWebsite Development Team URL: http://phpwebsite.appstate.edu Email: st...@NO... |
From: Adam M. <ad...@tu...> - 2002-10-21 15:56:03
|
> $myTemp["text1"] = $_SESSION["translate"]->it("Welcome to my website"); > $myTemp["text2"] = $_SESSION["translate"]->it("Blah Blah"); I think the above method would work for translations in templates. If all non-HTML output in a template was in tags then everything could be translated. Again it does depend on the module writer to take advantage. Adam --------------------------------- Adam Morton Developer - Web Technology Group Appalachian State University http://phpwebsite.appstate.edu |