By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,313 Members | 2,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,313 IT Pros & Developers. It's quick & easy.

Help on ASP

P: n/a
Hello All

We are making an application for translating the literals
(HTML text and labels) of an existing ASP website from
English to another language, say Swedish.

Now, for this we are employing XML document to store the
literals and their translations. The literals are passed
as string parameters to a translation routine that picks
up the translated value from the XML. The XML has a ID-
VALUE structure i.e. the translating routine would match a
particular literal against the ID in the XML document and
pick up the translated equivalent from VALUE part of the
node.

We have built a tool that mines out the literals from the
ASP Page and stores them in the XML document. The tool
identifies the statement after each HTML ending tag (">")
as literals and picks them up and puts them in the XML
document.

Once the XML document is created, the translator would put
the equivalent translated literal in the value part of the
node, which the ASP page would pick up to display.

Here, the problem that we are facing is that if a sentence
contains a function call or a variable, then, the sentence
gets split up in to fragments and these fragments are
stored as individual nodes in the XML document. Thus it
would not be possible to translate it in the said language
as the whole sentence is now fragmented. Further, after
translation the position of the ASP variable or Function
call might change. For instance, the verb may come before
the noun or the noun before the verb.

How do we treat the function call or variable such that it
can handle the change in position issue and also be easy
for the translator to do his job? The solution has to be
built using ASP, VB and XML.

Below is an example to make my point:

ASP Page

<tr>
<td align="left" class="RegularText" colspan="2">
This screen should be used to set up new <%
=SITENAME%> users only. Make sure you enter the user's
correct E-Mail
address. When you submit the page, a
system-assigned password will be automatically e-mailed to
the user.
</td>
</tr>

In the code above, there is a variable SITENAME embedded
in the sentence (that is causing all the problems). Now
during translation, if we leave out the variable and just
pick up the literals to the left and right of it.

The XML nodes are as below:

<KEY ID="This screen should be used to set up new"
VALUE="This screen should be used to set up new"/>
<KEY ID="users only. Make sure you enter the user's
correct E-Mail address. When you submit the page, a system-
assigned password will be automatically e-mailed to the
user." VALUE="users only. Make sure you enter the user's
correct E-Mail address. When you submit the page, a system-
assigned password will be automatically e-mailed to the
user."/>

The complete sentence gets split up in two parts. Thus it
would not be possible to translate it in the said language
because after translation the position of the ASP variable
might change. For instance, the verb may come before the
noun or the noun before the verb.

We cannot take the VBScript variable as a part of the
string parameter and pass it to the translation routine,
as then the variable would be treated as part of the
string and would not get the value at runtime.

Any help/ideas to tackle the above stated problem will be
greatly appreciated.

Thanks & Regards

- Anuj
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.