Lena Bru
Lena Bru

Reputation: 13947

How to Localize sound files

I have sounds in my app, which are appropriate for different languages.

How can i load the correct file depending on locale without checking it manually ?

Upvotes: 0

Views: 493

Answers (2)

Rich
Rich

Reputation: 8202

You need to add the files to Xcode and then localize them in the right hand side panel:

Screen shot

You then have a list of localizations:

Screemn shot result

Then the bundle will pull out the correct file.

[[NSBundle mainBundle] pathForResource:@"audio" ofType:@"mp3"];

Upvotes: 2

fguchelaar
fguchelaar

Reputation: 4909

If you have properly localized the files in your project, then you'll 'automatically' get the correctly localized path by calling [[NSBundle mainBundle] pathForResource:resourcePath ofType:type];

Upvotes: 1

Related Questions