Skip to content

Commit 5d39819

Browse files
authored
Merge pull request #1547 from ngx-translate/revert-1530-patch-1
Revert "Add fast exit if no params provided" The problem with this change is that it avoids running the translation through the TranslateParser. This is indeed a performance improvement - but will break functionality. The TranslateCompiler might return functions that have to be resolved - e.g. the message format compiler plugin relies on this Users using the TranslateParser e.g. to resolve references to other translations or do other post-processing of the translations will also break.
2 parents 84e6d2a + 6447159 commit 5d39819

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

projects/ngx-translate/src/lib/translate.service.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,14 +327,10 @@ export class TranslateService {
327327
private getParsedResultForKey(key: string, interpolateParams?: InterpolationParameters): Translation|Observable<Translation>
328328
{
329329
const textToInterpolate = this.getTextToInterpolate(key);
330-
330+
331331
if (isDefinedAndNotNull(textToInterpolate))
332332
{
333-
//Fast exit to avoid overhead if no params provided
334-
if(isDefinedAndNotNull(interpolateParams))
335333
return this.runInterpolation(textToInterpolate, interpolateParams);
336-
else
337-
return textToInterpolate;
338334
}
339335

340336
const res = this.missingTranslationHandler.handle({

0 commit comments

Comments
 (0)