[英]Missing languages on iOS simulator
當我運行應用程序時,我的iPhone / iPad模擬器僅給我6種語言選擇(英語,德語,日語,意大利語,西班牙語和匈牙利語)。 用Google搜索后,似乎應該至少有18種語言可供選擇。
我重新安裝了Xcode 4.3.1,並安裝了iOS 5.1模擬器,它具有相同的問題,相同的語言。
有誰知道這些語言的定義位置,以及為什么模擬器沒有所有可用選項? Google和Apple Dev論壇無濟於事。
這是屏幕截圖:
更新:我決定安裝稍舊的5.0模擬器(而不是5.1),並且每當我使用5.0模擬器時,我都擁有所有的語言。 如果我切換回5.1模擬器,我仍然只有上面的屏幕截圖中顯示的6種語言。
我認為您的模擬器安裝發生了一些問題,而不是蘋果刪除了語言。 如果將模擬器中的語言數量減少到只有6種,則是一個奇怪的選擇(只有12.5M左右的揚聲器)。
我還檢查了我的Xcode 4.3.3 / iPhone 5.1模擬器,並假設了全部語言。 可能值得嘗試重新安裝模擬器!
模擬器在“設置”應用中顯示的語言列表可在以下位置找到
/Applications/Xcode-4.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/PrivateFrameworks/Preferences.framework/GlobalPreferences.plist
。
它采用二進制格式,因此您需要將其復制到temp目錄中,並使用plutil -convert xml1 <file_name>
將其轉換為可以讀取的內容。 您可以檢查一下列表中是否缺少語言。
供參考,這是我的樣子
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AppleLanguages</key>
<array>
<string>en</string>
<string>fr</string>
<string>de</string>
<string>ja</string>
<string>nl</string>
<string>it</string>
<string>es</string>
<string>pt</string>
<string>pt-PT</string>
<string>da</string>
<string>fi</string>
<string>nb</string>
<string>sv</string>
<string>ko</string>
<string>zh-Hans</string>
<string>zh-Hant</string>
<string>ru</string>
<string>pl</string>
<string>tr</string>
<string>uk</string>
<string>ar</string>
<string>hr</string>
<string>cs</string>
<string>el</string>
<string>he</string>
<string>ro</string>
<string>sk</string>
<string>th</string>
<string>id</string>
<string>ms</string>
<string>en-GB</string>
<string>ca</string>
<string>hu</string>
<string>vi</string>
</array>
<key>AppleLocale</key>
<string>en_US</string>
</dict>
</plist>
根據位於同一問題中的名為idz的用戶發布的答案中的信息,我能夠弄清楚如何解決此問題。
我使用的是5.1,必須安裝以前版本的模擬器(5.0),然后從5.0找到語言目錄,並將其復制到5.1的正確位置,然后重新啟動iPhone模擬器。 以下是一些詳細步驟:
/Applications/Xcode-4.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/Preferences.framework/
English.lproj
。 復制您在此處找到的所有.lproj文件夾。 /Applications/Xcode-4.3.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/PrivateFrameworks/Preferences.framework/
Hardware -> Version -> 5.1
。 現在,當您選擇模擬器的語言時,您應該擁有從5.0文件夾復制過來的所有可用語言。 另外,有人說您可以通過簡單地卸載Xcode SDK並重新安裝它來解決此問題,但是我發現這種方法要快得多。
我為此提交了一個錯誤報告給Apple,一周后沒有任何反應。 我已將他們定向到此頁面以解決此問題,但是我仍然不確定這是如何發生的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.