CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 LANGUAGE PACKS PLEASE!

Print topic Send  topic

Author Message
feha


Posts: 712
Posted: 01/15/2004, 5:15 PM

I wonder.
Why such nice ID as CodeChargeStudio.
Doesn't create (generate) a file with the variables instead of putting messages and text in to Templates ?

This would make very easy way to develop webapplications with Multilanguage packs.

example error messages ...
form labels ...
etc ...

Yes there are the language packs but after the application is created in chosen language there is no easy way to regenerate
same project in to other language ...

If there where variables instead of hardcode TEXT that could help a lot making webapplications ready for Multilanguage.

Please YesSoftware consider this as an important FEATURE in future versions of CCS ...

There are some less powerful IDE (Example PHP Maker 2.0) already producing XML for use as Multilanguage packs ...

regards
feha
www.vision.to

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
Edd


Posts: 547
Posted: 01/15/2004, 5:52 PM

feha,

I think the whole HTML template arena in Codecharge is it's Achillies heel.

The product is "FANTASTIC" is so many areas but it does need XML templates. I really hope that this is in version 3 as I would gladly pay for it as it open up so many areas such as multiligual support,

If Yes Software read this I hope they build a wish list for version 3 and incorporate XML as a major part of the new version.

_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
peterr


Posts: 5971
Posted: 01/15/2004, 7:24 PM

Thank you for your suggestions.
Site Internationalization, but not necessarily replacing HTML with XML, is scheduled for the version 3.0 of CCS.
Note that "XML" can be implemented in a variety of ways and implementing XML doesn't mean replacing HTML or creating "XML templates", although it could be done this way.
If you see other reasons of replacing HTML templates with XML templates I recommend creating a different discussion topic and possibly listing the site internationalization as one of the benefits.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Vitus
Posted: 01/17/2004, 12:54 AM

When would version 3.0 be released? We need multilingual support badly. This is one of the reason we hesitate to use CCS at the moment.
peterr


Posts: 5971
Posted: 01/17/2004, 11:25 PM

There is no information available regarding v3.0 release date. Actually, I found that the Internationalization feature is to be included at the latest in version 3.0, while it could be released earlier, though I still couldn't tell you the date.

However, if you need multi-lingual support badly, you can probably already use it in the current CCS version. I guess the initial question (above) could be about "how to implement internationalization in CCS", instead of "why CCS doesn't generate files with international translation strings". Although in the near future we plan to automate this process little more, here is what you can already do thanks to our HTML Templating technology:

1. Create HTML templates in multiple languages. For example load each generated HTML page into an HTML editor, edit the text and save it with a different time for each language. Then modify the generated CCS code to load the appropriate HTML template dynamically.

OR
2. Manually create file(s) with multi-language translation strings (this can be XML as proposed by feha above), then place the corresponding translation string names throughout the HTML pages in CCS. Then create custom program function that would read the appropriate translation strings from the file and replace all international string names within the page right before the page is output to the browser. For example you can try this:
a) Add the text "itext_helloworld" anywhere to any page in CCS.
b) Find this command in the generated code:
HTMLTemplate.PParse "main", False
and replace it with:
  
HTMLTemplate.Parse "main", False  
Dim MyPage  
MyPage = HTMLTemplate.GetVar("main")  
select case CCGetRequestParam("language", ccsGet)  
  case "en"  
    MyPage = Replace(MyPage, "itext_helloworld", "Hello World")  
  case "it"  
     MyPage = Replace(MyPage, "itext_helloworld", "Ciao Mondo")  
  case else  
    MyPage = Replace(MyPage, "itext_helloworld", "")  
end select  
response.write MyPage
c) Then test your page using the "language" URL parameter, like:
http://localhost/.../page.asp?language=en
http://localhost/.../page.asp?language=it
You will see that now your page is internationalized.

The above is only a test function, however it could be easily extended to read translated strings from files and translate the whole pages. Therefore the whole implementation of the internationalization feature could take couple hours of work for a programmer.
Note that the method #2 will decrease the server performance and the Replace function probably should be 'replaced' with some custom parsing method.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
vitus
Posted: 01/18/2004, 12:29 AM

Thanks for the suggestion, Peter!

Your option 1 is interesting. I was wondering if we can save the template in different language folder and modify the path based on a session variable on language. If practicable, kindly advise which file we should modify. By the way, we need to modify the charset setting for the language as well. Is there a single file we can modify for this charset setting, please?

Vitus
www.hkbizworld.com
peterr


Posts: 5971
Posted: 01/18/2004, 2:17 PM

Sure. Please specify which programming language you plan to work with.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
vitus
Posted: 01/19/2004, 4:03 AM

We need it for both asp and php.

Thanks!
peterr


Posts: 5971
Posted: 01/19/2004, 4:29 PM

In ASP this should be as simple as specifying in Page "After Initialize" event::
TemplateFileName = "<TemplateName>.html"
(replace <TemplateName> with the real name)

Of course you can use it with sessions, for example by storing the language in a session variable and using such code:
TemplateFileName = "<TemplateName>_" & Session("language") & ".html"

