False error regarding missing template messages
Expected Behavior
When using a template and the message translation is present in the file, there should be no warnings that the message is not provided.
Actual Behavior
A warning is issued about a missing template.
Steps to Reproduce the Problem
- Create files below
- Observe the error
en.arb
{
"@@locale": "en",
"hello": "Hello",
"@hello": {
"description": "Say hello"
}
}
en_UK.arb
{
"@@locale": "en_UK",
"@@x-template": "en.arb",
"hello": "Hello"
}
There is a warning at en_UK.arb that translation for hello isn't provided even though it is.
Specifications
- Version:
0.0.12 - Platform:
macOS, 14.3.1
I took a look at this and it seems the bug is at: https://github.com/google/arb-editor/blob/29a69b108a91a1bc90c488e0cdba341f9180df97/src/diagnose.ts#L82-L98
The entry.key is an object not a string literal so the === fails. Changing m.key === entry.key to m.key.value === entry.key.value produced the expected result.
Additionally, does it make sense to display the warning even when there are not missing messages? The current code seems to be doing this.