Open levalup opened 1 year ago
I had the same issue. You can work around this by putting these texts between quotes:
enum:
bool:
yes: 'yes'
no: 'no'
on: 'on'
off: 'off'
I had the same issue. You can work around this by putting these texts between quotes:
enum: bool: yes: 'yes' no: 'no' on: 'on' off: 'off'
Thanks. I tried this before, but it does not solve the problem I encountered very well. The fundamental problem is that the parser will also parse the key values (yes or no) of the dictionary into booleans, so it needs to be completely rewritten to achieve the expected effect.
enum:
bool:
'yes': 'yes'
'no': 'no'
'on': 'on'
'off': 'off'
I don't think it's appropriate to trade key values(such as yes/no) into boolean, at least it should be able to prompt the user instead of crashing directly.
At least it should not crash, and then remind users that special strings should be enclosed in single quotation marks(').
Version: Easy I18n(4.4.1)
I was using yml config like this:
This causes the following error. This looks like taking the string yes, no, on or off as boolean.
If I change locale file to:
Then I got table like this:
Well, the YAML parser taking every string yes, no, on or off as boolean.
I don't think it's good idea to keep default SpringBoot (or other tool) behaviour to parse locale file.
At least it should not crash, and then remind users that special strings should be enclosed in single quotation marks(').
Error log