トップ «前の日記(2012-06-21) 最新 次の日記(2012-06-23)» 編集

Cocoa練習帳

iOS/iPhone/iPad/watchOS/tvOS/MacOSX/Android プログラミング, Objective-C, Cocoa, Swiftなど

2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|

2012-06-22 [iOS]多言語化(4)

今回も、『iPhoneアプリケーションプログラミング』で紹介されていた方法。Xcodeでibtoolを使った日本語Storyboar生成の方法だ。

「ビルドフェーズ」に「スクリプトを実行」を追加する。

target add_run_script

以前と同様、ja.lprojのMainStoryboard.stringsを日本語化する。

/* Class = "IBUITableViewController"; title = "Master"; ObjectID = "12"; */
"12.title" = "原盤";
 
/* Class = "IBUIViewController"; title = "Detail"; ObjectID = "21"; */
"21.title" = "詳細";
 
/* Class = "IBUINavigationItem"; title = "Detail"; ObjectID = "26"; */
"26.title" = "詳細";
 
/* Class = "IBUILabel"; text = "Detail view content goes here"; ObjectID = "27"; */
"27.text" = "詳細を表示";
 
/* Class = "IBUINavigationItem"; title = "Master"; ObjectID = "36"; */
"36.title" = "原盤";
 
/* Class = "IBUILabel"; text = "Title"; ObjectID = "phq-AM-6qj"; */
"phq-AM-6qj.text" = "表題";

スクリプトを記述。

script
ibtool --import-strings-file Homepwner/ja.lproj/MainStoryboard.strings --write Homepwner/ja.lproj/MainStoryboard.storyboard Homepwner/en.lproj/MainStoryboard.storyboard
exit 0

実行

storyboard
run

日本語化されている。


トップ «前の日記(2012-06-21) 最新 次の日記(2012-06-23)» 編集