Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String interpolation does not apply camel key case to method arguments #34

Closed
scopendo opened this issue Sep 17, 2021 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@scopendo
Copy link

Thank you for this helpful package.

I've noticed that if I use {snake_case} in my translation strings, that the corresponding method does not apply camel case to the method's named parameters. For example, given the following translation string:

{
  "visit_status": "{status_text} at {when}"
}

I would expect the following method signature to be generated with the named parameter statusText having camel case applied.

  String visitStatus({required Object statusText, required Object when}) => '$statusText at $when';

However, the following method signature is generated where the snake case has not been converted to camel case.

  String visitStatus({required Object status_text, required Object when}) => '$status_text at $when';

My build.yaml file is:

targets:
  $defaults:
    builders:
      fast_i18n:
        options:
          fallback_strategy: base_locale
          input_directory: lib/localizations
          output_directory: lib/localizations
          key_case: camel
          string_interpolation: braces
@Tienisto
Copy link
Member

Thanks for the issue.

Yep, currently, only keys are converted. I will add a feature converting parameters soon.

@Tienisto Tienisto added the enhancement New feature or request label Sep 17, 2021
@Tienisto
Copy link
Member

Added in 5.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants