mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Return language code if language name not found
A language code is better than an empty string. The string would be used in the LanguageContext to describe an annotation like <span lang="en-fakeVariant">. Change-Id: Ibc18c238d6216927447ca26f336e9d973c6b93eb
This commit is contained in:
parent
bc0347259b
commit
4915cbaed4
|
@ -214,7 +214,7 @@ ve.init.mw.Platform.prototype.getLanguageCodes = function () {
|
|||
ve.init.mw.Platform.prototype.getLanguageName = function ( code ) {
|
||||
var languageNames = mw.language.getData( mw.config.get( 'wgUserLanguage' ), 'languageNames' ) ||
|
||||
$.uls.data.getAutonyms();
|
||||
return languageNames[ code ] || '';
|
||||
return languageNames[ code ] || code;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue