Explorar o código

Fixed code snippets.

Maciej Bukowski %!s(int64=5) %!d(string=hai) anos
pai
achega
5bd51cf674
Modificáronse 1 ficheiros con 2 adicións e 7 borrados
  1. 2 7
      docs/framework/guides/deep-dive/localization.md

+ 2 - 7
docs/framework/guides/deep-dive/localization.md

@@ -84,7 +84,6 @@ This example shows how to create a localizable user interface of a plugin.
 ```js
 // ...
 editor.ui.componentFactory.add( 'smilingFaceEmoji', locale => {
-	const command = editor.commands.get( 'insertSmilingFaceEmoji' );
 	const buttonView = new ButtonView( locale );
 
 	// The translation function.
@@ -117,14 +116,10 @@ For better accessibility support, do not forget about making `aria` attributes l
 
 ```js
 editingView.change( writer => {
-	const editingView = this._editingView;
 	const t = this.t;
+	const viewRoot = editingView.document.getRoot( this.name );
 
-	editingView.change( writer => {
-		const viewRoot = editingView.document.getRoot( this.name );
-
-		writer.setAttribute( 'aria-label', t( 'Rich Text Editor, %0', [ this.name ] ), viewRoot );
-	} );
+	writer.setAttribute( 'aria-label', t( 'Rich Text Editor, %0', [ this.name ] ), viewRoot );
 } );
 ```