You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

iOS应用本地化:如何添加德语Localizable文件

如何为iOS项目添加德语Localizable文件

Hey there! Adding German localization to your iOS project is straightforward, and here are two reliable ways to do it based on your existing setup with English and French support:

方法1:通过Xcode本地化面板添加(推荐)

This is the most seamless way since you already have existing Localizable files:

  • Open your Xcode project and locate your existing Localizable.strings file in the project navigator.
  • Select the file, then open the Inspectors panel (click the rightmost icon in the top-right corner, or use the shortcut Cmd + Option + 0).
  • Scroll down to the Localization section, click the + button, and select German (de) from the dropdown menu.
  • Xcode will automatically create a de.lproj folder in your project and generate a German-specific Localizable.strings file inside it.
  • Open the German Localizable.strings file, then add your translated key-value pairs—make sure the keys match exactly with your English/French versions. For your example:
    "ReJoin Now" = "Jetzt wieder beitreten";
    

方法2:手动创建本地化文件

If you prefer a hands-on approach or run into issues with the first method:

  • Create a new Strings File in Xcode (go to File > New > File..., search for "Strings File", and name it Localizable.strings).
  • Right-click the new file and select Show in Finder.
  • In Finder, create a new folder named de.lproj (this naming is critical—iOS uses standard language codes like de for German, paired with .lproj to recognize localization folders).
  • Drag the new Localizable.strings file into the de.lproj folder, then switch back to Xcode and confirm the file is added to your project.
  • Edit the German Localizable.strings file with your translations, following the same key-value format as above.

验证本地化是否生效

To make sure everything works as expected:

  • Switch your simulator/device's system language to German, then run your app and check if the localized text appears.
  • Or test directly in code by forcing the German bundle (great for quick checks without changing system settings):
    if let germanBundlePath = Bundle.main.path(forResource: "de", ofType: "lproj"),
       let germanBundle = Bundle(path: germanBundlePath) {
        let testText = NSLocalizedString("ReJoin Now", bundle: germanBundle, value: "", comment: "")
        print(testText) // Should output your German translation
    }
    

内容的提问来源于stack exchange,提问作者Abhishek Sharma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 07:46:08