iOS小知识:info.plist 的国际化

5,309 阅读1分钟

小知识,大挑战!本文正在参与“程序员必备小知识”创作活动。

前言

国际化app相关的权限弹框

在这里插入图片描述

I info.plist 的国际化

1.1 实现步骤:

  1. 新建一个 .strings文件 叫做InfoPlist.strings(文件名必须是这个)

  2. 新建以后,点击右侧的 localized

在这里插入图片描述

  1. 关键步骤:点击info.plist右键选择open as source code 查看我们所要获取权限的原始 key

在这里插入图片描述

/* 
  InfoPlist.strings
  SWTextTool

  Created by mac on 2020/1/16.
  Copyright © 2020 KN. All rights reserved.
*/

"NSCameraUsageDescription" ="当前需要拍照来编辑功能,您是否允许打开相机?";

"NSPhotoLibraryAddUsageDescription" = "当前需要保存图片至相册,您是否允许?";

"NSPhotoLibraryUsageDescription"="当前功能需要访问您的相册来编辑功能,您是否允许打开相册?";


"NSMicrophoneUsageDescription" = "Allow this app to use your microphone for decibel detection and sound recording; audio is recorded locally only and is not sent to anyone, only for decibel detection and sound variation.";

1.2 案例:iOS APP 内的国际化切换

案例:登录界面切换中英文blog.csdn.net/z929118967/…

see also

更多资讯和服务请关注#小程序:iOS逆向,只为你呈现有价值的信息,专注于移动端技术研究领域。