Support for translation of TypeScript files is provided in Angular 7 with i18n

Recent Versions.

"@angular-devkit/build-angular": "0.13.4",
"@angular-devkit/build-ng-packagr": "0.13.4",
"@angular/animations": "7.2.2",
"@angular/cdk": "7.2.2",
"@angular/cli": "7.3.3",
"@angular/common": "7.2.6",
"@angular/compiler": "7.2.6",
"@angular/compiler-cli": "7.2.6",
"@angular/core": "7.2.6",
"@angular/forms": "7.2.6",
"@angular/language-service": "7.2.6",
"@angular/material": "7.2.2",
"@angular/platform-browser": "7.2.6",
"@angular/platform-browser-dynamic": "7.2.6",
"@angular/router": "7.2.6",

A request for help: I have recently started localizing my application and encountered a problem. While generating the bundle for a specific locale (like Japanese), I am able to use i18n for .html files but unable to do so for .ts files. After some research, I found that there are two potential solutions: ngx-translate and @angular/localize.

However, using ngx-translate doesn't seem suitable for my project, and @angular/localize is recommended for Angular 9 onwards, while I am currently using Angular 7.

Is there a way to translate typescript files in Angular 7 without upgrading to Angular 9 for @angular/localize?

Answer №1

Sadly, that is correct.

The angular packages follow the same versioning as the main repository. The earliest version of the @angular/localize package dates back to 9.1.13.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The specified type '{ songs: any; }' cannot be assigned to the type 'IntrinsicAttributes' in NEXTJS/Typescript

I am currently working on a straightforward script. Below is the index.tsx file for my Next.js application: import type { NextPage } from 'next' import SongsList from '../components/SongsList/SongsList' import { GetStaticProps } from & ...

A guide on logging errors triggered within reducers

I'm facing a challenge in Redux where I am unable to get error messages logged to the console. My stack includes React, Redux Toolkit, and TypeScript. Here is a snippet of one of the reducers I've implemented: // Reducer const removeResourceRedu ...

What steps can I take to avoid cross-project contamination within an Angular workspace?

Imagine having a project structured like this: projects |-app1 |-app2 |-common node_modules pakcage.json tsconfig.json angular.json ... (other root files) Currently, in a file within app1, you can have an import statement like this: import { Repository } ...

Information about the HTML detail element in Angular 2 is provided

Hi, I'm curious if there's a way to know if the details section is open or closed. When using <details (click)="changeWrap($event)">, I can't find any information in $event about the status of the details being open. I am currently wor ...

Issue with Angular 18 component not being displayed or identified

Recently, I began building an Angular 18 application and encountered an issue with adding my first component as a standalone. It appears that the app is not recognizing my component properly, as it does not display when added as an HTML tag in my app.compo ...

Creating a method in Angular that combines async/await functionality with Observables

After transitioning from using async/await to Observables in Angular, I am trying to refactor the following code snippet to make it work with Observables: async refreshToken() { const headers = this.authStorage.getRequestHeader(); const body = { ...

"Connection refused on local server when trying to connect Node.js with Angular

My Mean app is deployed on bitnami. When attempting to make a post from angular to my express server, I use the URL http://localhost:3000/mypostaccess. Every time I try this, my browser shows net::ERR_CONNECTION_REFUSED. Strangely, when I replace "localho ...

Learning to retrieve the value from a dynamically generated input tag in a TypeScript file

<div *ngFor="let task of arrayList"> <input id="task.fieldName" *ngIf="task.key === 'Others'" type="text" class="form-control"> </div> When dealing with dynamically created input fields based on a condition, the challenge is ac ...

Oops! There seems to be a syntax error near "NOT" in TypeORM

I am currently developing an app using NestJs with a Postgres database and TypeOrm as the ORM. I have created my migration file, configured the package.json file, but when I try to run yarn typeorm migration:run, I encounter the following error: query fail ...

Issue Updating Angular 13 formGroup with API Response

Currently, I am working on creating a form to input data and save it for later editing. While most of the functionality is working smoothly, I am experiencing issues with using [(ngModel)] specifically for multiple entries in the list of cars. Additionally ...

Please indicate the generator title (for example, nx generate @nrwl/workspace:library) specifically for Angular

Currently, I am expanding my knowledge in web development. While working with Angular, I encountered an issue when trying to create a new component. The error message reads "Specify the generator name (e.g., nx generate @nrwl/workspace:library)" after exec ...

Attempting to utilize Array Methods with an Array Union Type

Currently, I am in the process of refactoring an Angular application to enable strict typing. One issue I have encountered is using array methods with an array union type in our LookupService. When attempting to call const lookup = lookupConfig.find(l =&g ...

Issue with displaying data in HTML even though it appears in the console log in Angular framework

I am able to retrieve JSON data from my server-side and view it on the console log, but I am encountering difficulties rendering it on the HTML page. Could this be due to incorrect syntax? I am attempting to access data from my MongoDB and display it usin ...

Exploring the Contrast in Typescript: Static Members within Classes vs Constants within Namespace

When creating this namespace and class in Typescript, what distinguishes the two? How does memory management vary between them? export namespace TestNamespace { export const Test = 'TEST'; export const TestFunction = (value:string):boolean = ...

Guide on How to Include data (PDF Base 64) in angular 6 component

Within my Angular 6 application, I am presenting data (a report) in a new window using the following code snippet. *** The 'result' variable contains Base64 data *** if (result != null) { const pdfWindow = window.open(""); ...

"Implementing the functionality to handle checkbox click events and changes in Angular

Encountering an unusual issue with checkboxes in angular2 (beta 17). Attempting to align checkboxes with elements in an array and bind the change or click event. Here is an example array: myObjects=[ {value:true}, {value:true}, {value:false} ...

Disallow negative numbers but allow decimals in HTML input

I need help restricting user input to prevent negative numbers while still allowing floating point numbers in my Angular project. Any suggestions using Angular tools would be greatly appreciated. Thanks! ...

Type Error TS2322: Cannot assign type 'Object[]' to type '[Object]'

I'm facing an issue with a code snippet that looks like this: export class TagCloud { tags: [Tag]; locations: [Location]; constructor() { this.tags = new Array<Tag>(); this.locations = new Array<Location>(); ...

Create an interface that adheres to the defined mapped type

Working on a typescript project, I have defined the mapped type GlanceOsComparatorV2 interface DonutData { label: string; value: number; } interface ProjectMetric { value: number; } enum ZoneMetricId { ClickRate = 'clickRate', } enum Pa ...

Troubleshooting: When attempting to integrate a Flask Backend with a NextJS frontend, encountering issues with files not being received properly

I have developed a Flask Backend with the purpose of accepting and processing files. Recently, I created a Next.js frontend where users can upload files. Strangely enough, when I followed the same steps as in my Flask project using a template HTML file, it ...