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

All generated classes as Labels #50

Open
stepanzalis opened this issue May 13, 2021 · 1 comment
Open

All generated classes as Labels #50

stepanzalis opened this issue May 13, 2021 · 1 comment

Comments

@stepanzalis
Copy link

stepanzalis commented May 13, 2021

With version 5.1, is it possible to access all generated classes with corresponding strings? With older version, I have extension like

extension BuildContextExtension on BuildContext {

  // Get translated label by calling [context.translate().foo.barTitle]
  AppLocalizations_Labels translate() {
    return AppLocalizations.of(this);
  }
}

It would be awesome to have something similar here 🙏

@stepanzalis
Copy link
Author

Already found a way in #38. @aloisdeniel would be awesome to update the doc.

AppLocalizationsData translate() {
    return Localizations.of<AppLocalizationsData>(this, AppLocalizationsData);
}

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

No branches or pull requests

1 participant