Skip to content

Commit 0902663

Browse files
authored
add localization info in README.md, close #39
Adding localization tips in the README, as suggested in #39
1 parent 2841b7c commit 0902663

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,41 @@ angular.module("materialExample").controller("calendarCtrl", function($scope, $f
110110
});
111111
```
112112

113+
### Localization
114+
115+
The localization of the calendar is straightforward and follows the standard Angular
116+
localization process described in the [guide](https://docs.angularjs.org/guide/i18n).
117+
You can find the list of natively supported locales [here](https://github.com/angular/angular.js/tree/master/src/ngLocale).
118+
119+
To translate the calendar, just include the correct localization file in your web page,
120+
right after the inclusion of angular.js.
121+
You can install it by downloading the file manually or using either npm or bower to automate
122+
the download.
123+
124+
```bash
125+
npm install angular-i18n
126+
```
127+
128+
or
129+
130+
```bash
131+
bower install angular-i18n
132+
```
133+
134+
Then use the script tag to include the translations (for example, for spanish locale):
135+
136+
```html
137+
<script src="bower_components/angular-i18n/angular-locale_es-es.js"></script>
138+
```
139+
140+
Another option is to use directly a CDN like [cdnjs](https://cdnjs.com/libraries/angular-i18n):
141+
142+
```html
143+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.5.7/angular-locale_es-es.js"></script>
144+
```
145+
146+
That's all, now the calendar will be automatically translated in the language of you choice.
147+
113148
## Hacking On It
114149

115150
Use gulp to spin up the server and re-compile resources on the fly. The

0 commit comments

Comments
 (0)