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

No default-message #158

Open
aloysius-tim opened this issue Jul 28, 2020 · 1 comment
Open

No default-message #158

aloysius-tim opened this issue Jul 28, 2020 · 1 comment

Comments

@aloysius-tim
Copy link

Hi there,

I was wondering if there is any way to have the translations generated in the [language].json if no defaultMessage is specified.

Usually I do not define defaultMessage, but I would like to have the translation generated in [language].json with a custom defaultMessage ('default' by ex).

Thank you for your time.

Best,
Tim

@k0ka
Copy link

k0ka commented Oct 18, 2020

Here is how I did it:

    overrideCoreMethods: {
        provideExtractedMessages: () => {
            const messages = defaultReadMessages(messagesDirectory);
            messages.forEach(message => {
                message['descriptors'] = message['descriptors'].map(descriptor => {
                    descriptor['defaultMessage'] = 'TRANSLATE ME';
                    return descriptor;
                });
            });
            return messages;
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants