slang-i18n / slang

Type-safe i18n for Dart and Flutter
https://pub.dev/packages/slang
MIT License
473 stars 39 forks source link

Can't generate linked translations. #117

Closed BenevidesLecontes closed 1 year ago

BenevidesLecontes commented 1 year ago

Describe the bug I'm trying to use linked translations but every time i try i'm having undefined exceptions

To Reproduce

"orderMessages": {
    "sent": "Sua ordem foi enviada e está aguardando execução. Acompanhe suas movimentações.",
    "partialOrderCount": {
      "one": "{count} cota",
      "other": "{count} cotas"
    },
    "status(param=orderStatus)": {
      "executed": "Você comprou @:partialOrderCount de {ticker} a {price}. O valor total é de {total}.",
    }
  }

I tried with pluralization and without, it didn't work. I'm receiving this error on the build runner: "shared.orderMessages.status.executed" is linked to "partialOrderCount" but "partialOrderCount" is undefined (locale: pt).

Additional context Flutter 3.3.9 • channel stable slang: ^3.5.0 slang_flutter: ^3.5.0 slang_build_runner: ^3.5.0

Tienisto commented 1 year ago

Hello, the path of linked translations has to be absolute.

In your example, It should be @:orderMessages.partialOrderCount.

BenevidesLecontes commented 1 year ago

@Tienisto worked, would be nice to add to the documentation.