Skip to content

Crash if the device language is Chinese #436

@chinesedfan

Description

@chinesedfan

Bad news! After updated to 1.3, I can't open GitPoint any more on my iPhone. It's my mistake that only testing in simulator.

The following function is the culprit. In my iPhone, I18n.locale returns zh-Hans-CN, but zh is not a valid locale for moment.

export const getLanguage = () => I18n.locale.substr(0, 2);

Then it causes a crash.

11507295307_ pic

A workaround is to set device language to English first, open GitPoint successfully and choose any language in options manually. Then recover the device language.

@housseindjirdeh I find it's hard to implement getLanguage, so I suggest to just return en in it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions