Skip to content

How to use this package with existing l10n.dart files #9

Description

@jeromeDms

Hi All
I'm developing 2 apps with shared code.
I created a package common_code, plus 2 apps using this common_code package.
My 2 apps have their own localization strings, and common_code package has also its own localization strings.
I'm facing the know issue with only the first localizationsDelegates working.

That's why I found your package.
I'm trying to use your package in my apps, but it seems I have to manually add all translated strings to the delegates ?

For instance, from your example: String get title => Intl.message('Multiple localization', name: 'title');

I already have l10n.dart files generated for both my apps as well as common_code.

The difference I see in l10n.dart and your code is the MultipleLocalizations.load rather than AppLocalizations.load in the load(Locale locale) function.

I was wondering if there is a way to use the existing l10n.dart that are automatically generated (and thus containing all strings localizations), and override the load function, rather than having to add manually all translations in the code ?

Hope I'm clear :-)
Thanks for any tips you could provide.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions