翻译了live example和downloadable example的文本

This commit is contained in:
Zhicheng Wang 2017-04-16 20:53:05 +08:00
parent 9c097544c9
commit c53cad729f
1 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ angularIO.directive('liveExample', ['$location', function ($location) {
'<iframe frameborder="0" width="100%" height="100%" src="' + src + '"></iframe>' + '<iframe frameborder="0" width="100%" height="100%" src="' + src + '"></iframe>' +
'</div>' + '</div>' +
'<img ng-click="toggleEmbedded()" ng-if="!embeddedShow" src="' + img + '" alt="plunker">' + '<img ng-click="toggleEmbedded()" ng-if="!embeddedShow" src="' + img + '" alt="plunker">' +
'<p>You can also <a href="' + zipHref +'">download this example.</p>'; '<p>你也可以<a href="' + zipHref +'">下载这个例子。</p>';
} }
return { return {
@ -69,7 +69,7 @@ angularIO.directive('liveExample', ['$location', function ($location) {
scope: true, scope: true,
compile: function (tElement, attrs) { compile: function (tElement, attrs) {
var href, template; var href, template;
var text = tElement.text() || 'live example'; var text = tElement.text() || '在线例子';
if (attrs['title'] == undefined) { tElement[0].setAttribute('title', text); } // set default title (tooltip) if (attrs['title'] == undefined) { tElement[0].setAttribute('title', text); } // set default title (tooltip)
var ex = attrs.name || NgIoUtil.getExampleName($location); var ex = attrs.name || NgIoUtil.getExampleName($location);
var embedded = attrs.hasOwnProperty('embedded'); var embedded = attrs.hasOwnProperty('embedded');
@ -105,13 +105,13 @@ angularIO.directive('liveExample', ['$location', function ($location) {
var template = a(text, { href: href, target: '_blank' }); var template = a(text, { href: href, target: '_blank' });
if (!noDownload) { if (!noDownload) {
template += ' / ' + a('downloadable example', { href: zipHref, target: '_blank' }); template += ' / ' + a('可下载的例子', { href: zipHref, target: '_blank' });
} }
// The hosted example and sources are in different locations for Dart. // The hosted example and sources are in different locations for Dart.
// Also show link to sources for Dart, unless noSource is specified. // Also show link to sources for Dart, unless noSource is specified.
if (isForDart && !attrs.hasOwnProperty('nosource')) { if (isForDart && !attrs.hasOwnProperty('nosource')) {
var srcText = attrs.srcText || 'view source'; var srcText = attrs.srcText || '查看源码';
var srcHref = 'http://github.com/angular-examples/' + ex; var srcHref = 'http://github.com/angular-examples/' + ex;
template = span(template + ' (' + a(srcText, { href: srcHref, target: '_blank' }) + ')'); template = span(template + ' (' + a(srcText, { href: srcHref, target: '_blank' }) + ')');
} }