Code Monkey home page Code Monkey logo

Comments (3)

robisim74 avatar robisim74 commented on June 16, 2024

Hi @pweyrich,

got it, but the loading of translation data depends on L10nTranslationLoader, and your custom implementation of it.

It's true, the default loader (https://github.com/robisim74/angular-l10n/blob/master/projects/angular-l10n/src/lib/services/l10n-translation-loader.ts#L22-L28) use translation data as typescript files, but it is intended for basic scenarios, such as simple applications or tests.

The request for a lazy module is done via an http request, and I think that the translation files in that case should also make an http request, to keep the bundle lighter.

I leave this request open to other opinions.

from angular-l10n.

robisim74 avatar robisim74 commented on June 16, 2024

I looked at the possible alternatives: I intend to keep the services and tokens of this library singleton, and the forChild method should be used to inject the services, without implementing any other logic.

On the other hand, here it is sufficient to load the new assets in the lazy module:

export class LazyModule {
    constructor(private translation: L10nTranslationService) {
        this.translation.loadTranslation([{ name: 'lazy', asset: lazyTranslationData}]);
    }
}

from angular-l10n.

robisim74 avatar robisim74 commented on June 16, 2024

Closed due to inactivity

from angular-l10n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.