Dave operates a sheet music library at his web site and wanted to implement 20/20 DataShed to manage that inventory. It'll work great! Dave also wants to invite other musicians to sign up and contribute information to the library. In this case, there are various ways that people can be involved:
Some members might be musicians who want to contribute information to the library -- for example, perhaps they'll want to tell the world about their favourite music.
Some members might be composers who want to contribute information about their own music.
Some members might be publishers who want to contribute information about their publications.
In short, Dave collaborates with a variety of people who each have different interests in the content at his web site and some of the text used in the login form (in "login.asp") was a little too stiff for Dave's web site or was irrelevant, so he wanted to spice it up, change a few sentences, and give the page his own flavour.
The Process
If you visit Dave's login page, you'll notice that the text in the login form is quite different than the default text provided in 20/20 DataShed's download. So, Dave's process is finished...but how did he do it?
Dave's goal was achieved by changing portions of the text found in the languages.xml file. That file contains "strings" (like words or sentences) which 20/20 DataShed uses to write labels, instructions, prompts, and other textual information to the pages.
Step 3: Change a "<string>", then Upload the Changes and Update the Server's Cache
Step 1: Getting Ready (Arranging the Windows)
Get ready...we'll help you customize your own login page. We'll use a few different tools through this process...and it's a good idea to keep the windows organized.
First, you can open your web browser and navigate to the "login.asp" page at your web site. For our example, we'll use:
Second, you can access your web site with an FTP application such as CuteFTP, FTP Explorer, or Windows "My Network Places" and locate the languages.xml file in 20/20 DataShed's xml_rss folder.
Third, you can double-click on "My Computer" and navigate to a folder on your hard drive where you want to store a local copy of the languages.xml file.
Last, you should open a text editor like the Windows "Notepad" -- you will use this tool to alter the text in the languages.xml file.
With these four windows open on your desktop, you're now ready to begin. We recommend that you "tile" or "cascade" the windows on your desktop or arrange them so you can see all of the windows simultaneously.
Drag (or somehow download) the languages.xml file from your FTP window to your local hard drive (the "Windows Explorer" window).
Then make a copy of that file on your local computer and name it "languages.ORIGINAL.xml". (This will be a backup copy that you can refer to.)
In your "Notepad" (or other text editor), select "File" and "Open...", then navigate to the languages.xml file on your computer that you have just downloaded. When "Notepad" opens that file, you will see something like this:
<?xml version="1.0" encoding="utf-8"?>
<languages>
<language>
<friendlyName>English (Australia)</friendlyName>
<culture>en-au</culture>
<strings context="public">
<string>[fieldUsername]:</string>
<string>[fieldPassword]:</string>
<string>Save my password on this computer.</string>
<string>Instructions:</string>
<string>If you already signed up on our site, enter your [fieldusername] and [fieldpassword] in the form on the left.</string>
<string>Please Note:</string>
<string>You do not need to log in to use our site.</string>
<string>Not Registered?</string>
<string>Please click here to sign up!</string>
<string>Forget Your [fieldPassword]?</string>
...(continued)...
Note that the example above includes the "English (Australia)" language. You can scroll through that file to locate the exact language node that you would like to edit first. For example, on Dave's site he was concerned primarily with the "English (Canada)" node, as follows:
...(continued)...
<string>Enter the [fieldUserDefinedDoubleNumber4] of this listing. You must enter a valid number such as '[ExampleDouble]'.</string>
<string>Show Options</string>
<string>Hide Options</string>
<string>Select a [user] here to assign this new item to their account.</string>
</strings>
</language> <language>
<friendlyName>English (Canada)</friendlyName>
<culture>en-au</culture>
<strings context="public">
<string>[fieldUsername]:</string>
<string>[fieldPassword]:</string>
<string>Save my password on this computer.</string>
<string>Instructions:</string>
<string>If you already signed up on our site, enter your [fieldusername] and [fieldpassword] in the form on the left.</string>
<string>Please Note:</string>
<string>You do not need to log in to use our site.</string>
<string>Not Registered?</string>
<string>Please click here to sign up!</string>
<string>Forget Your [fieldPassword]?</string>
...(continued)...
Step 3: Change a "<string>", then Upload the Changes and Update the Server's Cache
On Dave's web site and for this tutorial we are interested in the text that is used on the "login.asp" page. That text resides in the first twenty-three (23) <string> nodes. Through the remainder of this tutorial we will discuss changes to only those elements but these instructions apply to all the <string> nodes in the file.
The strings we will discuss are these:
<string>[fieldUsername]:</string>
<string>[fieldPassword]:</string>
<string>Save my password on this computer.</string>
<string>Instructions:</string>
<string>If you already signed up on our site, enter your [fieldusername] and [fieldpassword] in the form on the left.</string>
<string>Please Note:</string>
<string>You do not need to log in to use our site.</string>
<string>Not Registered?</string>
<string>Please click here to sign up!</string>
<string>Forget Your [fieldPassword]?</string>
<string>Please click here for a reminder.</string>
<string>Use this form to login to the administration area.</string>
<string>Click here to submit your [fieldusername] and [fieldpassword].</string>
<string>Enter a [fieldusername].</string>
<string>Enter a [fieldpassword].</string>
<string>Check this box if you would like this web page to remember your login information. Your [fieldusername] and [fieldpassword] will be remembered using a cookie that only this web site can read.</string>
<string>This login form is only for administrators and users of this web site.</string>
<string>New users should click here to set up a new account on this web site.</string>
<string>Click here if you forgot your [fieldpassword] and need to have it emailed to you.</string>
<string>You have successfully logged out.</string>
<string>Please sign in before proceeding.</string>
<string>Sorry, your account has not been authorized yet by the administration. You will receive an email message when your account is authorized.</string>
<string>Sorry, the [fieldusername] and/or [fieldpassword] you typed was incorrect. Please try again.</string>
Navigate to this line:
<string>Save my password on this computer.</string>
Change it to this:
<string>Remember me on this computer.</string>
Save the file.
Then drag (or somehow upload) this updated languages.xml file from your local hard drive (the "Windows Explorer" window) to your FTP window.
Then refresh or reload the "login.asp" file in your web browser with the following querystring:
That querystring will send a command to 20/20 DataShed which refreshes the server's memory and reloads the updated language strings.
Your new text should now appear on your "login.asp" page. If you see an error message, then read the section below called "What's the Worst That Can Happen?"
Step 4: Repeat Step #3 Until You're Finished. Read the section below for a complete discussion about each line that Dave altered.
Dave's Customizations - A Line-by-Line Discussion
<string>[fieldUsername]:</string>
Dave chose not to change this line. 20/20 DataShed will replace this token with an appropriate value...on Dave's web site it will be "Username".
If you are altering the text for multiple languages, then you might choose to change it like this:
French example:
<string>Nom d'Utilisateur:</string>
<string>[fieldPassword]:</string>
Dave chose not to change this line. 20/20 DataShed will replace this token with an appropriate value...on Dave's web site it will be "Password".
If you are altering the text for multiple languages, then you might choose to change it like this:
French example:
<string>Mot de Passe:</string>
<string>Save my password on this computer.</string>
Dave changed this line to:
French example:
<string>Remember me on this computer.</string>
<string>Instructions:</string>
Dave chose not to change this line.
<string>If you already signed up on our site, enter your [fieldusername] and [fieldpassword] in the form on the left.</string>
Dave changed this line to:
<string>If you are already a member of my site then enter your [fieldusername] and [fieldpassword] in the form on the left.</string>
<string>Please Note:</string>
Dave changed this line to:
<string>What's this?</string>
<string>You do not need to log in to use our site.</string>
Dave changed this line to:
<string>This is the page that members can use to login to their account. You do not need to log in to browse my site -- you only need to login to contribute new information or if you are involved as a "contributor" to my site.</string>
Note the use of the " entity. This HTML entity will produce a quotation mark (") and helps ensure compatibility with web page document types.
<string>Not Registered?</string>
Dave changed this line to:
<string>Not Registered?<![CDATA[<br /><br />]]>Are you a composer? A publisher? Or are you a musician and would like to tell me about your favourites? Please consider signing up and contributing to the library...it's free.<![CDATA[ <a href="contribute.asp">Click here to discover all the ways you can get involved.</a>]]></string>
Dave has altered the layout of the page a little (by changing the CSS file slightly) so that this text is given sufficient horizontal space to look like a proper paragraph.
Note the use of the <![CDATA[]]> sections. HTML markup must be contained in a <![CDATA[]]> section in any XML document -- otherwise, the < and > characters will cause syntax errors in the XML parser.
<string>Please click here to sign up!</string>
Dave changed this line to:
<string></string>
A-ha! Neat trick! 20/20 DataShed will ignore empty strings. By making this change, Dave has instructed 20/20 DataShed not to write this particular string to the page.
<string>Forget Your [fieldPassword]?</string>
Dave changed this line to:
<string>Did you Forget Your [fieldPassword]?</string>
<string>Please click here for a reminder.</string>
Dave changed this line to:
<string>Click here for a reminder.</string>
<string>Use this form to login to the administration area.</string>
Dave changed this line to:
<string>Use this form to login to the administration area and access your account information and options.</string>
<string>Click here to submit your [fieldusername] and [fieldpassword].</string>
Dave did not alter this line.
<string>Enter a [fieldusername].</string>
Dave did not alter this line.
<string>Enter a [fieldpassword].</string>
Dave did not alter this line.
<string>Check this box if you would like this web page to remember your login information. Your [fieldusername] and [fieldpassword] will be remembered using a cookie that only this web site can read.</string>
Dave did not alter this line.
<string>This login form is only for administrators and users of this web site.</string>
Dave changed this line to:
<string>This login form is only for administrators and [user_plural] of this web site.</string>
Note that the [user_plural] token will produce, in Dave's case, the word "contributors" because that's the value that he's defined in the 20/20 DataShed Options » "General Options" tab. Also, by writing this token is lowercase characters, 20/20 DataShed will write the word "Contributors" in lowercase also: as in "contributors".
<string>New users should click here to set up a new account on this web site.</string>
Dave changed this line to:
<string>New [user_plural] can click here to set up a new account on this web site.</string>
Note that the [user_plural] token will produce, in Dave's case, the word "contributors" because that's the value that he's defined in the 20/20 DataShed Options » "General Options" tab. Also, by writing this token is lowercase characters, 20/20 DataShed will write the word "Contributors" in lowercase also: as in "contributors".
<string>Click here if you forgot your [fieldpassword] and need to have it emailed to you.</string>
Dave did not alter this line.
<string>You have successfully logged out.</string>
Dave changed this line to:
<string>You have successfully logged out. I'll miss you.</string>
<string>Please sign in before proceeding.</string>
Dave did not alter this line.
<string>Sorry, your account has not been authorized yet by the administration. You will receive an email message when your account is authorized.</string>
Dave changed this line to:
<string>Sorry, I haven't authorized your account yet. You will receive an email message when your account is authorized.</string>
<string>Sorry, the [fieldusername] and/or [fieldpassword] you typed was incorrect. Please try again.</string>
Dave did not alter this line.
Instructions
The discussion above demonstrates in great detail how to alter the text in the languages.xml file, but here are some brief instructions that you should be familiar with:
Access your web site with an FTP application such as CuteFTP, FTP Explorer, or Windows "My Network Places".
Open languages.xml in a text editor such as Notepad. We recommend that you do not use a WYSIWYG editor like Frontpage or Dreamweaver for this purpose. Also note that we do not recommend that you open this file in an XML editor (like Altova XML Spy or Visual Studio).
Locate the text, sentence, word, or paragraph that you would like to alter (perhaps use the "Find..." tool in Notepad.
Change the text, sentence, word, or paragraph as necessary.
Save the file.
Upload the file to your web site using the FTP application and overwrite the existing languages.xml file.
The process is now complete. The new languages.xml file will be loaded the next time the web servers cache (Application Cache) is refreshed. You can refresh the application cache manually so that your changes are implemented immediately: visit the objApplication=RemoveAll section in _globals.asp.
Note: At this point, if you have created a syntax error in the XML file, you will see an error message on any/every page produced by 20/20 DataShed. Fix the error, or undo your changes, or upload the original (working) copy immediately -- then refresh the application cache again.
Notes
One Language? Or Multiple Languages?
Dave's web site is published in English only so this article demonstrates how the text is changed for one language. However, if your web site is published in more than one language, then you should customize the appropriate <string> tags in each of the <language> nodes.
What's the Worst That Can Happen?
Here are some examples of the common errors that you might experience:
Error: -1072896764 Line: ### Reason: A name was started with an invalid character.
This can happen if you have used the < or > characters without encasing them properly in a <!CDATA[ ]]> section. There might be other causes but it always indicates that the XML parser on the web server encountered a character that it didn't expect or doesn't understand.
Error: -1072896755 Line: ### Reason: A semi colon character was expected.
This can happen if you have used the & character instead of the proper entity: &. For example, you can never write the following in an XML document: " Cars & Trucks". It must be written like: "Cars & Trucks". (Don't worry...the entity will be translated into an ampersand in the web browser later!)
Error: -1072896659 Line: ### Reason: End tag 'strings' does not match the start tag 'string'.
OR
Error: -1072896659 Line: ### Reason: End tag 'SOMETHING' does not match the start tag 'SOMETHING'.
This always indicates that a tag is misplaced or missing. You must ensure that all XML element tags are properly opened and closed.
Well, the best advice we can give you is to prevent the error in the first place:
Go slow!
Do not make broad changes to a file and then upload it.
Intead, make ONE change...then test it.
Make a second change...then test it.
This way, if you encounter an error you will have a better understanding of where or how the error occurs or you'll be able to easily upload the previous copy and undo the changes.