473,385 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Localizable java script

Hajo,

I have app.js file where I store all my java script functions. I am
wondering how to localize it.
I can create second file like app_de.js and switch these two guys
manually but maybe there is other possibility that allows me preserve
one file?

thanks

Pawel Pabich

Feb 6 '06 #1
2 873
Hi,

Gawel wrote:
Hajo,

I have app.js file where I store all my java script functions. I am
wondering how to localize it.
I can create second file like app_de.js and switch these two guys
manually but maybe there is other possibility that allows me preserve
one file?

thanks

Pawel Pabich


The way I do it, I create and register (on the server) a script
containing client-side variables with the strings, which I fetched from
resource files.

Example:

String initializeStrings = "<script type=\"text/javascript\">"
+ "var TEXT_ALERT = \""
+ Utilities.CResourceFactory.GetString( typeof( BrowserPage ), "alert" )
+ "\";"
+ "</script>";
this.RegisterClientScriptBlock( "initializeScript", initializeStrings );

In reality it's a bit more sophisticated than that.

NB: The CResourceFactory is using a ResourceManager to get the actual
string.

I use the same technique to initialize all server-dependant client-side
variables, constants, etc...

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Feb 6 '06 #2
Yes, that's next possible solutin I'm wondering if there is something
built in asp.net that supports this case?

Feb 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kevin | last post by:
This problem has stumped me for almost two years now. In a nutshell... 1) I create a textbox class, and set the font to Tahoma 8 2) I drop the textbox class on a form, and set other properties...
0
by: Kristof | last post by:
I have created a framework with all our controls and forms we re-use in different projects. When we build the framework application we have a dll that we can reference in our project. When I...
3
by: Robin Tucker | last post by:
I did a little experiment during localization of my software (or at least preparations for localization) - without adding any language resources, I just went through changing the Localizable...
3
by: Michael Brown | last post by:
Hi there, After applying the "Localizable" attribute to my form using the (form) properties window in VS, I was expecting to see "" preceding my form's class in code (added automatically by the...
7
by: Ryan | last post by:
I'm creating a user control that has a handful of controls on it (19 in total). One of the controls on the UC is a textbox for a user's password, so I've set the PasswordChar property to "*". I...
2
by: Peter Vestergaard | last post by:
Hi I have a project with quite a number of dialogs in it all with Localizable=true, and all except one working fine. But the one is causing me trouble because even though Localizable=true is set,...
1
by: choupi | last post by:
Hi, When Localizable = True for my Form, the ImageList of my TreeView control doesn't show any image anymore (blank instead). The strange thing is that the problem doesn't appear in another...
0
by: Johnny Jörgensen | last post by:
I had a project where I happened to set Localizable = true for a form just to test it. But I decided agains making a multi language application, and set Localizable = false again. Now, whenever...
0
by: =?Utf-8?B?V2F5bmVN?= | last post by:
I just had a thought and wondered if I am missing something or it is a good suggestion. Looking at some code, I was sorting through strings that should be put into a resource file for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.