I still have to check if something similar would work in PHP though.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 01/20/2004, 12:18 AM

And PHP variant is here:
global $TemplateFileName;  
$TemplateFileName = "index" . CCGetParam("template","") .".html";  

And an enhanced version that should work with any page and doesn't require hardcoding of the page name:
global $TemplateFileName;  
$TemplateFileName = explode(".",$TemplateFileName);  
$TemplateFileName = $TemplateFileName[0] . CCGetParam("template","") .".".$TemplateFileName[1];  

This code can be used in the After Initialize event of the page, just like in ASP.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Steve Kitchen
Posted: 01/20/2004, 12:43 AM

The multiple HTML template approach works well (in PHP anyway), but has a
fundamental problem - it doesn't take into consideration the error messages
that are embedded in the (PHP) code. These remain in the initially selected
language.

Now, I would suggest that error messages are important pieces of text, so
this approach won't work for a "full" translation.

It would certainly help those of us that have to supply multilingual sites
as a default (I guess that's most European users ...) if CCS had better
facilities for managing translations.

You might want to check out phpgroupware ( www.phpgroupware.org or
www.egroupware.org ) for one idea on how to achieve this. Giving the option
of using the database or a flat file to hold translation text would be an
additional benefit.

Regards,

Steve Kitchen, Technical Director

Burning Frog - I.T. Services To Set Your World On Fire
Email :s.kitchen@burningfrog.be Web: www.burningfrog.be



"peterr" <peterr@forum.codecharge> wrote in message
news:2400ce44d21722@news.codecharge.com...
> And PHP variant is here:
>
global $TemplateFileName;  
> $TemplateFileName = "index" . CCGetParam("template","") .".html";  
> 
>
> And an enhanced version that should work with any page and doesn't require
hardcoding of the page name:
>
global $TemplateFileName;  
> $TemplateFileName = explode(".",$TemplateFileName);  
> $TemplateFileName = $TemplateFileName[0] . CCGetParam("template","")  
..".".$TemplateFileName[1];  
> 
>
> This code can be used in the After Initialize event of the page, just like
in ASP.
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

hidran

Posts: 29
Posted: 01/27/2004, 5:49 AM

One way I use multilanguage is by having a table with label translation(Spanish,English,French,Italian and german) .I put all labels I want and in beforeshow event ther're changed according to the language the user chooses or is registered with.
View profile  Send private message
feha


Posts: 712
Posted: 01/27/2004, 7:17 AM

Quote :
One way I use multilanguage is by having a table with label translation(Spanish,English,French,Italian and german) .I put all labels I want and in beforeshow event ther're changed according to the language the user chooses or is registered with.
Yes it is on of the solutions.
But if you had autogenerated language file containing variables instead of text in labels ...
You could load htem in to globals and avoid writing 5-6 or more labels for each word ....

example
label
global $enter_your_name;
$enter_your_name = Enter YOUR NAME";

global $Tpl;
$Tpl->SetVar("enter_your_name",$enter_your_name );

So you won't need 5-6 labels ...


where globals could be loaded from DB or external include file ...
you could have unlimitet language files ...

What I suggest is simple thing for YesSoftware but could save lot of time....

When CCS genetrates a project or site it should automatically add labl sit with variables to en exra file which can be called language pack.

And generate with in the code
global $enter_your_name;

etc ...
and with in the template parser
global $Tpl;
$Tpl->SetVar("enter_your_name",$enter_your_name );

I hope You Get the idea ?
I say it is possilbe by custom coding ... at cost of time ...

Generated language file should look like:
<?php
//language pack globals
global $enter_your_name;
$enter_your_name="Enter Your Name";
global $enter_your_addres;
$enter_your_addres="Enter Your Address";
etc ...
?>

I have done this in my CGI applications 3-4 years ago ...

After you have one language pack variables then you could use it as a template and add extra ...

Similar what uses CCS now for application it self !

























_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
Guillermo
Posted: 09/08/2004, 12:49 PM

Quote peterr:
In ASP this should be as simple as specifying in Page "After Initialize" event::
TemplateFileName = "<TemplateName>.html"
(replace <TemplateName> with the real name)

Of course you can use it with sessions, for example by storing the language in a session variable and using such code:
TemplateFileName = "<TemplateName>_" & Session("language") & ".html"
===========
Hi!
I have done this and place it on every page:
if Session("language") = "en" or Session("language") = "" then  
'leave default language  
else  
Dim TempTemplate  
TempTemplate = Split(""& TemplateFileName &"",".")  
TemplateFileName = TempTemplate(0)  
TemplateFileName = Session("language") & "/" & TemplateFileName & ".html"  
end if
Where the html templates are placed in a sub-folder based on the languahe (ie. "es" folder for "Spanish" ) It works fine untill I place an include of header or footer (which also have that same code on it) on any of the pages. I get this error:
Quote :
Template engine error '800a041a'

Template engine: LoadTemplate failed. File E:\wwwroot\websites\multilang\es/es/testml.html not found.

/multilang/Template.asp, line 89
If I remove that code from the header and footer, it works fine. But the problem is that on the header and footer I have menus that I also need to translate. Any help about this? :-<

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.