CotEditor/CONTRIBUTING.md

123 lines
4.7 KiB
Markdown
Raw Normal View History

2014-12-02 11:38:31 +03:00
Contributing Guidelines
==========================
General Feedback
--------------------------
2016-10-11 22:15:32 +03:00
Create a new issue on our [Issues page](https://github.com/coteditor/CotEditor/issues). You can write your feedback either in English (recommended) or in Japanese.
2014-12-02 11:38:31 +03:00
Bug reports __must__ include your environment. You can generate a bug report template automatically in CotEditor selecting "Help" > "Create Bug Report…" in the menu.
Pull-Request
--------------------------
2016-10-25 01:01:49 +03:00
- Make a topic branch, instead of committing to the master or develop branch.
2014-12-02 11:38:31 +03:00
2014-12-02 11:48:05 +03:00
### General Code Improvements
2014-12-02 11:38:31 +03:00
2019-04-01 06:34:35 +03:00
Bug fixes and improvements are welcome. If you want to add a new feature or the change is huge, it's better at first to ask the team whether your idea will be accepted.
2014-12-02 11:38:31 +03:00
By adding code, please follow our coding style guide below.
2014-12-02 11:38:31 +03:00
### Localization
2022-01-31 09:34:09 +03:00
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.
2014-12-02 11:38:31 +03:00
2022-01-31 09:34:09 +03:00
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.
2014-12-02 11:38:31 +03:00
2016-10-07 14:24:28 +03:00
#### Good references for localization
By localization, use macOS standard terms. It might be helpful to study native Apple applications like TextEdit.app or System Preferences to know how Apple localizes terms in their apps.
2016-10-07 14:24:28 +03:00
2016-10-25 01:01:49 +03:00
Especially, follow the terms of the following applications.
2016-10-07 14:24:28 +03:00
- Menu item titles in TextEdit.app
- Find panel in Pages.app
- Some setting messages in ScriptEditor.app
2022-04-14 16:13:14 +03:00
We recommend to utilize [Apple Localization Terms Glossary for macOS](https://applelocalization.com/macos) by Kishikawa Katsumi to find macOS-friendly expressions.
2022-01-31 09:34:09 +03:00
You also need to take care of how Apple handles punctuation characters and symbols. Regarding quotation marks, they normally prefer the typographer's ones.
2016-10-11 22:15:32 +03:00
#### Submitting a new localization
2014-12-02 11:38:31 +03:00
Copy one of a whole .lproj directory and use it as a template. We recommend using `CotEditor/ja.lproj/` or `CotEditor/en-GB.lproj/` directory because they are always up-to-date and well organized.
2015-11-20 10:08:59 +03:00
Note that you don't need to localize the Unicode block names in the `Unicode.strings` file.
2014-12-02 11:38:31 +03:00
2019-04-01 06:34:35 +03:00
Continuous maintenance of the localization is highly recommended when providing a new localization. Please tell us if you can work with us. We'll call you every time before releasing a new version when we have new strings to be localized, so that you can keep all your localized strings up to date.
Currently, we already have maintainers for:
2016-10-11 22:15:32 +03:00
- Japanese
2016-10-11 22:15:32 +03:00
- Simplified Chinese
- Italian
- French
- Turkish
2022-01-30 16:12:12 +03:00
- English (UK)
2019-04-01 06:34:35 +03:00
#### Localization for App Store
CotEditor project is also asking for localization of description on the Mac App Store. We have a separate repository for it at [coteditor/Documents-for-AppStore](https://github.com/coteditor/Documents-for-AppStore).
2016-10-11 22:15:32 +03:00
2014-12-02 11:38:31 +03:00
### Syntax Styles
2016-10-11 22:15:32 +03:00
#### Adding a new bundled syntax style
2014-12-02 11:38:31 +03:00
2016-10-25 01:01:49 +03:00
Put just your new syntax style into `/CotEditor/syntaxes/` directory. You don't need to modify `SyntaxMap.json` file. It's generated automatically on the build.
2014-12-02 11:38:31 +03:00
The license for the bundled syntax styles should be "Same as CotEditor".
If the syntax language is relatively minor, we recommend you to distribute it as an additional syntax style by your own way, and just add a link to our [wiki page](https://github.com/coteditor/CotEditor/wiki/Additional-Syntax-Styles).
### Themes
2016-10-11 22:15:32 +03:00
We aren't accepting pull-requests adding bundled theme at the moment. You can distribute yours as an additional theme by your own way, and add a link to our [wiki page](https://github.com/coteditor/CotEditor/wiki/Additional-Themes).
2014-12-02 11:38:31 +03:00
### Graphics Resources
2022-04-14 16:13:14 +03:00
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.
2014-12-02 11:38:31 +03:00
Coding Style Guide
--------------------------
Please follow the style of the existing codes in CotEditor.
2016-10-07 14:24:28 +03:00
- Respect the existing coding style.
2014-12-02 11:38:31 +03:00
- Leave reasonable comments.
2016-08-01 13:50:35 +03:00
- Never omit `self`.
2016-10-11 22:15:32 +03:00
- Add `final` to classes by default.
2016-08-01 13:50:35 +03:00
- Insert a blank line after class/function statement line.
```Swift
/// say moof.
func moof() {
print("moof")
2014-12-02 11:38:31 +03:00
}
```
2016-08-01 13:50:35 +03:00
- Don't declare `@IBOutlet` properties with `!`.
```Swift
2016-10-07 14:24:28 +03:00
// OK
2016-08-01 13:50:35 +03:00
@IBOutlet private weak var button: NSButton?
// NG
@IBOutlet private weak var button: NSButton!
```
2016-10-11 22:15:32 +03:00
- Write `guard` statement in one-line if just return a simple value.
2016-08-01 13:50:35 +03:00
```Swift
2016-10-07 14:24:28 +03:00
// prefer
2016-08-01 13:50:35 +03:00
guard let foo = foo else { return nil }
// instead of
guard let foo = foo else {
return nil
}
2014-12-02 11:48:05 +03:00
```