Skip to content

Commit c7f951f

Browse files
committed
Added Contributing section to README; minor cleanup
1 parent de95f88 commit c7f951f

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

README.markdown

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,42 @@
1-
jquery.localize.js - a jQuery plugin that makes it easy to i18n your static web site.
2-
===================================================================
1+
# jquery.localize.js - a jQuery plugin that makes it easy to i18n your static web site.
32

4-
Synopsis
5-
--------
3+
## Synopsis
64

75
* Lazily loads JSON translation files based on a simple naming convention.
86
* By default, applies the translations to your document based on simple attribute convention.
97
* Recently updated for jQuery 1.5 (tests use jQuery 1.5.2)
108

11-
Basic Usage
12-
-----------
9+
## Basic Usage
1310

14-
Step 0. Load the jquery-localize plugin on your page.
15-
-----------------------------------------------------
11+
## Step 0. Load the jquery-localize plugin on your page.
1612

1713
It's the file located at `build/jquery.localize.js`
1814

19-
Step 1. Use the "rel" attribute on tags whose content you want to be translated
20-
-------------------------------------------------------------------------------
15+
## Step 1. Use the "rel" attribute on tags whose content you want to be translated
2116

2217
Somewhere in your html:
2318

2419
<h1 rel="localize[greeting]"> Hello! </h1>
2520

26-
Step 2. Provide a JSON language file that has translations:
27-
-----------------------------------------------------------
21+
## Step 2. Provide a JSON language file that has translations:
2822

2923
example-fr.json:
3024

3125
{
3226
greeting: "Bonjour!"
3327
}
3428

35-
Step 3. Use the localize plugin.
36-
-------------------------------------
29+
## Step 3. Use the localize plugin.
3730

3831
// In a browser where the language is set to French
3932
$("rel*=localize").localize("example")
4033

4134
// You can also override the language detection, and pass in a language code
4235
$("rel*=localize").localize("example", { language: "fr" })
4336

44-
Gory Details
45-
============
37+
# Gory Details
4638

47-
Language file loading
48-
---------------------
39+
## Language file loading
4940

5041
The first argument of the localize method is the name of the language pack. You might have a different language pack for different parts of your website.
5142

@@ -71,8 +62,8 @@ if the language of the browser also had a country code, like "fr-FR", then the p
7162

7263
This let's you define partial language refinements for different regions. For instance, you can have the base language translation file for a language that translates 100 different phrases, and for countries were maybe a some of those phrases would be out of place, you can just provide a country-specific file with _just those special phrases_ defined.
7364

74-
Skipping Languages (aka Optimizing for My Language)
75-
------------------
65+
## Skipping Languages (aka Optimizing for My Language)
66+
7667
This is useful if you've got a default language. For example, if all of your content is served in english, then you probably don't want the overhead of loading up unecessary (and probably non-existant) english langauge packs (foo-en.json)
7768

7869
You can tell the localize plugin to always skip certain languages using the skipLanguage option:
@@ -88,13 +79,11 @@ You can tell the localize plugin to always skip certain languages using the skip
8879
# using an array of strings will skip if any of the strings matches exactly
8980
$("rel*=localize").localize("example", { skipLanguage: ["en", "en-US"] })
9081

91-
Applying the language file
92-
--------------------------
82+
## Applying the language file
9383

9484
If you rely on the default callback and follow the "rel" attribute conventions then the changes will be applied for you.
9585

96-
Examples:
97-
---------
86+
## Examples:
9887

9988
**HTML:**
10089

@@ -128,8 +117,7 @@ Examples:
128117

129118
$("rel*=localize").localize("application", { language: "es" })
130119

131-
Callbacks
132-
---------
120+
## Callbacks
133121

134122
You can provide a callback if you want to augment or replace the default callback provided by the plugin. Your callback should take at least 1 argument: the language data (contents of your json file). It can optionally accept a second argument, which is a reference to the default callback function. This is handy if you still want the default behavior, but also need to do something else with the language data.
135123

@@ -143,8 +131,20 @@ You can provide a callback if you want to augment or replace the default callbac
143131

144132
See the tests for working examples.
145133

146-
Credits & Licensing
147-
-------------------
134+
# Contributing
135+
136+
This plugin is written in [CoffeeScript](http://jashkenas.github.com/coffee-script/).
137+
The included `builder` script will run `coffee` with the necessary flags to
138+
automatically update the compiled javascript in the build/ directory any time you
139+
save changes to the coffee code under src/.
140+
141+
If you're interested in contributing, please fork the [repository](https://github.com/coderifous/jquery-localize),
142+
make your changes, and send pull-requests.
143+
144+
Learn more about [how to fork](http://help.github.com/fork-a-repo/) and
145+
[pull-requests](http://help.github.com/pull-requests/).
146+
147+
# Credits & Licensing
148148

149149
Copyright (c) Jim Garvin (http://github.com/coderifous), 2008.
150150

0 commit comments

Comments
 (0)