jQuery.i18n.properties is a lightweight jQuery Biaxin for strep, plugin for providing internationalization to javascript from '.properties' files, just like in Java Resource Bundles. It loads and parses resource bundles (.properties) based on provided language and country codes (ISO-639 and ISO-3166) or language reported by browser.
Resource bundles are '.properties' files containing locale specific key-value pairs. The use of '.properties' files for translation is specially useful when sharing i18n files between Java and JavaScript projects, biaxin xl pak directions. This plugin loads the default file (eg, Biaxin xl 500mg, Messages.properties) first and then locale specific files (Messages_pt.properties, then Messages_pt_PT.properties), so that a default value is always available when there is no translation provided, biaxin for strep throat. Translation keys will be available to developer as javascript variables/functions (functions, Biaxin for strep, if translated value contains substitutions (eg, {0}) or as a map.
This plugin was inspired on the Localisation assistance for jQuery from Keith Wood, and is made available under a dual license (GPL and MIT).
Take as an example the following Messages.properties, biaxin for sale, Messages_pt.properties and Messages_pt_PT.properties:
# This line is ignored by the plugin
msg_hello = Hello
msg_world = World
msg_complex = Good morning {0}.
# We only provide a translation for the 'msg_hello' key
msg_hello = Bom dia
# We only provide a translation for the 'msg_hello' key
msg_hello = Olá
// This will initialize the plugin
// and show two dialog boxes: one with the text "Olá World"
// and other with the text "Good morning John!"
jQuery.i18n.properties({
name:'Messages',
path:'bundle/',
mode:'both', prescription for ear infection,
language:'pt_PT', Medication for ear infection, callback: function() {
// We specified mode: 'both' so translated values will be
// available as JS vars/functions and as a map
// Accessing a simple value through the map
jQuery.i18n.prop('msg_hello');
// Accessing a value with placeholders through the map
jQuery.i18n.prop('msg_complex', ['John']);
// Accessing a simple value through a JS variable
alert(msg_hello +' '+ msg_world);
// Accessing a value with placeholders through a JS function
alert(msg_complex('John'));
}
});
This will initialize the plugin (loading bundle files and parsing them) and show a dialog box with the text "Olá World" and other with "Good morning John!". The english word "World" is shown because we didn't provide a translation for the msg_world key, biaxin for strep. Also notice that keys are available as a map and also as javascript variables (for simple strings) and javascript functions (for strings with placeholders for substitution).
| Option | Description | Notes |
|---|---|---|
| name | Partial name (or names) of files representing resource bundles (eg, Prescription for ear infection, 'Messages' or ['Msg1','Msg2']) | Required String or String[] |
| language | ISO-639 Language code and, optionally, buy biaxin online, ISO-3166 country code (eg, Order biaxin, 'en', 'en_US', 'pt_PT'), biaxin for ear infections. If not specified, language reported by the browser will be used instead. | Optional String |
| path | Path to directory that contains '.properties' files to load. | Optional String |
| mode | Option to have resource bundle keys available as Javascript vars/functions OR as a map. The 'map' option is mandatory if your bundle keys contain Javascript Reserved Words Biaxin for strep, . Possible options: 'vars' (default), 'map' or 'both' | Optional String |
| callback | Callback function to be called uppon script execution completion. | Optional function() |
src="js/jquery.i18n.properties-min.js">
jQuery.i18n.properties({
name: 'Messages',
callback: function(){ alert( org.somekey ); }
});
ola
# on .properties file:
test123 = qwerty
Similar posts: Biaxin xl 500mg. Medication for ear infection. Biaxin xl pak. Order biaxin. Biaxin xl 500 mg. Buy biaxin online.
Trackbacks from: Biaxin for strep. Biaxin for strep. Biaxin for strep. Biaxin for strep. Biaxin for strep. Biaxin for strep.