Skip to content

Commit

Permalink
Improve localization comments
Browse files Browse the repository at this point in the history
  • Loading branch information
1024jp committed Aug 1, 2023
1 parent 1495590 commit 6562b9d
Show file tree
Hide file tree
Showing 25 changed files with 73 additions and 53 deletions.
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ By adding code, please follow our coding style guide below.

### Localization

_2023-08-01: CotEditor project now gradually migrates the localization format to the strings catalog that is newly introduced in Xcode 15. We will update the localization policy when the migration has completely done._

Fixing/updating existing localizations is always welcome. The project team adds `FIXME:` tag as a comment in the localized strings files if there are updated strings to be localized.

If your localization makes the Autolayout destroy, try first making the sentence shorter. However, if it's impossible, then just tell us about it with a screenshot when you make a pull-request. We'll update the storyboard file to layout your localized terms correctly.
Expand All @@ -53,11 +55,10 @@ Especially, follow the terms of the following applications.
We recommend to utilize [Apple Localization Terms Glossary for macOS](https://applelocalization.com/macos) by Kishikawa Katsumi to find macOS-friendly expressions. This service enables us to search in the texts localized by Apple for macOS applications and frameworks.
You also need to take care of how Apple treats punctuation characters and symbols. For example, regarding quotation marks, they normally prefer the typographer's ones.


#### Submitting a new localization

Copy one of a whole .lproj directory and use it as a template. We recommend using `CotEditor/en-GB.lproj/` directory because they are always up-to-date.
Note that you don't need to localize the Unicode block names in the `UnicodeUnicode.strings` file.
Note that you don't need to localize the Unicode block names in the `UnicodeBlock.strings` file.

Continuous maintenance of the localization is highly recommended when providing a new localization. Please tell us if you also intend to be a localization maintainer when submitting a new localization. When we have new strings to be localized, we call the localization maintainers by creating an issue with the `@` mention on GitHub so that they can keep all their localized strings up to date.
Currently, we already have maintainers for:
Expand Down Expand Up @@ -98,6 +99,7 @@ We don't accept pull requests adding bundled themes at the moment. You can distr
We don't accept pull requests for image resources. [1024jp](https://github.com/1024jp) enjoys creating and brushing up the graphics ;). Please just point out on the Issues page if a graphic resource has some kind of mistake to be fixed.



Coding Style Guide
--------------------------

Expand Down
3 changes: 2 additions & 1 deletion CotEditor/Sources/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,8 @@ final class Document: NSDocument, AdditionalDocumentPreparing, EncodingHolder {
if self.isDocumentEdited {
let alert = NSAlert()
alert.messageText = String(localized: "The document has unsaved changes.")
alert.informativeText = String(localized: "Do you want to discard the changes and reopen the document using “\(fileEncoding.localizedName)”?")
alert.informativeText = String(localized: "Do you want to discard the changes and reopen the document using “\(fileEncoding.localizedName)”?",
comment: "%@ is an encoding name")
alert.addButton(withTitle: String(localized: "Cancel"))
alert.addButton(withTitle: String(localized: "Discard Changes"))
alert.buttons.last?.hasDestructiveAction = true
Expand Down
3 changes: 2 additions & 1 deletion CotEditor/Sources/DocumentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ final class DocumentViewController: NSSplitViewController, ThemeHolder, NSToolba
let canActivateShowInvisibles = !UserDefaults.standard.showsInvisible.isEmpty
item.toolTip = canActivateShowInvisibles
? nil
: String(localized: "To show invisible characters, set them in Settings")
: String(localized: "To show invisible characters, set them in the Appearance settings",
comment: "Tooltip for “Show Invisibles” menu item and toolbar item for when all invisible settings are disabled")
if canActivateShowInvisibles {
(item as? NSToolbarItem)?.toolTip = self.showsInvisibles
? String(localized: "Hide invisible characters")
Expand Down
3 changes: 2 additions & 1 deletion CotEditor/Sources/DocumentWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ final class DocumentWindowController: NSWindowController, NSWindowDelegate {

let dotView = DotView()
dotView.color = .tertiaryLabelColor
dotView.toolTip = String(localized: "Document has unsaved changes")
dotView.toolTip = String(localized: "Document has unsaved changes",
comment: "tooltip for the “edited” indicator in the window tab")
dotView.setContentHuggingPriority(.defaultHigh, for: .horizontal)
return dotView
}()
Expand Down
2 changes: 1 addition & 1 deletion CotEditor/Sources/FileEncoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct FileEncoding: Equatable {
let localizedName = String.localizedName(of: self.encoding)

return (self.encoding == .utf8 && self.withUTF8BOM)
? String(localized: "\(localizedName) with BOM", comment: "Unicode (UTF-8) with BOM")
? String(localized: "\(localizedName) with BOM", comment: "Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)")
: localizedName
}
}
Expand Down
6 changes: 3 additions & 3 deletions CotEditor/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "Zeilen nicht umbrechen";
"Wrap Lines" = "Zeilen umbrechen";

// Tooltip for "Show Invisibles" menu item and toolbar item
"To show invisible characters, set them in Settings" = "Um Steuerzeichen anzuzeigen, setze sie in den Einstellungen";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "Um Steuerzeichen anzuzeigen, setze sie in den Einstellungen „Asssehen“";



Expand Down Expand Up @@ -840,7 +840,7 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@ mit BOM";


Expand Down
4 changes: 3 additions & 1 deletion CotEditor/de.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "Keilschrift";
Expand Down
6 changes: 3 additions & 3 deletions CotEditor/en-GB.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "Unwrap Lines";
"Wrap Lines" = "Wrap Lines";

// Tooltip for "Show Invisibles" menu item
"To show invisible characters, set them in Settings" = "To show invisible characters, set them in Settings";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "To show invisible characters, set them in the Appearance settings";



Expand Down Expand Up @@ -840,7 +840,7 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@ with BOM";


Expand Down
5 changes: 3 additions & 2 deletions CotEditor/en-GB.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// release date of the used grossary: 2020-01-15
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "Cuneiform";
Expand Down
6 changes: 3 additions & 3 deletions CotEditor/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "No ajustar líneas";
"Wrap Lines" = "Ajustar líneas";

// Tooltip for "Show Invisibles" menu item
"To show invisible characters, set them in Settings" = "Para mostrar caracteres invisibles, configúralos en ajustes";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "Para mostrar caracteres invisibles, configúralos en ajustes"; // FIXME: Setting -> the Appearance Settings



Expand Down Expand Up @@ -840,7 +840,7 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@ con BOM";


Expand Down
5 changes: 3 additions & 2 deletions CotEditor/es.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// release date of the used grossary: 2020-01-15
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "Cuneiforme";
Expand Down
6 changes: 3 additions & 3 deletions CotEditor/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "Ne pas renvoyer à la ligne";
"Wrap Lines" = "Renvoyer à la ligne";

// Tooltip for "Show Invisibles" menu item and toolbar item
"To show invisible characters, set them in Settings" = "Pour afficher les caractères invisibles, activez l’option dans les Réglages";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "Pour afficher les caractères invisibles, activez l’option dans les Réglages"; // FIXME: Setting -> the Appearance Settings



Expand Down Expand Up @@ -840,7 +840,7 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@ avec BOM";


Expand Down
4 changes: 3 additions & 1 deletion CotEditor/fr.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "Cunéiforme";
Expand Down
6 changes: 3 additions & 3 deletions CotEditor/it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "Rimuovi a capo automatico";
"Wrap Lines" = "A capo automatico";

// Tooltip for "Show Invisibles" menu item and toolbar item
"To show invisible characters, set them in Settings" = "Per visualizzare i caratteri invisibili, impostarli nelle Impostazioni";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "Per visualizzare i caratteri invisibili, impostarli nelle Impostazioni"; // FIXME: Setting -> the Appearance Settings



Expand Down Expand Up @@ -840,7 +840,7 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@ con BOM";


Expand Down
5 changes: 3 additions & 2 deletions CotEditor/it.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
// limitations under the License.
//

// Unicode block names
// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "Cuneiforme";
Expand Down
6 changes: 3 additions & 3 deletions CotEditor/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "行を折り返さない";
"Wrap Lines" = "行を折り返す";

// Tooltip for "Show Invisibles" menu item
"To show invisible characters, set them in Settings" = "不可視文字を表示させるには設定を変更してください";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "不可視文字を表示させるには「表示」設定で設定を変更してください";



Expand Down Expand Up @@ -840,7 +840,7 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@BOM付き";


Expand Down
5 changes: 3 additions & 2 deletions CotEditor/ja.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// release date of the used grossary: 2020-01-15
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "楔形文字";
Expand Down
6 changes: 3 additions & 3 deletions CotEditor/pt.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "Desajustar Linhas";
"Wrap Lines" = "Ajustar Linhas";

// Tooltip for "Show Invisibles" menu item and toolbar item
"To show invisible characters, set them in Settings" = "Para mostrar invisíveis, ative-os nas Definições";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "Para mostrar invisíveis, ative-os nas Definições"; // FIXME: Setting -> the Appearance Settings



Expand Down Expand Up @@ -840,7 +840,7 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@ com BOM";


Expand Down
4 changes: 3 additions & 1 deletion CotEditor/pt.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "Cuneiforme";
Expand Down
6 changes: 3 additions & 3 deletions CotEditor/tr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "Satırları Kaydırma";
"Wrap Lines" = "Satırları Kaydır";

// Tooltip for "Show Invisibles" menu item
"To show invisible characters, set them in Settings" = "Görünmez karakterleri göstermek için ilgili ayarı Ayarlar’dan değiştirin";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "Görünmez karakterleri göstermek için ilgili ayarı Ayarlar’dan değiştirin"; // FIXME: Setting -> the Appearance Settings



Expand Down Expand Up @@ -840,7 +840,7 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "BOM ile %@";


Expand Down
5 changes: 3 additions & 2 deletions CotEditor/tr.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// release date of the used grossary: 2020-01-15
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "Çivi Yazısı";
Expand Down
8 changes: 4 additions & 4 deletions CotEditor/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "不换行";
"Wrap Lines" = "换行";

// Tooltip for "Show Invisibles" menu item and toolbar item
"To show invisible characters, set them in Settings" = "要显示不可见元素,请在设置中进行设定";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "要显示不可见元素,请在设置中进行设定"; // FIXME: Setting -> the Appearance Settings



Expand Down Expand Up @@ -840,8 +840,8 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
"%@ with BOM" = "%@ with BOM"; // No need to be tranlated because "UTF-8 with BOM" is acceptable in zh-Hans.
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@ with BOM"; // No need to be translated because "UTF-8 with BOM" is acceptable in zh-Hans.



Expand Down
4 changes: 3 additions & 1 deletion CotEditor/zh-Hans.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "楔形文字";
Expand Down
8 changes: 4 additions & 4 deletions CotEditor/zh-Hant.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@
"Unwrap Lines" = "不換行";
"Wrap Lines" = "換行";

// Tooltip for "Show Invisibles" menu item and toolbar item
"To show invisible characters, set them in Settings" = "要顯示不可見元素,請在設定中進行設定";
// Tooltip for Show Invisibles menu item and toolbar item for when all invisible settings are disabled
"To show invisible characters, set them in the Appearance settings" = "要顯示不可見元素,請在設定中進行設定"; // FIXME: Setting -> the Appearance Settings



Expand Down Expand Up @@ -840,8 +840,8 @@


/* MARK: String extension */
// Encoding name for UTF-8 with BOM (`%@` is the system localized name for UTF-8)
"%@ with BOM" = "%@ with BOM"; // No need to be tranlated because "UTF-8 with BOM" is acceptable in zh-Hans.
// Encoding name for UTF-8 with BOM (%@ is the system localized name for UTF-8)
"%@ with BOM" = "%@ with BOM"; // No need to be translated because "UTF-8 with BOM" is acceptable in zh-Hans.



Expand Down
4 changes: 3 additions & 1 deletion CotEditor/zh-Hant.lproj/UnicodeBlock.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
// limitations under the License.
//

// -> auto-generated from CharacterPaletteIM.lg in Apple's glossaries
// -> You don't need to translate the terms in this file
// since they are auto-generated from CharacterPaletteIM.lg in the Apple's glossaries.
// release date of the used glossary: 2020-01-15
// cf. <https://developer.apple.com/download/all/?q=glossaries>

"Cuneiform" = "楔形文字";
Expand Down

0 comments on commit 6562b9d

Please sign in to comment.