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

Allow a function to be passed in the messages property #1

Open
Tracked by #2
rxaviers opened this issue Aug 24, 2015 · 2 comments
Open
Tracked by #2

Allow a function to be passed in the messages property #1

rxaviers opened this issue Aug 24, 2015 · 2 comments

Comments

@rxaviers
Copy link
Owner

On globalizejs/globalize#481, @sompylasar has raised a different use case that requires a custom function to return Globalize messages. So, the goal of this issue make the messages option to either accept the string (as documented above) or a function that passes locale as its first argument. For example:

new globalizePlugin({
    production: options.production, // true: production, false: development
    developmentLocale: "en", // locale to be used for development.
    supportedLocales: [ "en", "es", "zh" ], // locales that should be built support for.
    messages: function( locale ) {
        // Messages in the JSON format for requested locale.
        return getMessagesFor( locale );
    }
    output: "globalize-compiled-[locale].[hash].js" // build output.
});
@joerm
Copy link

joerm commented Feb 1, 2016

Question: We're coming across this library for use in an upcoming product; localization is important to us, and I've prototyped using this plugin... but an obvious question from others is whether all localized strings are downloaded at once.

What are your priorities around supporting this repo? I've looked at the codebase and a PR in the short term is a bit unlikely given my other priorities. Is this issue currently being worked on?

@rxaviers
Copy link
Owner Author

rxaviers commented Feb 1, 2016

I'm afraid I didn't understand your question "whether all localized strings are downloaded at once". Could you please explain it? I want to make sure I understand why you need this feature.

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

2 participants