Skip to content

Commit 61fa1a3

Browse files
committed
Fix doc
1 parent dc31f68 commit 61fa1a3

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

Resources/doc/index.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ Just amend the above mentioned URLs to also contain the `'_format': 'json'` para
9393

9494
Then, feed the translator via `Translator.fromJSON(myRetrievedJSONString)`.
9595

96-
### Load translations via dumped JavaScript files
96+
### Load Translations Via Dumped JavaScript Files
9797

98-
#### Dump JavaScript translation files
98+
#### Dump JavaScript Translation Files
9999

100100
Dump the translation files to the `web/js` folder:
101101

@@ -104,7 +104,7 @@ Dump the translation files to the `web/js` folder:
104104
You can use the optional `--symlink` option. The `target` (`web/js` in the
105105
example above) argument is also optionally, `web` is the default `target`.
106106

107-
#### Use with Assetic
107+
#### Use With Assetic
108108

109109
```twig
110110
{% javascripts
@@ -117,7 +117,7 @@ With `'js/i18n/*/*.js'`, you load all the translation files from all of the
117117
translation domains. Of couse, you can load domains one by one
118118
`'js/i18n/admin/*.js'`.
119119

120-
### The JavaScript side
120+
### The JavaScript Side
121121

122122
``` javascript
123123
Translator.has('DOMAIN_NAME:key');
@@ -141,7 +141,7 @@ Translator.get('key');
141141

142142
**Note:** this will only work if default domains are previously loaded (see the _Load translation domains_ first section).
143143

144-
#### Message placeholders
144+
#### Message Placeholders
145145

146146
Read the official documentation about Symfony2 [message placeholders](http://symfony.com/doc/current/book/translation.html#message-placeholders).
147147

@@ -194,7 +194,7 @@ Translator.get('apples', {"count" : 100}, 100);
194194

195195
**Note:** This is not tested at the moment. It works fine for english/french translations.
196196

197-
#### Get the locale
197+
#### Get The Locale
198198

199199
You can get the current locale by accessing the `locale` attribute:
200200

@@ -244,6 +244,7 @@ Translator.get('placeholder');
244244
// will return 'Hello %username%, how are you ?' if the current locale is set to 'fr', undefined otherwise.
245245
```
246246

247+
247248
More configuration
248249
------------------
249250

@@ -265,3 +266,33 @@ In a similar way, if some of your translations are not complete you can enable a
265266
bazinga_expose_translation:
266267
locale_fallback: "en" # put here locale code of some complete translation, I recommend the value used for translator fallback
267268
```
269+
270+
Reference Configuration
271+
-----------------------
272+
273+
``` yaml
274+
# app/config/config*.yml
275+
bazinga_expose_translation:
276+
locale_fallback: ''
277+
default_domains: []
278+
```
279+
280+
281+
Testing
282+
-------
283+
284+
### PHP
285+
286+
Setup the test suite using [Composer](http://getcomposer.org/):
287+
288+
$ composer install --dev
289+
290+
Run it using PHPUnit:
291+
292+
$ phpunit
293+
294+
### JavaScript
295+
296+
You can run the JavaScript test suite using [PhantomJS](http://phantomjs.org/):
297+
298+
$ phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index.html

0 commit comments

Comments
 (0)