【问题标题】:Localizing iPad applications本地化 iPad 应用程序
【发布时间】:2010-04-10 13:13:39
【问题描述】:

我正在创建一个 iPad 应用程序,我有一个 Localizable.strings 文件,它是英语和荷兰语:

English.lproj/Localizable.strings

"failed to copy file" = "Failed to copy file";
"failed to copy defaultFeeds.plist" = "Failed to copy defaultFeeds.plist form the application's bundle to the device's documents directory for this app. Please make sure the device has space available on the flash memory. Please push the home button, connect your device to iTunes and check how much space there is available. Remove things you don't need and try again. If the problem presists, please contact us. You can find our support page in the App Store in iTunes.";

Dutch.lproj/Localizable.strings

"failed to copy file" = "Bestand kopieëren mislukt";
"failed to copy defaultFeeds.plist" = "Het kopieëren van defaultFeeds.plist van de applicatiebundel naar de documenten map van het apperaat is mislukt. Ga alstublieft na of het apparaat ruimte heeft op het flash geheugen. Druk op de Home-knop, verbind het apparaat met iTunes en controleer hoeveel ruimte er beschikbaar is. Verwijder dingen die je niet nodig hebt en probeer het opnieuw. Als de problemen voortzetten, kunt u contact met ons opnemen. U kunt onze support-page vinden in de App Store in iTunes.";

当我注释掉错误检查时,我肯定会得到错误,我得到的是英文版本,尽管 iPhone 模拟器的语言设置为荷兰语:

// Copy defaultFeeds if run for the first time
    //if(![[NSFileManager defaultManager] fileExistsAtPath:FEEDS_PLIST_IN_CURRENT_APP_DIRECTORY_PATH]) {
        // if(!) is for handling errors
        //if(![[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] pathForResource:@"defaultFeeds" ofType:@"plist"] toPath:FEEDS_PLIST_IN_CURRENT_APP_DIRECTORY_PATH error:nil]) {
            UIAlertView *copyFailedAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"failed to copy file", @"failed to copy file") message:NSLocalizedString(@"failed to copy defaultFeeds.plist", @"failed to copy defaultFeeds.plist") delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
            [copyFailedAlertView show];
            [copyFailedAlertView release];
        //}
    //}

另外,调试器说:

There is no HW layout for this input mode, defaulting to US

谁能帮帮我?谢谢。

【问题讨论】:

    标签: iphone cocoa-touch localization ipad


    【解决方案1】:

    你是通过Xcode4接口创建Localizable.strings文件的吗?

    “旧式”命名(English.lproj、Dutch.lproj)已被标准格式(en.lproj、nl.lproj)取代。选择“Localizable.strings”文件和右侧的帮助 UI:

    看看这是否对你有任何改变。

    【讨论】:

      最近更新 更多