Jump to content

Difference between Globalization and Localization

Featured Replies

What is the difference between globalization and localization. Any one give some sample code.

 

Thanks in Advance

What is the difference between globalization and localization. Any one give some sample code.

 

Thanks in Advance

 

Globalization and localization generally refers to where a variable is declared, as well as from where it can be accessed. A global variable can be accessed from anywhere within a class, or in some languages, from outside the class (requiring the class be pre-loaded). A local variable exists only within a class or function or whatever, and depending on the language, can even share its name with other local variables in other parts of the program. The concept can also apply to functions and subroutines as well.

CLASS Example
	PUBLIC x AS INTEGER = 20 'Global variable
	SUB CountByN()
     	DIM n AS INTEGER = 7 'Local variable
     	x = x + n
	END SUB
	WHILE x < 100
     	TextBox1.text = TextBox1.text & x
     	CountByN()
	END WHILE
	TextBox1.text = TextBox1.text & n 'CRASH!! Because 'n' is not declared at this scope
END CLASS

 

This example is in ad-lib VisualBasic...I doubt it'd really work, because I don't think I can put a while loop outside of a function or subroutine, but it should give the idea...

Globalization is the use of shared data among several units at some level .. while Localization means using private data locally,

 

C++

int X = 1 ; // global

void function ()
{
    int X = 2 ; // local

    ::X = X ; // export data to global variable
}

void f2 ()
{
    printf("%d", X); // this will print ' 2 '
}

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.