Skip to content
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

TranslationTree.GetAllValues() doesn't include parent key paths #24

Open
Place1 opened this issue Mar 14, 2023 · 0 comments
Open

TranslationTree.GetAllValues() doesn't include parent key paths #24

Place1 opened this issue Mar 14, 2023 · 0 comments

Comments

@Place1
Copy link

Place1 commented Mar 14, 2023

Hello, I think i've found a bug or an oversight but i'm not sure.

Given this JSON translation file...

{
    "key": "value of key",
    "look": {
        "deep": "value of look deep"
    }
}

TranslationTree.GetAllValues() will return...

{
    "key": "value of key",
    "deep": "value of look deep"
}

I think the mistake is here: https://github.dev/DarkLiKally/I18Next.Net/blob/6dbd30f23a8655134dc7d2041fe803240584a3ad/src/I18Next.Net/TranslationTrees/TranslationTree.cs#L69-L70

The parent translation name (key path) isn't propagated through the recursion for use in the dictionary.

I think it's supposed to result in this dictionary instead

{
    "key": "value of key",
    "look.deep": "value of look deep"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant