Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Zygimantas Berziunas
    @zygimantas
    Especially, if "❤︎N" component is used multiple times in one sentence
    Shahar Kazaz
    @shaharkazaz
    @zygimantas Can't the entire sentence be inside the hearts component? It seems like the text is always surrounding it.
    Zygimantas Berziunas
    @zygimantas
    No, because this component is used in multiple places in the app, even without text
    is there any way to pass and use a templateRef as parameter?
    Shahar Kazaz
    @shaharkazaz
    @zygimantas let's take this privatly :slight_smile:
    Mica Hallin
    @mickz18
    hi, concerning change on 2.1.1 for me is not legit that make ng add @ngneat/transloco@1.8.0 and ng update @ngneat/transloco break the app, you can not ask your user to reRead the readme completely each time (just my appreciation after lost 2 hour on that)
    Shahar Kazaz
    @shaharkazaz
    @mickz18 Did you ran the upgrade script?
    Mica Hallin
    @mickz18
    ng update @ngneat/transloco
    nop that one from schematics indeed it add the parameters / so just a section on the readme on update script will be perfect
    Shahar Kazaz
    @shaharkazaz

    @mickz18 in your issue you stated that the upgrade was from v2.0.1 to v2.1.1, so it wasn't clear that you upgraded from an earlier version (before the breaking change).

    We recommand our users to always read the braking changes file and re-read the docs when doing a major upgrade.
    We will always provide an out of the box upgrade script when possible to avoid exactly what happened to you :slight_smile:

    As you can see the upgrade script is described there
    Mica Hallin
    @mickz18
    indeed just going to buy new glass, I did open the file, migrate structural directive and reRenderOnLangChange ... RTFM to me sorry for the disturbance
    Shahar Kazaz
    @shaharkazaz
    @mickz18 Don't worry about it :thumbsup:
    NGirot
    @skaor
    @shaharkazaz it works with 2.1.1. Sorry i was not available since my last message ;)
    Shahar Kazaz
    @shaharkazaz
    @skaor great to hear :)
    Nacho Vazquez
    @NachoVazquez
    Hello to all and thanks for this awesome library!!
    Nacho Vazquez
    @NachoVazquez

    I'm been reading the docs and I facing the same problem as @mailok.

    The project where I'm planning to use transloco is an Nx monorepo where every app is practically empty.

    All the code is in the libraries and libraries are shared across many apps.

    What I need is to have the i18n .json files contained into each lib to avoid duplication.

    There is an approach to deal with this use case yet?

    Thanks again!

    Shahar Kazaz
    @shaharkazaz
    @NachoVazquez I'm not quite sure I understand.
    Can you please show an example/create a small reproduction?
    Nacho Vazquez
    @NachoVazquez
    Hi, @shaharkazaz thanks for the quick feedback. Sure I can create a Stackblitz for tonight.
    Shahar Kazaz
    @shaharkazaz
    @NachoVazquez cool, waiting to check it out :thumbsup:
    Nacho Vazquez
    @NachoVazquez

    Ok, so apparently Stackblitz and CodeSandbox have some issues with Nx.

    Anyway, this is the repo, I tried to keep it as simple as posible.

    https://github.com/NachoVazquez/transloco-with-nx-libs

    Nacho Vazquez
    @NachoVazquez

    In master, it is using a custom loader and it is not working. I managed to make it work in branch dynamic-translations but I would prefer to use a loader.

    Also, when loading a lib module eagerly, and the translation key is repeated in the app or another lib, it gets overwritten.

    To run the app, just ng serve.

    Thierry
    @ThierryDD

    Hi @shaharkazaz

    Is there anything preventing us to use transloco@2 and angular@8 with transloco-messageformat@1.1.1 ?

    npm WARN @ngneat/transloco-messageformat@1.1.1 requires a peer of @angular/common@^7.2.0 but none is installed. You must install peer dependencies yourself.
    npm WARN @ngneat/transloco-messageformat@1.1.1 requires a peer of @angular/core@^7.2.0 but none is installed. You must install peer dependencies yourself.
    npm WARN @ngneat/transloco-messageformat@1.1.1 requires a peer of @ngneat/transloco@^1.6.0 but none is installed. You must install peer dependencies yourself.

    Or can we safely ignore these warnings?

    Colum Ferry
    @Coly010

    Hi, i'm in the middle of hooking up the Transloco Optimize plugin, but the readme isn't perfect in explanation of using it as a function.
    This:

    const locales = `${config.paths.dist}${config.paths.assets.locales}`;

    could realistically point to a path of any structure.
    Can anyone confirm that the path should look like this:

    const pathToLocales = `${__dirname}/dist/${appName}/assets/i18n`;

    And if so, i'll make a PR to update this to be more specific

    Shahar Kazaz
    @shaharkazaz
    @NachoVazquez cool I'll check it out.
    @ThierryDD Don't think you should have any issues, LMK if you do have :)
    Thierry
    @ThierryDD
    @shaharkazaz So far, so good.
    Shahar Kazaz
    @shaharkazaz
    @Coly010 I'll get back to you on that :slight_smile:
    Colum Ferry
    @Coly010
    @shaharkazaz awesome!
    Nacho Vazquez
    @NachoVazquez
    @shaharkazaz great thanks!
    Shahar Kazaz
    @shaharkazaz
    @Coly010 I updated the README, check it out :slight_smile:
    Shahar Kazaz
    @shaharkazaz
    @Coly010 Thanks for bringing it to our attention, I just saw you wanted to PR that sry I missed that
    Colum Ferry
    @Coly010
    @shaharkazaz no worries! Was just trying to save you time fixing it lol
    @shaharkazaz I have something else i can PR, it seems that the translocoOptimize function isn't a default export from the index.js, however, the docs in the README say to import it as though it was a default export. I'll submit a PR to fix the docs for that
    Colum Ferry
    @Coly010
    Just double checking it all first

    So if i do this:

    import translocoOptimize from '@ngneat/transloco-optimize';

    I get this error

    ERROR! TypeError: transloco_optimize_1.default is not a function

    and if i do this:

    import { translocoOptimize } from '@ngneat/transloco-optimize';

    I get this error

    ERROR! TypeError: transloco_optimize_1.translocoOptimize is not a function

    To fix this I had to use:

    const translocoOptimize = require('@ngneat/transloco-optimize')
    I could submit a PR to update the docs to say to use require or i guess(?) const translocoOptimize = import('@ngneat/transloco-optimize')
    Or I could submit a PR to change the export in that module
    Nacho Vazquez
    @NachoVazquez

    @shaharkazaz I realize that using a unique scope for the eagerly loaded lib modules can solve the problem of the overwritten translations. This is using dynamic translations.

    What remains that I would like you to help me in is achieving the use of loaders in libs. Encapsulating its translation files inside the lib.

    Shahar Kazaz
    @shaharkazaz
    @NachoVazquez I see what you mean, what do you think about the solution offered here: ngneat/transloco#121
    inline loaders
    @Coly010 It works for me, we need to see maybe why are you having issues
    Shahar Kazaz
    @shaharkazaz
    maybe you need allowJS in your tsConfig?
    Colum Ferry
    @Coly010
    @shaharkazaz ahhh that may be it! No worries then!
    Shahar Kazaz
    @shaharkazaz
    Nacho Vazquez
    @NachoVazquez
    Thanks @shaharkazaz . I'll check it out and let you know.
    Nacho Vazquez
    @NachoVazquez
    Hey @shaharkazaz, that's great!. Thank you very much and thanks also to Netanel for creating the example repo. When this feature is going to be shipped??
    Shahar Kazaz
    @shaharkazaz
    @NachoVazquez hopefully soon :slight_smile:
    Thierry
    @ThierryDD

    Minor error in Transloco Documentation for MessageFormat: ngneat/transloco#132
    It should be customFormatters instead of formatters.

    I also noticed that if your customFormatter name begins with one of the default formatters [date, time, duration, etc...], it fails.

    Example:

        TranslocoMessageFormatModule.init({
          customFormatters: {
            time24: v => translateTime(v)
          }
        })

    It fails with the error message: "Expected "," or "}" but "2" found."