gadicc / meteor-messageformat

MessageFormat i18n support for Meteor, with reactive templates
54 stars 22 forks source link

Translation interface filters don't work if a translated string is removed #256

Open monitz87 opened 7 years ago

monitz87 commented 7 years ago

When the extractor marks a native string as removed, it doesn't do so for any translations of said string. This causes a bug in the interface when using filters because the query that fetches all strings is filtering out the native (removed) string, but not the translations.

This means that when later attempting to match string.file with the filter it crashes because lone translations do not have a file attribute. I have worked around it by adding a function to my startup that marks translations as removed if their respective native string is also marked, but it shouldn't be too hard to fix the extractor to avoid this.

The error itself occurs in meteor-messageformat/packages/ui/lib/client.js, line 245, but the fix should be in the extractor code that marks strings as removed.

Cheers

gadicc commented 7 years ago

Hi again @monitz87, thanks for reporting this. You're absolutely right. I regret however that unless this bug receives more traction, I probably won't have a chance to get to it before working on the next version. Hope you agree with my priorities.

monitz87 commented 7 years ago

Sure, I'm just doing my part by reporting. I understand that you have your priorities and it's perfectly ok. Maybe I'll get around to fixing it myself and submitting a PR when I find the time.

Cheers

sbalmer commented 7 years ago

Presumably this is fixed now that f8299544b5f9f492e86b9a68a1502dabd7d6ca87 is merged. It's an UI fix tough, as entries that lack a native translation are simply ignored.

@monitz87 can you check?