zoukankan      html  css  js  c++  java
  • NSLocale

     
    1.创建本地化对象
    // 根据本地标识符创建本地化对象
    NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier"en_US"];
     
    2.获取系统本地化信息
     获取系统所有本地化标识符数组列表
    [NSLocale availableLocaleIdentifiers] ;
     
     
    3.获取当前系统设置语言的标识符
    [[NSLocale currentLocale] localeIdentifier];
     
     
    4.获取本地化对象的具体内容
    NSLocale *local = [NSLocale currentLocale];
    key值参见NSLocale Calendar Keys
     
     
    5.获取当前语言的排版方向和字符方向
    [NSLocale lineDirectionForLanguage:[[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode];
     
     
    6.获取用户的语言偏好设置列表,该列表对应于IOS中Setting>General>Language弹出的面板中的语言列表。
    [NSLocale preferredLanguages]
     
     
    7.监听用户本地化设置的消息
    [[NSNotificationCenter defaultCenter] addObserver:self                                         selectorselector(localChangedHandler                                             name:NSCurrentLocaleDidChangeNotification object:nil];
     
     
    8.以本地化方式获取国际化信息的显示名称
    NSLocale *curLocal = [[NSLocale alloc]initWithLocaleIdentifier"zh-Hans"] ;
  • 相关阅读:
    浮动 无刷新 div
    vidalia 更换浏览器代理
    vb 主动 点击 a
    Delphi 资料收集
    用Linux的iptables和Python模拟广域网
    框架资源
    div 边框
    Google App Engine
    mac 雪豹 10.6 五国
    Windows Azure Storage (3) Windows Azure Storage Service存储服务之Blob详解(中)
  • 原文地址:https://www.cnblogs.com/xiu619544553/p/5195018.html
Copyright © 2011-2022 走看看