Localizations
You need to add localizations in multiple languages for the app :->
I'd be happy to translate the app in Dutch.
If you'd be interested in crowd-sourcing this in a peer-reviewed open-source friendly way, consider https://translatewiki.net/. They're mainly known as the translate hub for the web apps of Wikipedia and OpenStreetMap, and translate many other open-source projects as well. I have set up projects with TWN as developer before, and am also a translator there.
I'd be happy to help out, answer any questions you might have, and/or act as liasion for the foreseeable future.
I could help translate NNW into Italian
I could help translate NNW into French!
On Nov 28, 2020, at 05:30, damrtom [email protected] wrote:
I could help translate NNW into French!
Considering that the original version of NNW was entirely localized in French, I suspect a good chunk of the current app has strings that already have a match. There are also extensive glossaries that could help easy the work tremendously. For the record, it’s not that I “abandoned” localizing the app at some point. I offered repeatedly when it changed hands and never got any reply… And then it came back home and my understanding is that needed some work to be localizable again.
Corentin
When you start working on this I can help with Brazilian Portuguese.
I'd be happy to do Catalan
I could do Swedish.
I could help translate NNW into Chinese!
Count with me to translate it to Spanish 🙌🏻
I could help translate NNW into simplified Chinese and traditional Chinese
Current State
The codebase makes extensive use of NSLocalizedStrings, generally in the format of:
NSLocalizedString("Are you sure you want to delete the “%@” feed?", comment: "Feed delete text")
or, in SwiftUI:
Text("Are you sure you want to delete the “%@” feed?", comment: "Feed delete text")
With no changes to the above, a Localization Export would generate an en.xcloc file using the NSLocalizedString value as the key and English (development language) translation:
| Key | English | Comment |
|---|---|---|
| Are you sure you want to delete the “%@” feed? | Are you sure you want to delete the “%@” feed? | Feed delete text |
Further, all NSLocalizedStrings—just over 300 for the iOS target—would end up in a single Localizable.strings file.

Proposal
This proposal follows the principle that localization is not done at source, i.e., in code, but in *.strings—Internationalization of the codebase. This will result in a significant—though hopefully one-time changes—to the way localized strings are managed.
1. Keys
- Keys should be keys and not a mirror of the development language.
- This ensures that changes to the base translation don't affect the key. (If the base language is used as the key, and the base translation changes, all translations for the old key would need to be reapplied to the new key. With this approach, you can change the base translation without impacting the key or other language translations.)
- This makes it easier to spot non-localized strings at runtime.
- It removes English norms from the keys (grammar, punctuation).
- They should follow as consistent a format as possible:
<ui_element>.<ui_position>.<hyphen>-<separated>-<content>
Concretely, non-localized strings would display as keys, while localized strings would display translated:


In code, this approach would manifest as follows:
let addNewFolderTitle = NSLocalizedString("keyboard.command.new-folder", comment: "New Folder")
let localizedMenuText = NSLocalizedString("button.title.mark-all-as-read.%@", comment: "Mark All as Read in ”feed”. The variable name is the feed name.")
let title = NSString.localizedStringWithFormat(localizedMenuText as NSString, webFeed.nameForDisplay) as String
In *.strings:
/* New Folder */
"keyboard.command.new-folder" = "New Folder";
In xcloc:
| Key | English | French | Comment |
|---|---|---|---|
| button.title.mark-all-as-read.%@ | Mark All as Read in “%@” | Marquez tout comme lu dans “%@” | Mark All as Read in ”feed”. The variable name is the feed name. |
Important: with this approach, we will need to audit all strings, convert them to the above convention, and provide base (English) translations.
2. Comments
- All strings that require localization should be audited to ensure that their
commentclearly articulates the purpose and content in the development language — English. - All strings that require localization from here on must include a clear comment.
- Where strings have multiple variables, the comment must describe the ordering.
3. Organisation
As discussed above, all strings will end up in a single (per target) Localizable.strings file without changes.
For the main targets, this proposal suggests (though it is not required) taking an active approach and defining where our strings will live based on the screen/major feature in which they are being used:
Feeds.strings
Timeline.strings
Article.strings
Settings.strings
NSLocalizedString("alert.message.delete-feed.%@", tableName: "Feeds" comment: "Asks the user for confirmation that they wish to delete a folder. The variable provided is the feed name. In English, the message is: Are you sure you want to delete the “%@” feed?")
The only exclusion to this would be common strings, e.g., basic button titles like "Done", "Dismiss", or "Cancel". They can be included in a Shared.strings file and shared amongst the targets.
NSLocalizedString("button.title.done", tableName: "Shared" comment: "Button title: Done")
Text("button.title.done", table: "Shared", comment: "Button title: Done")
Extensions (Share, Widget, etc.) are small enough that their translations can be stored in their own Localizable.strings file.
Future Translations
We will need to be disciplined for each release to ensure that new strings are localized. The way I see this working is as follows:
Text("button.title.add-mastodon-user", table: "Settings", comment: "Add Mastodon User")- We do an Export Localization
- Add the Base Localization (English) and Import
- Before Release, Export again and translators update
es,frfiles (etc) - We import, test...
- ...and then we should be good to go.
Updates to Existing Translations
Updates to existing translations must be done in existing .strings files. Xcode will not overwrite existing translations on import.
Reference Materials
- Why Internationalize Your Code Base
- Apple — Internationalizing Your Code
- WWDC '22: Build Global Apps - Localization by Example
- WWDC '21: Streamline Your Localized Strings
- Metatext localizations
- Mastodon for iOS localizations
- Phrase — iOS Internationalization and Localization tutorial
- IceCubes for Mastodon
So @stuartbreckenridge, @vincode-io we have to follow this to contribute on NNW Localization? We just fork, add Lang.strings and create a PR?
@kevinm6 No decisions have been made yet on how we will be implementing localization.
A proof of concept is available on this branch.
It converts NetNewsWire (both iOS and macOS) to key-based strings and includes, for ease of a demo, both English (US/base) and English (UK). Adding a new language is done via the Project Inspector, which will automatically add the appropriate .strings resources for that language.
Translation can then be done via Export Localizations, and then an import of the language specific xcloc.
I seted up rss on my mum's phone so she can read NYT and the WSJ from China, I would be more than happy to help localize the app to Chinese both simplified and traditional.
Help translate to Chinese +1
Hi @stuartbreckenridge! Are there any guidelines to contribute with localization, so far?
@kevinm6 The guidelines are in the Technotes https://github.com/Ranchero-Software/NetNewsWire/blob/main/Technotes/Localization.md
@kevinm6 The guidelines are in the Technotes
https://github.com/Ranchero-Software/NetNewsWire/blob/main/Technotes/Localization.md
Oh, perfect! Thank you, @Jerry23011 , I didn't notice them.
@kevinm6 Are you planning on providing a localization?