more phrases
This commit is contained in:
18
dist/lang/translator.js
vendored
18
dist/lang/translator.js
vendored
@@ -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'))
|
||||
);
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user