0
iOS 11로 업그레이드하고 Xcode 버전을 9로 변경하면 문제가 발생합니다.
"버마어"언어를 선택하면 "설정"메뉴 텍스트가 번역되지 않지만 나머지 메뉴 텍스트는 버마어로 번역됩니다.
iOS 11의 현지화, 빠른 4
var TableArray = [["Home","Buy", "Watch Later"],["Notification","Settings","User Guide"]]
메뉴 텍스트는 테이블 뷰 셀에 배열로 배치됩니다.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: TableArray[indexPath.section][indexPath.row], for: indexPath) as UITableViewCell
cell.imageView?.image = menuIconImage[indexPath.section][indexPath.row]
cell.textLabel?.text = NSLocalizedString(TableArray[indexPath.section][indexPath.row], comment: "")
cell.textLabel?.font = UIFont(name: "Tharlon", size: 17)
cell.selectionStyle = UITableViewCellSelectionStyle.blue
tableView.rowHeight = 56.0;
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
prefs.setValue(false, forKey: "FLAG")
prefs.setValue(true, forKey: "DRAWER")
debugPrint("Click LogIn")
let cell = tableView.dequeueReusableCell(withIdentifier: TableArray[indexPath.section][indexPath.row], for: indexPath) as UITableViewCell
cell.imageView?.image = menuIconImage[indexPath.section][indexPath.row]
cell.textLabel?.font = UIFont(name: "Tharlon", size: 17)
cell.textLabel?.text = NSLocalizedString(TableArray[indexPath.section][indexPath.row], comment: "")
}
그러나 나는 모든 텍스트가 "버마어" "설정" 텍스트를 제외하고 변경 시도. 그래서, 테이블 함수 안에 다음 코드를 다시 추가하지만, 이 작동하지 않습니다.
if (cell.textLabel?.text == "Settings") {
cell.textLabel?.text = NSLocalizedString(TableArray[indexPath.section][indexPath.row], comment: "")
cell.textLabel?.font = UIFont(name: "Tharlon", size: 17)
}
는 사람이 나에게 제발 도와 드릴까요? 나는 지난 2 일 이래도 이것을위한 해결책을 찾고있다. :(