Skip to content

Chinese (Traditional) is showing up as Chinese (Simplified) #21

Closed

Description

@yishus

Phones with traditional chinese locale are showing up as "language":"zh-Hans". Unable to target users on zh-Hant

Activity

  1. jamesstout commented on May 1, 2016

    @jamesstout
    Contributor

    Are you running on iOS9?

    OneSignal.m uses:

    [[NSLocale preferredLanguages] objectAtIndex:0], @"language"

    However, there is an Apple Tech Note that says:

    With iOS 9, the results returned by NSLocale.preferredLanguages() can differ from previous releases

    But that shouldn't switch zh-Hant to zh-Hans though...

    Probably need to know a littlebit more about your device. iOS version, phone language setting, and region, and if the app you are running is localised or not.

    Maybe the output from some of these:

    NSArray *languages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
    NSString *currentLanguage = [languages objectAtIndex:0];
    NSLog(@"Current language: %@", currentLanguage);
    
    NSArray* preferredLanguages = [NSLocale preferredLanguages];
    NSLog(@"preferredLanguages: %@", preferredLanguages);
    
    NSString* localeID = [NSLocale currentLocale].localeIdentifier;
    NSDictionary* components = [NSLocale componentsFromLocaleIdentifier:localeID];
    NSString* languageID = components[NSLocaleLanguageCode];
    
    NSLog(@"localeID: %@", localeID);
    NSLog(@"components: %@", components);
    NSLog(@"languageID: %@", languageID);
  2. yishus commented on May 10, 2016

    @yishus
    Author

    Thanks for your reply.

    iOS version: 9.3.1
    App running is localised for Chinese Traditional.

    Current language: zh-Hant-SG
    preferredLanguages: ["zh-Hant-SG", "en-SG"]
    localeID: zh-Hant_SG
    components: ["kCFLocaleCountryCodeKey": "SG", "kCFLocaleLanguageCodeKey": "zh", "kCFLocaleScriptCodeKey": "Hant"]
    languageID: zh
    

    I run into a problem when I try to send a push to a segment on the dashboard. If you see the image below
    screen shot 2016-05-10 at 3 12 56 pm

    The device is appearing under the Chinese Simplified segment when it should be in Chinese Traditional.

  3. yishus commented on Jun 23, 2016

    @yishus
    Author

    @jamesstout any update on this?

  4. jamesstout commented on Jun 23, 2016

    @jamesstout
    Contributor

    Not really. Everything looked OK. I think we need a OneSignal dev to check what their server is doing.

    On 23 Jun 2016, at 11:35 AM, Yishu See notifications@github.com wrote:

    @jamesstout any update on this?

    —
    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub, or mute the thread.

  5. jkasten2 commented on Jun 24, 2016

    @jkasten2
    Contributor

    @yishus @jamesstout We just deployed a server side fix for this. "zh-Hant-SG" should be mapping to "zh-Hant" correctly now after you force kill your app and open it again.

  6. yishus commented on Jun 24, 2016

    @yishus
    Author

    @jkasten2 thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions