Sfoglia il codice sorgente

Changed name for the define function which breaks CI.

Maciej Bukowski 9 anni fa
parent
commit
ac8be56a7e

+ 3 - 3
packages/ckeditor5-utils/src/translation-service.js

@@ -13,7 +13,7 @@ const translations = {};
  * Merges package translations to existing ones.
  * These translations can be used later with {@link module:utils/translations-service~translate translate}
  *
- *		define( 'pl', {
+ *		add( 'pl', {
  *			'OK': 'OK',
  *			'Cancel [context: reject]': 'Anuluj'
  *		} );OK
@@ -22,7 +22,7 @@ const translations = {};
  * @param {Object.<String, Object>} packageDictionary
  * @returns undefined
  */
-export function define( lang, packageDictionary ) {
+export function add( lang, packageDictionary ) {
 	if ( !( lang in translations ) ) {
 		translations[ lang ] = {};
 	}
@@ -36,7 +36,7 @@ export function define( lang, packageDictionary ) {
 }
 
 /**
- * Translates string if the translation of the string was previously defined using {@link module:utils/translations-service~define define}.
+ * Translates string if the translation of the string was previously added using {@link module:utils/translations-service~add add}.
  * Otherwise returns original (English) sentence.
  *
  *		translate( 'pl', 'Cancel [context: reject]' );

+ 5 - 5
packages/ckeditor5-utils/tests/translation-service.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  */
 
-import { translate, define, _clear } from '../src/translation-service';
+import { translate, add, _clear } from '../src/translation-service';
 
 describe( 'translationService', () => {
 	beforeEach( () => {
@@ -23,7 +23,7 @@ describe( 'translationService', () => {
 	} );
 
 	it( 'should return translation if the translation for the concrete language is defined', () => {
-		define( 'pl', {
+		add( 'pl', {
 			'OK': 'OK',
 			'Cancel [context: reject]': 'Anuluj'
 		} );
@@ -34,7 +34,7 @@ describe( 'translationService', () => {
 	} );
 
 	it( 'should return english string without context if the translations for the concrete language exist, but translation doesn\'t', () => {
-		define( 'pl', {
+		add( 'pl', {
 			'OK': 'OK',
 			'Cancel [context: reject]': 'Anuluj'
 		} );
@@ -45,12 +45,12 @@ describe( 'translationService', () => {
 	} );
 
 	it( 'should be able to merge translations', () => {
-		define( 'pl', {
+		add( 'pl', {
 			'OK': 'OK',
 			'Cancel [context: reject]': 'Anuluj'
 		} );
 
-		define( 'en_US', {
+		add( 'en_US', {
 			'OK': 'OK',
 			'Cancel [context: reject]': 'Cancel'
 		} );