#Localization file generates with no messages when using $localize

3 messages · Page 1 of 1 (latest)

nocturne root
#

login.component.ts: ```ts
import { Component } from '@angular/core';
import {MatButtonModule} from '@angular/material/button';
import {MatInputModule} from '@angular/material/input';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatIconModule} from '@angular/material/icon';
import { ReactiveFormsModule, FormControl, Validators } from "@angular/forms";
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {merge} from 'rxjs';
import { AuthComponent } from "../auth/auth.component";
import { RouterModule } from "@angular/router";
import {MatSnackBar} from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
import { $localize } from '@angular/localize/init';

export class LoginComponent {
emailErrorMessage = '';
passwordErrorMessage = '';

constructor(private _snackBar: MatSnackBar, private route: ActivatedRoute) {
...................
// Check if the URL Param expired is true
if (this.route.snapshot.queryParams["expired"]) {
this._snackBar.open($localize A sua sessão expirou. Por favor faça login novamente, $localize Ignorar, {
duration: 10000,
});
}

}

updateEmailErrorMessage() {
if (this.email.hasError('required')) {
this.emailErrorMessage = $localize Tem de introduzir um valor;

} else if (this.email.hasError('email')) {
  this.emailErrorMessage = $localize `Não é um email válido`;
} else {
  this.emailErrorMessage = '';
}

}

updatePasswordErrorMessage() {
if (this.password.hasError('required')) {
this.passwordErrorMessage = $localize Tem de introduzir um valor;
} else {
this.passwordErrorMessage = '';
}
}
.............
}

#

If I remove all the mentions of $localize the messages.xlf will generate with the HTML that was marked with the i18n attribute

#

putting $localize back in, the marked HTML doesnt even appear in the messages.xlf