question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Whitelist default messages language

See original GitHub issue

I’d like to be able to configure a language for all default translations. This would essentially treat any message that has a defaultMessage as a whitelisted item for the specified language.

{
  ...
  defaultMessagesLanguage: 'en',
}

Treat all messages with a defaultMessage set as “en” and add to whitelist_en.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
miraguecommented, May 6, 2016

@alampros

We also found ourselves wanting to have the default messages in en.json, and went for this approach:

import manageTranslations, {
  readMessageFiles,
  createSingleMessagesFile,
  getDefaultMessages
} from 'react-intl-translations-manager';

const messagesDirectory = 'src/locales/extractedMessages';
const translationsDirectory = 'src/locales';

// Output Default Messages 
const extractedMessages = readMessageFiles(messagesDirectory);
createSingleMessagesFile({
  messages: getDefaultMessages(extractedMessages).messages,
  directory: translationsDirectory,
  fileName: 'en.json'
});

// Manage the Translations
manageTranslations({
  messagesDirectory,
  translationsDirectory,
  languages: ['sv']
});

This way you get the result you’re looking for without having the console complain about missing translations.

0reactions
sunknudsencommented, Jan 20, 2020

Thanks for sharing @mirague. This is exactly what I was looking for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Whitelisting Best Practices for Email Marketing
Learn how to add email addresses to your safe senders list with our Whitelisting Best Practices Guide for both marketers and subscribers. Read...
Read more >
Chat Bot Overview and Guide - StreamElements
The Chat Commands page is divided into several sections - Default Commands, Custom Commands, Command Variables and Bot Language.
Read more >
What is Whitelist (Allowlist)? - TechTarget
A whitelist is based on a strict policy set and is managed by an IT administrator. When the administrator is certain about access...
Read more >
Set the default language of a workspace or organization - Slack
You can select the default language for members of your Slack workspace or Enterprise Grid org. Only email invitations, SCIM-synced profiles, and Slackbot ......
Read more >
MailGuard Management Console
The Release Management feature allows you to configure how you want users in your organization to release a quarantined email message and optionally,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found