-
Notifications
You must be signed in to change notification settings - Fork 124
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
translation should allow to be ignored #79
Comments
@Licenser could you include the real-world example you ran in to? |
In the schema I tried to assing the mdns ip based on weather the ip/port is set, this needed a translation, which should not set anything in the app.config when ip/port is not set. |
@Licenser Would having the translation return 'undefined' when the IP/Port combination solve the problem? |
Yap, it would turn into |
@Licenser what if you used get_env/3 instead of get_env/2? |
Not available in erlang R15 :(, that said in R16 I could put in the code to default to |
So it's no longer 'undefined' it's "defined as |
yea but get_env treats those two situations differently:
|
I'll take this scenario under advisement, but for now, your best bet is to add the third clause for reading this value:
|
To add to this I just thought of another issue, if someone were to use |
|
@Licenser We now have an API function |
Basically it is possible to have a mapping not take effect when they are not present, right now there isn't a way to have this behaviour for translations.
A simple way to implement this would to change the return value of translation functions to
{ok, Value}
orundefined
in which case undefined would mean the translation has no effect.The text was updated successfully, but these errors were encountered: