Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Don't crash when translating untranslated strings #2765

Merged
merged 1 commit into from May 15, 2017

Conversation

Projects
None yet
2 participants
Owner

ralsina commented May 14, 2017

keturn just reported on IRC that an old theme crashed because it used messages['Posted'] instead of the current messages['Posted:'] ... that's harsh :-)

@ralsina ralsina merged commit b61f406 into master May 15, 2017

5 checks passed

codacy/pr Good work! A positive pull request.
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ralsina ralsina deleted the kinder-messages branch May 15, 2017

+ if lang not in self:
+ LOGGER.warning('Unknown language %s', lang)
+ elif key not in self[lang]:
+ LOGGER.warning('Unknown message %s', key)
@Kwpolska

Kwpolska May 15, 2017

Owner

Is this enough to fix it? Perhaps you should add some fallback?

Owner

Kwpolska commented May 15, 2017

This breaks spectacularly and generates 161 error messages for the demo site (from post meta failing to be found). Reverting this.

Owner

Kwpolska commented May 15, 2017

Fixing this right is hard, since functionaries are used for post metadata, post data, and messages. But I’d argue this is too rare to bother fixing anyway. The original issue was using v6 themes, which are already pretty incompatible, and v7.0.0 was released almost exactly 3 years ago.

Owner

ralsina commented May 15, 2017

Ok, sorry about that :-P

I could do a subclass that is only for messages and use that only in that place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment