Search Results

Search found 243 results on 10 pages for 'globalization'.

Page 1/10 | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • jQuery Globalization Plugin from Microsoft

    - by ScottGu
    Last month I blogged about how Microsoft is starting to make code contributions to jQuery, and about some of the first code contributions we were working on: jQuery Templates and Data Linking support. Today, we released a prototype of a new jQuery Globalization Plugin that enables you to add globalization support to your JavaScript applications. This plugin includes globalization information for over 350 cultures ranging from Scottish Gaelic, Frisian, Hungarian, Japanese, to Canadian English.  We will be releasing this plugin to the community as open-source. You can download our prototype for the jQuery Globalization plugin from our Github repository: http://github.com/nje/jquery-glob You can also download a set of samples that demonstrate some simple use-cases with it here. Understanding Globalization The jQuery Globalization plugin enables you to easily parse and format numbers, currencies, and dates for different cultures in JavaScript. For example, you can use the Globalization plugin to display the proper currency symbol for a culture: You also can use the Globalization plugin to format dates so that the day and month appear in the right order and the day and month names are correctly translated: Notice above how the Arabic year is displayed as 1431. This is because the year has been converted to use the Arabic calendar. Some cultural differences, such as different currency or different month names, are obvious. Other cultural differences are surprising and subtle. For example, in some cultures, the grouping of numbers is done unevenly. In the "te-IN" culture (Telugu in India), groups have 3 digits and then 2 digits. The number 1000000 (one million) is written as "10,00,000". Some cultures do not group numbers at all. All of these subtle cultural differences are handled by the jQuery Globalization plugin automatically. Getting dates right can be especially tricky. Different cultures have different calendars such as the Gregorian and UmAlQura calendars. A single culture can even have multiple calendars. For example, the Japanese culture uses both the Gregorian calendar and a Japanese calendar that has eras named after Japanese emperors. The Globalization Plugin includes methods for converting dates between all of these different calendars. Using Language Tags The jQuery Globalization plugin uses the language tags defined in the RFC 4646 and RFC 5646 standards to identity cultures (see http://tools.ietf.org/html/rfc5646). A language tag is composed out of one or more subtags separated by hyphens. For example: Language Tag Language Name (in English) en-AU English (Australia) en-BZ English (Belize) en-CA English (Canada) Id Indonesian zh-CHS Chinese (Simplified) Legacy Zu isiZulu Notice that a single language, such as English, can have several language tags. Speakers of English in Canada format numbers, currencies, and dates using different conventions than speakers of English in Australia or the United States. You can find the language tag for a particular culture by using the Language Subtag Lookup tool located here:  http://rishida.net/utils/subtags/ The jQuery Globalization plugin download includes a folder named globinfo that contains the information for each of the 350 cultures. Actually, this folder contains more than 700 files because the folder includes both minified and un-minified versions of each file. For example, the globinfo folder includes JavaScript files named jQuery.glob.en-AU.js for English Australia, jQuery.glob.id.js for Indonesia, and jQuery.glob.zh-CHS for Chinese (Simplified) Legacy. Example: Setting a Particular Culture Imagine that you have been asked to create a German website and want to format all of the dates, currencies, and numbers using German formatting conventions correctly in JavaScript on the client. The HTML for the page might look like this: Notice the span tags above. They mark the areas of the page that we want to format with the Globalization plugin. We want to format the product price, the date the product is available, and the units of the product in stock. To use the jQuery Globalization plugin, we’ll add three JavaScript files to the page: the jQuery library, the jQuery Globalization plugin, and the culture information for a particular language: In this case, I’ve statically added the jQuery.glob.de-DE.js JavaScript file that contains the culture information for German. The language tag “de-DE” is used for German as spoken in Germany. Now that I have all of the necessary scripts, I can use the Globalization plugin to format the product price, date available, and units in stock values using the following client-side JavaScript: The jQuery Globalization plugin extends the jQuery library with new methods - including new methods named preferCulture() and format(). The preferCulture() method enables you to set the default culture used by the jQuery Globalization plugin methods. Notice that the preferCulture() method accepts a language tag. The method will find the closest culture that matches the language tag. The $.format() method is used to actually format the currencies, dates, and numbers. The second parameter passed to the $.format() method is a format specifier. For example, passing “c” causes the value to be formatted as a currency. The ReadMe file at github details the meaning of all of the various format specifiers: http://github.com/nje/jquery-glob When we open the page in a browser, everything is formatted correctly according to German language conventions. A euro symbol is used for the currency symbol. The date is formatted using German day and month names. Finally, a period instead of a comma is used a number separator: You can see a running example of the above approach with the 3_GermanSite.htm file in this samples download. Example: Enabling a User to Dynamically Select a Culture In the previous example we explicitly said that we wanted to globalize in German (by referencing the jQuery.glob.de-DE.js file). Let’s now look at the first of a few examples that demonstrate how to dynamically set the globalization culture to use. Imagine that you want to display a dropdown list of all of the 350 cultures in a page. When someone selects a culture from the dropdown list, you want all of the dates in the page to be formatted using the selected culture. Here’s the HTML for the page: Notice that all of the dates are contained in a <span> tag with a data-date attribute (data-* attributes are a new feature of HTML 5 that conveniently also still work with older browsers). We’ll format the date represented by the data-date attribute when a user selects a culture from the dropdown list. In order to display dates for any possible culture, we’ll include the jQuery.glob.all.js file like this: The jQuery Globalization plugin includes a JavaScript file named jQuery.glob.all.js. This file contains globalization information for all of the more than 350 cultures supported by the Globalization plugin.  At 367KB minified, this file is not small. Because of the size of this file, unless you really need to use all of these cultures at the same time, we recommend that you add the individual JavaScript files for particular cultures that you intend to support instead of the combined jQuery.glob.all.js to a page. In the next sample I’ll show how to dynamically load just the language files you need. Next, we’ll populate the dropdown list with all of the available cultures. We can use the $.cultures property to get all of the loaded cultures: Finally, we’ll write jQuery code that grabs every span element with a data-date attribute and format the date: The jQuery Globalization plugin’s parseDate() method is used to convert a string representation of a date into a JavaScript date. The plugin’s format() method is used to format the date. The “D” format specifier causes the date to be formatted using the long date format. And now the content will be globalized correctly regardless of which of the 350 languages a user visiting the page selects.  You can see a running example of the above approach with the 4_SelectCulture.htm file in this samples download. Example: Loading Globalization Files Dynamically As mentioned in the previous section, you should avoid adding the jQuery.glob.all.js file to a page whenever possible because the file is so large. A better alternative is to load the globalization information that you need dynamically. For example, imagine that you have created a dropdown list that displays a list of languages: The following jQuery code executes whenever a user selects a new language from the dropdown list. The code checks whether the globalization file associated with the selected language has already been loaded. If the globalization file has not been loaded then the globalization file is loaded dynamically by taking advantage of the jQuery $.getScript() method. The globalizePage() method is called after the requested globalization file has been loaded, and contains the client-side code to perform the globalization. The advantage of this approach is that it enables you to avoid loading the entire jQuery.glob.all.js file. Instead you only need to load the files that you need and you don’t need to load the files more than once. The 5_Dynamic.htm file in this samples download demonstrates how to implement this approach. Example: Setting the User Preferred Language Automatically Many websites detect a user’s preferred language from their browser settings and automatically use it when globalizing content. A user can set a preferred language for their browser. Then, whenever the user requests a page, this language preference is included in the request in the Accept-Language header. When using Microsoft Internet Explorer, you can set your preferred language by following these steps: Select the menu option Tools, Internet Options. Select the General tab. Click the Languages button in the Appearance section. Click the Add button to add a new language to the list of languages. Move your preferred language to the top of the list. Notice that you can list multiple languages in the Language Preference dialog. All of these languages are sent in the order that you listed them in the Accept-Language header: Accept-Language: fr-FR,id-ID;q=0.7,en-US;q=0.3 Strangely, you cannot retrieve the value of the Accept-Language header from client JavaScript. Microsoft Internet Explorer and Mozilla Firefox support a bevy of language related properties exposed by the window.navigator object, such as windows.navigator.browserLanguage and window.navigator.language, but these properties represent either the language set for the operating system or the language edition of the browser. These properties don’t enable you to retrieve the language that the user set as his or her preferred language. The only reliable way to get a user’s preferred language (the value of the Accept-Language header) is to write server code. For example, the following ASP.NET page takes advantage of the server Request.UserLanguages property to assign the user’s preferred language to a client JavaScript variable named acceptLanguage (which then allows you to access the value using client-side JavaScript): In order for this code to work, the culture information associated with the value of acceptLanguage must be included in the page. For example, if someone’s preferred culture is fr-FR (French in France) then you need to include either the jQuery.glob.fr-FR.js or the jQuery.glob.all.js JavaScript file in the page or the culture information won’t be available.  The “6_AcceptLanguages.aspx” sample in this samples download demonstrates how to implement this approach. If the culture information for the user’s preferred language is not included in the page then the $.preferCulture() method will fall back to using the neutral culture (for example, using jQuery.glob.fr.js instead of jQuery.glob.fr-FR.js). If the neutral culture information is not available then the $.preferCulture() method falls back to the default culture (English). Example: Using the Globalization Plugin with the jQuery UI DatePicker One of the goals of the Globalization plugin is to make it easier to build jQuery widgets that can be used with different cultures. We wanted to make sure that the jQuery Globalization plugin could work with existing jQuery UI plugins such as the DatePicker plugin. To that end, we created a patched version of the DatePicker plugin that can take advantage of the Globalization plugin when rendering a calendar. For example, the following figure illustrates what happens when you add the jQuery Globalization and the patched jQuery UI DatePicker plugin to a page and select Indonesian as the preferred culture: Notice that the headers for the days of the week are displayed using Indonesian day name abbreviations. Furthermore, the month names are displayed in Indonesian. You can download the patched version of the jQuery UI DatePicker from our github website. Or you can use the version included in this samples download and used by the 7_DatePicker.htm sample file. Summary I’m excited about our continuing participation in the jQuery community. This Globalization plugin is the third jQuery plugin that we’ve released. We’ve really appreciated all of the great feedback and design suggestions on the jQuery templating and data-linking prototypes that we released earlier this year.  We also want to thank the jQuery and jQuery UI teams for working with us to create these plugins. Hope this helps, Scott P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. You can follow me at: twitter.com/scottgu

    Read the article

  • Globalization, Localization And Why My Application Stopped Launching

    - by Paulo Morgado
    When I was localizing a Windows Phone application I was developing, I set the argument on the constructor of the AssemblyCultureAttribute for the neutral culture (en-US in this particular case) for my application. As it was late at night (or early in the dawn ) I went to sleep and, on the next day, the application wasn’t launching although it compiled just fine. I’ll have to confess that it took me a couple of nights to figure out what I had done to my application. Have you figured out what I did wrong? The documentation for the AssemblyCultureAttribute states that: The attribute is used by compilers to distinguish between a main assembly and a satellite assembly. A main assembly contains code and the neutral culture's resources. A satellite assembly contains only resources for a particular culture, as in [assembly:AssemblyCultureAttribute("de")]. Putting this attribute on an assembly and using something other than the empty string ("") for the culture name will make this assembly look like a satellite assembly, rather than a main assembly that contains executable code. Labeling a traditional code library with this attribute will break it, because no other code will be able to find the library's entry points at runtime. So, what I did was marking the once main assembly as a satellite assembly for the en-US culture which made it impossible to find its entry point. To set the the neutral culture for the assembly resources I should haveused (and eventually did) the NeutralResourcesLanguageAttribute. According to its documentation: The NeutralResourcesLanguageAttribute attribute informs the ResourceManager of the application's default culture, and also informs the ResourceManager that the default culture's resources are found in the main application assembly. When looking up resources in the same culture as the default culture, the ResourceManager automatically uses the resources located in the main assembly instead of searching for a satellite assembly. This improves lookup performance for the first resource you load, and can reduce your working set.

    Read the article

  • jQuery Globalization Plugin from Microsoft

    Last month I blogged about how Microsoft is starting to make code contributions to jQuery, and about some of the first code contributions we were working on: jQuery Templates and Data Linking support. Today, we released a prototype of a new jQuery Globalization Plugin that enables you to add globalization support to your JavaScript applications. This plugin includes globalization information for over 350 cultures ranging from Scottish Gaelic, Frisian, Hungarian, Japanese, to Canadian English. ...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Globalization for GetSystemTimeZones()

    - by user300992
    I want to get a list of timezones, so that i can populate the dropdown list. In .NET 3.5, we have TimeZoneInfo namespace, here is the code: ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones(); foreach (TimeZoneInfo timeZone in timeZones) string name = timeZone.DisplayName However, "DisplayName" is in English. How can I pass the cultureInfo so that it can return other languages? I tried setting the Thread.CurrentCulture and CurrentUICulture, it didn't work. Am I missing something?

    Read the article

  • .net Globalization and ResourceManager

    - by Andrew Bullock
    I've got a console app and i need to globalize some of the hardcoded message strings. I've got two assemblies: MyProgram.Console (Console app) MyProgram.Core (class lib) In MyProgram.Core I've made a Language.en-GB.resx and set it as an Embedded Resource. In the resource I've created a key/value pair: "SomeKey" : "SomeValue" When I build my application I get: bin/MyProgram.Console.exe bin/MyProgram.Core.dll bin/en-BG/MyProgram.Core.resources.dll How do I address these resource key/values? Currently I'm trying this from a class within MyProgram.Core: var mgr = new ResourceManager(GetType().Assembly.GetName().Name, Assembly.GetExecutingAssembly()); mgr.GetString("SomeKey", new Culture("en-GB")); But I keep getting: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "MyProgram.Core.resources" was correctly embedded or linked into assembly "MyProgram.Core" at compile time, or that all the satellite assemblies required are loadable and fully signed. What am I doing wrong? I've tried every combination I can think of for the baseName argument to the ResourceManagers ctor. Thanks

    Read the article

  • AJAX Control Toolkit - Globalization (Language)

    - by Guilherme Cardoso
    For those who use AjaxToolKit controls presenting a language-dependent data (the CalendarExternder with the names of the months and weeks, for example) you can change the language to be presented in a simple way. In Web.Config let's define the primary culture as follows: < system . web > <System. Web> < globalization uiCulture = "pt-pt" culture = "pt-pt" /> <Globalization UICulture = "en-us" culture = "en-us" /> ... ...  In this example I'm using Portuguese. To finish it is necessary to change our ScriptManager. Be it the ToolScriptManager AjaxToolKit or belonging to the ScriptManager's framework. NET, the properties as a vibrant and true are the EnableScriptGlobalization EnableScriptLocalization. < cc1 : ToolkitScriptManager ID = "ToolkitScriptManager1" runat = "server" EnableScriptGlobalization = "true" EnableScriptLocalization = "true" > <Cc1: ToolkitScriptManager ID = "ToolkitScriptManager1" runat = "server" EnableScriptGlobalization = "true" EnableScriptLocalization = "true"> </ cc1 : ToolkitScriptManager > </ Cc1: ToolkitScriptManager> or < asp : ScriptManager ID = "ScriptManager1" runat = "server" EnableScriptGlobalization = "true" EnableScriptLocalization = "true" > <Asp: ScriptManager ID = "ScriptManager1" runat = "server" EnableScriptGlobalization = "true" EnableScriptLocalization = "true"> </ asp : ScriptManager > </ Asp: ScriptManager>   Like hus we use the controls on AjaxToolKit, always using the Portuguese language. It is important that AjaxTookKit is updated to avoid shortages or errors in translation, though I have not updated by this error in the ModalPopup the latest version, and any controls that I have used are translated correctly.

    Read the article

  • OUAB Europe Globalization Topics

    - by ultan o'broin
    Pleased to announce that the Oracle Usability Advisory Board has added a globalization workgroup for 2011. This will be headed up my myself. The aims of this workgroup are: To understand how our customers use translated versions of applications To identify key international support, translation and localization-related usability issues in deployed applications To make recommendations to Oracle usability and development teams about meeting global customer usability requirements in current and future versions of our applications. Issues include: How international users use applications when working, ethnography opportunities, key cultural impacts on usability; multilingual feature usage, localization of forms and reports, language quality, extensibility, translation of user assistance, user-generated and rich-media content like UPK, and international mobile application opportunities. More details will be available on the usableapps.oracle.com website shortly.

    Read the article

  • Setting a date format in ASP.NET web.config globalization tag?

    - by Jens Ameskamp
    In our web.config I am using the following tag to determine the interface language of an ASP.NET website. <globalization enableClientBasedCulture="true" culture="auto:en-GB" uiCulture="auto:en"/> This works as expected: Client wo request a specific localisation get it, everybody else is happily looking at the en-GB settings. Due to company policy I need to change the date format to the ISO 8601 standard format (YYYY-MM-DD) for everybody. Is this possible at a central place in the web.config or do I need to change this manually in every instance? Addition: Would it be possible to do get this date format when restricting the interface to english? Thanks! =)

    Read the article

  • When should I implement globalization and localization in C#?

    - by Geo Ego
    I am cleaning up some code in a C# app that I wrote and really trying to focus on best practices and coding style. As such, I am running my assembly through FXCop and trying to research each message it gives me to decide what should and shouldn't be changed. What I am currently focusing on are locale settings. For instance, the two errors that I have currently are that I should be specifying the IFormatProvider parameter for Convert.ToString(int), and setting the Dataset and Datatable locale. This is something that I've never done, and never put much thought into. I've always just left that overload out. The current app that I am working on is an internal app for a small company that will very likely never need to run in another country. As such, it is my opinion that I do not need to set these at all. On the other hand, doing so would not be such a big deal, but it seems like it is unneccessary and could hinder readability to a degree. I understand that Microsoft's contention is to use it if it's there, period. Well, I'm technically supposed to call Dispose() on every object that implements IDisposable, but I don't bother doing that with Datasets and Datatables, so I wonder what the practice is "in the wild."

    Read the article

  • Google Translation API Integration in .NET

    - by Jalpesh P. Vadgama
    This blog has been quite for some time because i was very busy at professional font but now I have decided to post on this blog too. I am constantly posting my article on my personal blog at http://jalpesh.blogspot.com. But now this blog will also have same blog post so i can reach to more community. Language localization is one of important thing of site of application nowadays. If you want your site or application more popular then other then it should support more then language. Some time it becomes difficult to translate all the sites into other languages so for i have found a great solution. Now you can use Google Translation API to translate your site or application dynamically. Here are steps you required to follow to integrate Google Translation API into Microsoft.NET Applications. First you need download class library dlls from the following site. http://code.google.com/p/google-language-api-for-dotnet/ Go this site and download GoogleTranslateAPI_0.1.zip. Then once you have done that you need to add reference GoogleTranslateAPI.dll like following. Now you are ready to use the translation API from Google. Here is the code for that. string Text = "This is a string to translate"; Console.WriteLine("Before Translation:{0}", Text); Text=Google.API.Translate.Translator.Translate(Text,Google.API.Translate.Language.English,Google.API.Translate.Language.French); Console.WriteLine("Before Translation:{0}", Text); That’s it it will return the string translated from English to French. But make you are connected to internet :)… Happy Programming Technorati Tags: GoogleAPI,Translate

    Read the article

  • Oracle Applications Global User Experience

    - by ultan o'broin
    Today, we're launching Oracle's first ever blog for global user experience (UX) applications issues. We'll be talking about how we design and develop applications for global use, looking at the cultural factors, internationalization (I18n), localization (L10n) and language used for a start. We will also discuss how we study and work with real users so that our customers have applications that allow them to be productive regardless of where they are located in the world. In addition, we will inform you about any globally-related events we know about, and about product features, development frameworks, tools, information and relevant to our worldwide customers. Also, of course, we hope to hear from you, too. If you have anything you want to know about our global user experience, a localization you'd like, or cultural feature you think would be useful, then let us know. If you have any tips or guidelines you'd like to share in this space, then this blog is for you too! As far as global user experience is concerned, you don't have to be lost in translation. Hence the name of the blog!

    Read the article

  • C++ Win32 API equivalent of CultureInfo.TwoLetterISOLanguageName

    - by Brian Gillespie
    The .NET framework makes it easy to get information about various locales; the Win32 C++ APIs are a bit harder to figure out. Is there an equivalent function in Win32 to get the two-letter ISO language name given an integer locale ID? In C# I'd do: System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(1034); string iso = ci.TwoLetterISOLanguageName; // iso == "es" now.

    Read the article

  • Is is possible to programmatically change the resourceProviderFactoryType?

    - by Robert Massa
    I have a custom implementation of IResourceProvider and ResourceProviderFactory. Now the default way of making sure ASP.NET uses these custom types is to use the web.config and specify the factory like so: <globalization resourceProviderFactoryType="Product.Globalization.TranslationResourceProviderFactory" /> This works perfectly, except that in my resource provider I need database access. I want to use my IoC-container(Ninject) to inject the repositories needed to access this data into the CustomResourceProvider. But how am I going to do this? I have no control over the instantiation of the factory, so the factory can't get a reference to my IoC. Is there any way to register a custom provider programmatically, in for example the Global.asax?

    Read the article

  • Oracle Database character set issue with the audit tables on Debian

    - by Leonid Shirmanov
    I've got Oracle XE installed on Debian linux and the character set is configured to AL32UTF8. There are several client applications that connects to a database from Windows with the different locales - French etc, not English. That's ok with all the client data these applications put into database, nothing converted and text data in French represents correctly. But texts in audit tables looks like '??????' if contains any not-english character. I suppose this is because audit records go to database in the different locale and it's not dependent on the client's globalization/locale settings. How this globalization issue can be fixed? thanks!

    Read the article

1 2 3 4 5 6 7 8 9 10  | Next Page >