more phrases

This commit is contained in:
Константин Калинин
2015-02-13 15:37:48 +03:00
parent 483fff8f32
commit 020c738e95
5 changed files with 104 additions and 51 deletions

View File

@@ -5,20 +5,10 @@
* after <script src='lang/translator.js' type='text/javascript'></script>.
* For example - <script src='lang/ru.js' type='text/javascript'></script>
*
* Then you should create a SwaggerUI object this way:
* new SwaggerUi({
* ....
* onComplete: function(swaggerApi, swaggerUi){
* SwaggerTranslator.translate();
* ....
* }
* })
* in your index.html.
*
* If you wish to translate some new texsts you should do two things:
* 1. Add new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
* 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
* 2. Mark that text it templates this way <anyHtmlTag data-swTarnslate>New Phrase</anyHtmlTag> or <anyHtmlTag data-swTarnslate value='New Phrase'/>.
* The main thing here is attribute data-swTarnslate. Only inner html and value-attribute are going to translate.
* The main thing here is attribute data-swTarnslate. Only inner html, title-attribute and value-attribute are going to translate.
*
*/
SwaggerTranslator = {
@@ -35,6 +25,10 @@ SwaggerTranslator = {
$(this).val(
$this._tryTranslate($(this).val())
);
$(this).attr(
'title',
$this._tryTranslate($(this).attr('title'))
);
}
)
},