Skip to content

Crowdin package doesn't handle parameters correctly #61

@JSBmanD

Description

@JSBmanD

Describe the bug
When I create string in crowdin website with variable {business} inside text it creates arb file with string with such structure
"some_translation": "Discount for {business}"
As it's not structure, crowdin generator makes corrupted class
"some_translation": "Discount for {business}",
"@some_translation": {
"placeholders": {
"business": {
"type": "String"
}
}
},
image

To Reproduce
Steps to reproduce the behavior:

  1. Latest sdk (0.6.3)
  2. Create arb file:
{
  "@@locale": "en",
  "some_translation": "Discount for {business}"
}
  1. Generate class with
    fvm flutter gen-l10n
    fvm dart run crowdin_sdk:gen
  2. Try to run app
  3. See an error

Expected behavior
Generator makes not getter for this string but function with parameter that could be passed into as default intl generates
String some_translation(Object business);

Environment

  • Crowdin Flutter SDK: 0.6.3
  • Flutter version: 3.24.1
  • Dart version: bundled in flutter

Additional context
I'm using crowdin on the web to create strings

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions