Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Internationalization (v4)
 Any ideas on inc_code stuff...
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Deleted
deleted

4116 Posts

Posted - 06 October 2002 :  01:36:16  Show Profile
As you know, inc_code.asp is converted to inc_code.js, and inc_code.asp is left in the code for compatibility. The reason was to make use of .JS file caching...

On the other hand, in v4, we need to use the dynamic way as the text inside must be rendered dynamically. Here are our options:


  • Revert back to ASP and do it as it is in v4b03.x, leave JS in english for compatibility

  • Use ASP to create a bunch of JS variables that are to be used in rendering time, also convert ASP file to continue compatibility concerns



Any ideas?
<

Stop the WAR!

Survivor
Starting Member

Russia
10 Posts

Posted - 07 October 2002 :  07:36:56  Show Profile
May be, just some Response.ContentType = "text/js" ?<
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 07 October 2002 :  08:11:06  Show Profile
You mean something like this: http://www.15seconds.com/issue/000811.htm ?

We have one more problem with caching... If the user switches the language will it be taken from the cache or re-generated?
<

Stop the WAR!
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 07 October 2002 :  08:34:44  Show Profile
Here's one way, similar to adding lots of JS variables to the main page, but slightly different.

On the main page, add a hidden form with lots of hidden input boxes containing all the prompt text.

e.g.

<form name="jsprompts" action="">
<input type="hidden" name="txtboldhelp"   value="Bold Tag Makes the enclosed text bold.\n\nUSE: [b ]This is some bold text[/b]"></input>
<input type="hidden" name="txtboldprompt" value="Text to be made BOLD."></input>
</form>


Then modify the code in the inc_code.js (and asp version).

e.g

function bold() {
	var text = getText();
	if (helpstat) {
		alert(document.jsprompts.txtboldhelp.value);
	} else if (basic) {
		AddTxt="[b ]" + text + "[/b]";
		AddText(AddTxt);
	} else {
		if (text) {
			txt=prompt(document.jsprompts.txtboldprompt.value,text);
		} else {
			txt=prompt(document.jsprompts.txtboldprompt.value,"Text");
		}
		if (txt!=null) {
			AddTxt="[b ]"+txt+"[/b]";
			AddText(AddTxt);
		}
	}
}


(NOTE: remove the space in all occurences of [b ])<
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 07 October 2002 :  17:54:06  Show Profile
quote:
Originally posted by bozden

Here are our options:


  • Revert back to ASP and do it as it is in v4b03.x, leave JS in english for compatibility

  • Use ASP to create a bunch of JS variables that are to be used in rendering time, also convert ASP file to continue compatibility concerns



Any ideas?



3rd option:


  • Have another lang file which just contains any text used in the js scripts and then include in the asp page: <script ... src="lang_nnn.js"></script>


<
Go to Top of Page

Survivor
Starting Member

Russia
10 Posts

Posted - 09 October 2002 :  01:57:41  Show Profile
No, there are will be problem with caching ...
It must be forced to reload js-file after changing language...<
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 09 October 2002 :  02:06:09  Show Profile
quote:
Originally posted by Survivor

No, there are will be problem with caching ...
It must be forced to reload js-file after changing language...


How to do this? Also taking any intermediate proxies into account...<

Stop the WAR!
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 09 October 2002 :  11:09:49  Show Profile  Send e3stone an AOL message
can't we just set it where no caching is available?
i.e. <meta http-equiv="pragma" content="no-cache"> ?<

<-- Eric -->
Go to Top of Page

Survivor
Starting Member

Russia
10 Posts

Posted - 09 October 2002 :  11:13:52  Show Profile
In one case, we need caching, but from second case - don't...
Hmm....<
Go to Top of Page

Survivor
Starting Member

Russia
10 Posts

Posted - 09 October 2002 :  11:17:46  Show Profile
May be, this caching can works only with one language on forum, without changing option...<
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 09 October 2002 :  13:38:51  Show Profile
The only other way (I can think of) of using caching & dynamic use in this case is to generate inc_codeNNNN.js files, but this is also out of question because then we need one more file to distribute in the language file.

Perhaps the easiest/best way is to generate the global JS variables in post.asp only... The JS file will be cached and it will be dynamic wrt the text it shows.
<

Stop the WAR!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07