-
Notifications
You must be signed in to change notification settings - Fork 40
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
How to deal with defaultLanguage #76
Comments
First: thx for using this package! Second: sorry for the confusion around the default language! I haven't found a good way to deal with the defaultLanguage yet, but ATM, it's not really recommended to include the defaultLanguage in your languages array. At the start of this package I approached it like this: since your defaultMessages are in your defaultLanguage, you don't need to manage them, so you don't need to include the language in the array of languages to be managed. That being said, we should come up with an approach to help people out (either a way to include the default language, or better docs) since this is a frequently returning question. |
First of all thanks for the tool @GertjanReynaert Im using it and its amzazing. Im also having questions regarding this feature. I have it included because I want it to generate the 'en.json' file from my messages, but I don't like to get that output. Maybe we should be able to define a defaultLanguage, the manager will then generate the defaultMessages .json with that name but ignore it when comparing files? That way we get the file generation and nice translations management. just an idea! |
I wrote a small workaround for this very issue today, it's not very clean since it re-reads the messages, and it prevents checking for untranslated strings in other languages, but it works with the current API and may be a start. In the original example:
I wonder if I've also opened #84 which might be of interest. If implemented it would allow for the |
It looks like this package is not maintained anymore, so I forked it and made a little change to suppress the warnings about untranslated messages with a defaultLanguage option in config. You can check it here: https://github.com/hudovisk/react-intl-translations-manager |
@hudovisk I couldn't really find how to configure your fork with the suppression though. Since I'm not using this package on a day to day basis my attention to the package has slacked a bit. However it's in a pretty solid state right now, so it doesn' require frequent updates anymore, but this lack of updates might have given an unmaintained impression. Long story short: If you'd like to create a pr, that's always welcome! |
Hi @GertjanReynaert, sorry if I misunderstood the state of the package, would be nice to have your opinion on my patch #113 , I use it with the config:
this way I can extract all de defaultMessages in a simple json file without having the untranslated warnings. |
Great work @GertjanReynaert. Thanks, really. What’s the status for the #113 PR? Looks promising! I believe having the default locale in |
Hi @GertjanReynaert, before going forward I wanted to say thank you for your work, great job!
I opened this issue since I'm a bit confused about how to deal with the defaultLanguage.
Let's say you wrote all the message descriptors in your components and then used babel-plugin-react-intl to extract them to a directory, you google a while about how to join them and found this package, so you read the docs and create a script like this:
you run the script and voila, everything worked as expected, but there is a file that grabs your attention: whitelist_en-US.json, so you read the docs again and found this:
You think: "I can have more control with this feature, great!"
And then you modify some defaultMessage, run the script again, and you get:
So you are stuck, you was expecting the generated json to update with the latest change you've introduced but instead you got all this...
So the question would be:
Thanks!
The text was updated successfully, but these errors were encountered: