8
0
Просмотр исходного кода

Add possibility to translate labels.

Mateusz Samsel 6 лет назад
Родитель
Сommit
0f1546488f
1 измененных файлов с 1 добавлено и 12 удалено
  1. 1 12
      packages/ckeditor5-font/src/fontcolor/fontcolorui.js

+ 1 - 12
packages/ckeditor5-font/src/fontcolor/fontcolorui.js

@@ -29,7 +29,7 @@ export default class FontColorUI extends Plugin {
 			const colorTableView = colorUI.addColorsToDropdown(
 			const colorTableView = colorUI.addColorsToDropdown(
 				dropdownView,
 				dropdownView,
 				options.map( element => ( {
 				options.map( element => ( {
-					label: element.label,
+					label: t( element.label ),
 					color: element.model,
 					color: element.model,
 					options: {
 					options: {
 						hasBorder: element.hasBorder
 						hasBorder: element.hasBorder
@@ -66,17 +66,6 @@ export default class FontColorUI extends Plugin {
 		} );
 		} );
 	}
 	}
 
 
-	/**
-	 * Returns options as defined in `config.fontFamily.options` but processed to account for
-	 * editor localization, i.e. to display {@link module:font/fontfamily~FontFamilyOption}
-	 * in the correct language.
-	 *
-	 * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
-	 * when the user configuration is defined because the editor does not exist yet.
-	 *
-	 * @private
-	 * @returns {Array.<module:font/fontfamily~FontFamilyOption>}.
-	 */
 	_getLocalizedOptions() {
 	_getLocalizedOptions() {
 		const editor = this.editor;
 		const editor = this.editor;
 		const colors = normalizeOptions( editor.config.get( `${ FONT_COLOR }.colors` ) );
 		const colors = normalizeOptions( editor.config.get( `${ FONT_COLOR }.colors` ) );