I\'ve created a UITableView
in Interface Builder using storyboards
. The UITableView
is setup with static cells
and a numb
Nothing wrong with the other answers but this one offers a non-programmatic solution that may be useful in situations where one has a small static table. The benefit is that one can organize the localizations using the storyboard. One may continue to export localizations from Xcode via XLIFF files. Xcode 9 also has several new tools to make localizations easier.
(original)
I had a similar requirement. I had a static table with static cells in my Main.storyboard(Base). To localize section titles using .string files e.g. Main.strings(German) just select the section in storyboard and note the Object ID
Afterwards go to your string file, in my case Main.strings(German) and insert the translation like:
"MLo-jM-tSN.headerTitle" = "Localized section title";
Note that -(NSString *)tableView:
titleForHeaderInSection:
is not called by UITableView if - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
is implemented in delegate of UITableView;