mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
html10n.js: Don't break in getDirection if language hasn't been set
fixes #1724
This commit is contained in:
parent
df8a31f241
commit
594757cc47
1 changed files with 1 additions and 0 deletions
|
@ -900,6 +900,7 @@ window.html10n = (function(window, document, undefined) {
|
||||||
* Returns the direction of the language returned be html10n#getLanguage
|
* Returns the direction of the language returned be html10n#getLanguage
|
||||||
*/
|
*/
|
||||||
html10n.getDirection = function() {
|
html10n.getDirection = function() {
|
||||||
|
if(!this.language) return
|
||||||
var langCode = this.language.indexOf('-') == -1? this.language : this.language.substr(0, this.language.indexOf('-'))
|
var langCode = this.language.indexOf('-') == -1? this.language : this.language.substr(0, this.language.indexOf('-'))
|
||||||
return html10n.rtl.indexOf(langCode) == -1? 'ltr' : 'rtl'
|
return html10n.rtl.indexOf(langCode) == -1? 'ltr' : 'rtl'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue