mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge remote branch 'origin/master' into translation-staging
This commit is contained in:
commit
06cf3c6d40
@ -8,6 +8,14 @@ Requires a [`silverstripe-installer`](http://github.com/silverstripe/silverstrip
|
||||
See [installation on different platforms](http://doc.silverstripe.org/framework/en/installation/),
|
||||
and [installation from source](http://doc.silverstripe.org/framework/en/installation/from-source).
|
||||
|
||||
## Development and contribution ##
|
||||
|
||||
If you would like to make changes to SilverStripe core product, we have an extensive [guide to contributing code](http://doc.silverstripe.org/framework/en/misc/contributing/code) that we invite you to look at before submitting a pull request.
|
||||
|
||||
If you would like to get involved, but don't know what to fix, the [Trac tickets](http://open.silverstripe.org/report/125) are a good place to start.
|
||||
|
||||
For other ways to contribute, see the [code contribution guidelines](http://doc.silverstripe.org/framework/en/misc/contributing)
|
||||
|
||||
## Links ##
|
||||
|
||||
* [Requirements](http://doc.silverstripe.org/framework/en/installation/server-requirements)
|
||||
|
@ -62,7 +62,7 @@ allows us to build complex layouts with minimal JavaScript configuration.
|
||||
## Include custom CSS in the CMS
|
||||
|
||||
In order to show the links in one line, we'll add some CSS, and get it to load with the CMS interface.
|
||||
Paste the following content into a new file called `zzz_mysite/css/BookmarkedPages.css`:
|
||||
Paste the following content into a new file called `zzz_admin/css/BookmarkedPages.css`:
|
||||
|
||||
:::css
|
||||
.cms-bottom-bar {height: 20px; padding: 5px; background: #C6D7DF;}
|
||||
@ -74,7 +74,7 @@ Load the new CSS file into the CMS, by adding the following line to `zzz_admin/_
|
||||
|
||||
:::php
|
||||
<?php
|
||||
LeftAndMain::require_css('zzz_admin/css/CMSBookmarkBar.css');
|
||||
LeftAndMain::require_css('zzz_admin/css/BookmarkedPages.css');
|
||||
|
||||
## Create a "bookmark" flag on pages ##
|
||||
|
||||
@ -130,7 +130,7 @@ and replace it with the following:
|
||||
:::ss
|
||||
<ul>
|
||||
<% loop BookmarkedPages %>
|
||||
<li><a href="admin/page/edit/show/$ID">Edit "$Title"</a></li>
|
||||
<li><a href="admin/pages/edit/show/$ID">Edit "$Title"</a></li>
|
||||
<% end_loop %>
|
||||
</ul>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
This website documents high-level features of the [SilverStripe open source platform](http://www.silverstripe.org), aimed
|
||||
at developers.
|
||||
Please read our [guide to contributing documentation](misc/contributing#writing-documentation) if you want to help out!
|
||||
Please read our [guide to contributing documentation](misc/contributing/documentation) if you want to help out!
|
||||
|
||||
### Overview
|
||||
|
||||
@ -54,7 +54,7 @@ Please read our [guide to contributing documentation](misc/contributing#writing-
|
||||
|
||||
### Level 4: Contributing to the SilverStripe core
|
||||
|
||||
* [Contributing](http://www.silverstripe.org/contributing-to-silverstripe/)
|
||||
* [Contributing](misc/contributing)
|
||||
* [Coding Conventions](misc/coding-conventions)
|
||||
|
||||
<div class="hint" markdown="1">
|
||||
|
@ -1,149 +0,0 @@
|
||||
# Git Contributors Guide
|
||||
|
||||
If you're a developer who wants to work on the SilverStripe source code and submit your changes for consideration to be merged into the master branch, here's how.
|
||||
In case you're after a general overview on how you can contribute to SilverStripe, see our "[Contributing](contributing)" guide.
|
||||
|
||||
## Quickfire Do's and Don't's
|
||||
|
||||
If you aren't familiar with git and GitHub, try reading the ["GitHub bootcamp documentation"](http://help.github.com/).
|
||||
We also found the [free online git book](http://progit.org/book/) and the [git crash course](http://gitref.org/) useful.
|
||||
If you're familiar with it, here's the short version of what you need to know. Once you fork and download the code:
|
||||
|
||||
* **Don't develop on the master branch.** Always create a development branch specific to "the issue" you're working on (mostly on [open.silverstripe.org](http://open.silverstripe.org)). Name it by issue number and description. For example, if you're working on Issue #100, a `DataObject::get_one()` bugfix, your development branch should be called 100-dataobject-get-one. If you decide to work on another issue mid-stream, create a new branch for that issue--don't work on both in one branch.
|
||||
|
||||
* **Do not merge** the upstream master with your development branch; *rebase* your branch on top of the upstream master.
|
||||
|
||||
* **A single development branch should represent changes related to a single issue.** If you decide to work on another issue, create another branch.
|
||||
|
||||
* **Squash your commits.** After you rebase your work on top of the upstream master, you can squash multiple commits into one. Say, for instance, you've got three commits in related to Issue #100. Squash all three into one with the message "Issue #100 Description of the issue here." We won't accept pull requests for multiple commits related to a single issue; it's up to you to squash and clean your commit tree. (Remember, if you squash commits you've already pushed to GitHub, you won't be able to push that same branch again. Create a new local branch, squash, and push the new squashed branch.)
|
||||
|
||||
## Workflow Diagram ##
|
||||
|
||||
![Workflow diagram](http://www.silverstripe.org/assets/doc-silverstripe-org/collaboration-on-github.png)
|
||||
|
||||
## Step-by-step: From forking to sending the pull request
|
||||
|
||||
1. Follow the ["Installing from source"](../installation/from-source) ("Option 2: Installation for contributions"),
|
||||
which explains how to fork the core modules and add the correct "upstream" remote
|
||||
1. Branch for new issue (<code>$ git branch ###-description; git checkout ###-description</code>) and develop on issue branch. _As time passes, the upstream repository accumulates new commits. Keep your working copy's master branch and issue branch up to date by periodically rebasing: fetch upstream, rebase master, rebase issue branch (<code>$ git fetch upstream; git checkout master; git rebase upstream/master; git checkout ###-description; git rebase master</code>)_
|
||||
1. When development is complete, rebase one more time, then branch from dev branch to release candidate branch (<code>$ git checkout ###-description; git branch ###-description-rc; git checkout ###-description-rc</code>). Squash all _X_ commits that pertain to the issue into one clean, descriptive commit (<code>$ git rebase -i HEAD~X</code>)
|
||||
1. Push release candidate branch to GitHub (<code>$ git push origin ###-description-rc</code>)
|
||||
1. Issue pull request on GitHub (Click Pull Request button)
|
||||
|
||||
## Create an Issue-Specific Development Branch
|
||||
|
||||
Before you start working on a new feature or bugfix, create a new branch dedicated to that one change named by issue number and description. If you're working on Issue #100, a retweet bugfix, create a new branch with the issue number and description, like this:
|
||||
|
||||
$ git branch 100-dataobject-get-one
|
||||
$ git checkout 100-dataobject-get-one
|
||||
|
||||
Edit and test the files on your development environment. When you've got something the way you want and established that it works, commit the changes to your branch on your local git repo.
|
||||
|
||||
$ git add <filename>
|
||||
$ git commit -m 'Issue #100: Some kind of descriptive message'
|
||||
|
||||
You'll need to use git add for each file that you created or modified. There are ways to add multiple files, but I highly recommend a more deliberate approach unless you know what you're doing.
|
||||
|
||||
Then, you can push your new branch to GitHub, like this (replace `100-dataobject-get-one` with your branch name):
|
||||
|
||||
$ git push origin 100-dataobject-get-one
|
||||
|
||||
You should be able to log into your GitHub account, switch to the branch, and see that your changes have been committed. Then click the Pull button to request that your commits get merged into the development master.
|
||||
|
||||
*IMPORTANT*: Before you issue a pull request, make sure it gets accepted by running through the ["Contributing Check List"](contributing#check-list).
|
||||
|
||||
## Rebase Your Development Branch on the Latest Upstream
|
||||
|
||||
To keep your development branch up to date, rebase your changes on top of the current state of the upstream master. See the *What's git-rebase?* section below to learn more about rebasing.
|
||||
|
||||
If you've set up an upstream branch as detailed above, and a development branch called `100-dataobject-get-one`, you'd update `upstream`, update your local master, and rebase your branch from it like so:
|
||||
|
||||
$ git fetch upstream
|
||||
$ git checkout master
|
||||
$ git rebase upstream/master
|
||||
$ git checkout 100-dataobject-get-one
|
||||
# [make sure all is committed as necessary in branch]
|
||||
$ git rebase master
|
||||
|
||||
You may need to resolve conflicts that occur when a file on the development trunk and one of your files have both been changed. Edit each file to resolve the differences, then commit the fixes to your development server repo and test. Each file will need to be "added" before running a "commit."
|
||||
|
||||
Conflicts are clearly marked in the code files. Make sure to take time in determining what version of the conflict you want to keep and what you want to discard.
|
||||
|
||||
$ git add <filename>
|
||||
$ git commit
|
||||
|
||||
To push the updates to your GitHub repo, replace 100-dataobject-get-one with your branch name and run:
|
||||
|
||||
$ git push origin 100-dataobject-get-one
|
||||
|
||||
## Squash All Commits Related to a Single Issue into a Single Commit
|
||||
|
||||
Once you have rebased your work on top of the latest state of the upstream master, you may have several commits related to the issue you were working on. Once everything is done, squash them into a single commit with a descriptive message (see ["Contributing: Commit Messages"](contributing#commit-messages)).
|
||||
|
||||
To squash four commits into one, do the following:
|
||||
|
||||
$ git rebase -i HEAD~4
|
||||
|
||||
In the text editor that comes up, replace the words "pick" with "squash" next to the commits you want to squash into the commit before it. Save and close the editor, and git will combine the "squash"'ed commits with the one before it. Git will then give you the opportunity to change your commit message to something like, "BUGFIX Issue #100: Fixed DataObject::get_one() parameter order"
|
||||
|
||||
Important: If you've already pushed commits to GitHub, and then squash them locally, you will not be able to push that same branch to GitHub again. Create a new branch--like 100-dataobject-get-one-squashed or 100-dataobject-get-one-rc1 (for "release candidate 1") - and squash your commits there. Once everything is squashed and ready, push the new squashed branch to GitHub and send your pull request to Gina.
|
||||
|
||||
Helpful hint: You can always edit your last commit message by using:
|
||||
|
||||
$ git commit --amend
|
||||
|
||||
## Some gotchas
|
||||
|
||||
Be careful not to commit any of your configuration files, logs, or throwaway test files to your GitHub repo. These files can contain information you wouldn't want publicly viewable and they will make it impossible to merge your contributions into the main development trunk.
|
||||
|
||||
Most of these special files are listed in the <code>.gitignore</code> file and won't be included in any commit, but you should carefully review the files you have modified and added before staging them and committing them to your repo. The git status command will display detailed information about any new files, modifications and staged.
|
||||
|
||||
$ git status
|
||||
|
||||
One thing you do not want to do is to issue a git commit with the -a option. This automatically stages and commits every modified file that's not expressly defined in .gitignore, including your crawler logs.
|
||||
|
||||
$ git commit -a
|
||||
|
||||
## What's git-rebase?
|
||||
|
||||
Using <code>git-rebase</code> helps create clean commit trees and makes keeping your code up-to-date with the current state of the upstream master easy. Here's how it works.
|
||||
|
||||
Let's say you're working on Issue #212 a new plugin in your own branch and you start with something like this:
|
||||
|
||||
1---2---3 #212-my-new-plugin
|
||||
/
|
||||
A---B #master
|
||||
|
||||
You keep coding for a few days and then pull the latest upstream stuff and you end up like this:
|
||||
|
||||
1---2---3 #212-my-new-plugin
|
||||
/
|
||||
A---B--C--D--E--F #master
|
||||
|
||||
So all these new things (C,D,..F) have happened since you started. Normally you would just keep going (let's say you're not finished with the plugin yet) and then deal with a merge later on, which becomes a commit, which get moved upstream and ends up grafted on the tree forever.
|
||||
|
||||
A cleaner way to do this is to use rebase to essentially rewrite your commits as if you had started at point F instead of point B. So just do:
|
||||
|
||||
git rebase master 212-my-new-plugin
|
||||
|
||||
git will rewrite your commits like this:
|
||||
|
||||
1---2---3 #212-my-new-plugin
|
||||
/
|
||||
A---B--C--D--E--F #master
|
||||
|
||||
It's as if you had just started your branch. One immediate advantage you get is that you can test your branch now to see if C, D, E, or F had any impact on your code (you don't need to wait until you're finished with your plugin and merge to find this out). And, since you can keep doing this over and over again as you develop your plugin, at the end your merge will just be a fast-forward (in other words no merge at all).
|
||||
|
||||
So when you're ready to send the new plugin upstream, you do one last rebase, test, and then merge (which is really no merge at all) and send out your pull request. Then in most cases, we have a simple fast-forward on our end (or at worst a very small rebase or merge) and over time that adds up to a simpler tree.
|
||||
|
||||
More info on the ["Rebasing" chapter on progit.org](http://progit.org/book/ch3-6.html) and the [git rebase man page](http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html).
|
||||
|
||||
## Related
|
||||
|
||||
* [Contributing: Submitting patches](/misc/contributing)
|
||||
* [Installation: From Source](/installation/from-source)
|
||||
|
||||
## License
|
||||
|
||||
This guide has been adapted from the ["Thinkup" developer guide](https://github.com/ginatrapani/ThinkUp/wiki/Developer-Guide%3A-Get-the-Source-Code-from-GitHub-and-Keep-It-Updated),
|
||||
with friendly permission from Gina Trapani/[thinkupapp.com](http://thinkupapp.com).
|
@ -1,287 +0,0 @@
|
||||
# Contributing
|
||||
|
||||
Any open source product is only as good as the community behind it. You can participate by sharing
|
||||
code, ideas, or simply helping others. No matter what your skill level is, every contribution counts.
|
||||
|
||||
See our [high level overview on silverstripe.org](http://silverstripe.org/contributing-to-silverstripe) on how you can help out.
|
||||
|
||||
## Sharing your Opinion
|
||||
|
||||
* [silverstripe.org/forums](http://silverstripe.org/forums): Forums on silverstripe.org
|
||||
* [silverstripe-dev](http://groups.google.com/group/silverstripe-dev): Core development mailinglist
|
||||
* [silverstripe-documentation](http://groups.google.com/group/silverstripe-documentation): Documentation team mailing list
|
||||
|
||||
## Reporting Bugs
|
||||
|
||||
If you have discovered a bug in SilverStripe, we'd be glad to hear about it -
|
||||
well written bug reports can be half of the solution already!
|
||||
Our bugtracker is located on [open.silverstripe.org](http://open.silverstripe.org/) (create a [new ticket](http://open.silverstripe.org/newticket)).
|
||||
|
||||
## Submiting Bugfixes and Enhancements
|
||||
|
||||
We're not perfect, and need your help - for example in the form of patches for our modules and core codebase.
|
||||
|
||||
### Setup your project for contributions
|
||||
|
||||
In contrast to running a SilverStripe website, you can't use the standard download archive for this purpose.
|
||||
The ["Installing from source"](../installation/from-source) guide explains how to get started.
|
||||
For other modules, our [module list on silverstripe.org](http://silverstripe.org/modules) lists the repository locations,
|
||||
typically using a version control system like "git" or "[subversion](subversion)".
|
||||
|
||||
### Check List
|
||||
|
||||
* Adhere to our [coding conventions](coding-conventions)
|
||||
* If your patch is extensive, discuss it first on the [silverstripe forum](http///www.silverstripe.org/forums/) (ideally before doing any serious coding)
|
||||
* When working on existing tickets, assign them to you and provide status updates through ticket comments
|
||||
* Check your patches against the latest "trunk" or "master", as well as the latest release.
|
||||
Please not that the latest stable release will often not be sufficient! (of all modules)
|
||||
* Provide complete [unit test coverage](/topics/testing) - depending on the complexity of your work, this is a required
|
||||
step.
|
||||
* Do not set milestones. If you think your patch should be looked at with priority, mark it as "critical".
|
||||
* Describe specifics on how to test the effects of the patch
|
||||
* It's better to submit multiple patches with separate bits of functionality than a big patch containing lots of
|
||||
changes
|
||||
* Document your code inline through [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) syntax. See our
|
||||
[API documentation](http://api.silverstripe.org/trunk) for good examples.
|
||||
* Also check and update documentation on [doc.silverstripe.org](http://doc.silverstripe.org). Check for any references to functionality deprecated or extended through your patch. Documentation changes should be included in the patch.
|
||||
* We will attribute the change to you whereever possible (git does this automatically for pull requests)
|
||||
* If you get stuck, please post to the [forum](http://silverstripe.org/forum) or for deeper core problems, to the [core mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)
|
||||
* When working with the CMS, please read the ["CMS Architecture Guide"](/reference/cms-architecture) first
|
||||
|
||||
The core team is responsible for reviewing patches and deciding if they will make it into core. If
|
||||
there are any problems they will follow up with you, so please ensure they have a way to contact you!
|
||||
|
||||
### Sending git pull requests
|
||||
|
||||
The SilverStripe core modules (`framework` and `cms`), as well as some of the more popular modules are in
|
||||
git version control. SilverStripe hosts its modules on [github.com/silverstripe](http://github.com/silverstripe) and [github.com/silverstripe-labs](http://github.com/silverstripe-labs).
|
||||
After [installing git](http://help.github.com/git-installation-redirect) and creating a [free github.com account](https://github.com/signup/free), you can "fork" a module,
|
||||
which creates a copy that you can commit to (see github's [guide to "forking"](http://help.github.com/forking/)).
|
||||
|
||||
Now you have two choices: Smaller fixes (e.g. typos) can be edited directly in the github.com web interface
|
||||
(every file view has an "edit this file" link). More commonly, you will deal with a working copy on your own computer. After committing your fix, you can send the module authors a so called ["pull request"](http://help.github.com/pull-requests/).
|
||||
The module authors will get notified automatically, review your patch, and merge it back as appropriate.
|
||||
For new features, we recommend creating a ["feature branch"](http://progit.org/book/ch3-3.html) rather than a really big patch.
|
||||
Note that we no longer accept patch file attachments ("diffs") as commonly created through subversion.
|
||||
|
||||
It is important that you use git branching properly in order to avoid messy and time-consuming merges
|
||||
later on, so please read our in-depth ["Collaboration on Git"](collaboration-on-git) guide.
|
||||
If you want to learn more about git, please have a look at the [free online git book](http://progit.org/book/) and the [git crash course](http://gitref.org/).
|
||||
|
||||
### Commit Messages
|
||||
|
||||
We try to maintain a consistent record of descriptive commit messages.
|
||||
Most importantly: Keep the first line short, and add more detail below.
|
||||
This ensures commits are easy to browse, and look nice on github.com
|
||||
(more info about [proper git commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)).
|
||||
|
||||
As we automatically generate [changelogs](http://doc.silverstripe.org/sapphire/en/trunk/changelogs/) from them, we need a way to categorize and filter.
|
||||
Please prefix **noteworthy** commit messages with one of the following tags:
|
||||
|
||||
* `NEW`: New feature or major enhancement (both for users and developers)
|
||||
* `API`: Addition of a new API, or modification/removal/deprecation of an existing API.
|
||||
Includes any change developers should be aware of when upgrading.
|
||||
* `BUG`: Bugfix or minor enhancement on something developers or users are likely to encounter.
|
||||
|
||||
All other commits should not be tagged if they are so trivial that most developers
|
||||
can ignore them during upgrades or when reviewing changes to the codebase.
|
||||
For example, adding unit tests or documentation would not be considered "noteworthy".
|
||||
Same goes for version control plumbing like merges, file renames or reverts.
|
||||
|
||||
Further guidelines:
|
||||
|
||||
* Each commit should form a logical unit - if you fix two unrelated bugs, commit each one separately
|
||||
* If you are fixing a ticket from our [bugtracker](http://open.silverstripe.com), please append `(fixes #<ticketnumber>)`
|
||||
* If your change is related to another commit, reference it with its abbreviated commit hash.
|
||||
* Mention important changed classes and methods in the commit summary.
|
||||
|
||||
Example: Bad commit message
|
||||
|
||||
finally fixed this dumb rendering bug that Joe talked about ... LOL
|
||||
also added another form field for password validation
|
||||
|
||||
Example: Good commit message
|
||||
|
||||
BUG Formatting through prepValueForDB()
|
||||
|
||||
Added prepValueForDB() which is called on DBField->writeToManipulation()
|
||||
to ensure formatting of value before insertion to DB on a per-DBField type basis (fixes #1234).
|
||||
Added documentation for DBField->writeToManipulation() (related to a4bd42fd).
|
||||
|
||||
<div class="hint" markdown="1">
|
||||
Note: By supplying code in patches, tickets and pull requests,
|
||||
you agree that is can be used in distributions and derivative works of SilverStripe CMS and associated modules, under the BSD license.
|
||||
</div>
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
Report security issues to [security@silverstripe.com](mailto:security@silverstripe.com). See our "[Release Process](release-process)" documentation for more info, and read our guide on [how to write secure code](/topics/security).
|
||||
|
||||
## Writing Documentation
|
||||
|
||||
Documentation for a software project is a continued and collaborative effort,
|
||||
we encourage everybody to contribute, from simply fixing spelling mistakes, to writing recipes/howtos,
|
||||
reviewing existing documentation, and translating the whole thing.
|
||||
|
||||
Modifying documentation requires basic [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) and
|
||||
[Markdown](http://daringfireball.net/projects/markdown/)/[SSMarkdown](ss-markdown) knowledge,
|
||||
and a GitHub user account.
|
||||
|
||||
### Editing online
|
||||
|
||||
The easiest way of making a change the the documentation is to find the appropriate .md
|
||||
file in the [github.com/silverstripe/sapphire](https://github.com/silverstripe/sapphire/edit/3.0/docs/) repository
|
||||
and press the "edit" button. You will need a GitHub account to do this.
|
||||
|
||||
* After you have made your change, describe it in the "commit summary" and "extended description" fields below, and press "Commit Changes".
|
||||
* After that you will see form to submit a Pull Request. You should just be able to submit the form, and your changes will be sent to the core team for approval.
|
||||
|
||||
**Coming soon:** each documentation page will have an "edit" link, to make it easier for you to find this feature.
|
||||
|
||||
### Editing on your computer
|
||||
|
||||
If you prefer to edit the content on your local machine, you can "[fork](http://help.github.com/forking/)"
|
||||
the [github.com/silverstripe/sapphire](http://github.com/silverstripe/sapphire)
|
||||
and [github.com/silverstripe/silverstripe-cms](http://github.com/silverstripe/silverstripe-cms)
|
||||
repositories and send us "[pull requests](http://help.github.com/pull-requests/)". If you have
|
||||
downloaded SilverStripe or a module, chances are that you already have these checkouts.
|
||||
|
||||
The documentation is kept alongside the source code in the `docs/` subfolder.
|
||||
|
||||
**Note:** If you submit a new feature or an API change, we strongly recommend that your patch
|
||||
includes updates to the necessary documentation. This helps prevent our documentation from
|
||||
getting out of date.
|
||||
|
||||
### Repositories
|
||||
|
||||
* End-user: [userhelp.silverstripe.org](http://userhelp.silverstripe.org) - a custom SilverStripe project (not open sourced at the moment).
|
||||
* Developer Guides: [doc.silverstripe.org](http://doc.silverstripe.org) - powered by a
|
||||
SilverStripe project that uses the ["sapphiredocs" module](https://github.com/silverstripe/silverstripe-sapphiredocs)
|
||||
to convert Markdown formatted files into searchable HTML pages with index lists.
|
||||
Its contents are fetched from different releases automatically every couple of minutes.
|
||||
* Developer API Docuumentation: [api.silverstripe.org](http://api.silverstripe.org) - powered by a customized
|
||||
[phpDocumentor](http://www.phpdoc.org/) template, and is regenerated automatically every night.
|
||||
|
||||
### Source Control
|
||||
|
||||
In order to balance editorial control with effective collaboration, we keep
|
||||
documentation alongside the module source code, e.g. in `framework/docs/`,
|
||||
or as code comments within PHP code.
|
||||
Contributing documentation is the same process as providing any other patch
|
||||
(see [Patches and Bugfixes](contributing#submitting-patches-bugfixes-and-enhancements)).
|
||||
|
||||
### What to write
|
||||
|
||||
* **API Docs**: Written alongside source code and displayed on [api.silverstripe.com](http://api.silverstripe.org).
|
||||
This documents the low-level, technical usage of a class, method or property.
|
||||
Not suited for longer textual descriptions, due to the limited support of PHPDoc formatting for headlines.
|
||||
* **Tutorials**: The first contact for new users, guiding them step-by-step through achievable projects, in a book-like style.
|
||||
*Example: Building a basic site*
|
||||
* **Topics**: Provides an overview on how things fit together, the "conceptual glue" between APIs and features.
|
||||
This is where most documentation should live, and is the natural "second step" after finishing the tutorials.
|
||||
*Example: Templates, Testing, Datamodel*
|
||||
* **Howto**: Recipes that solve a specific task or problem, rather than describing a feature.
|
||||
*Example: Export DataObjects as CSV, Customizing TinyMCE in the CMS*
|
||||
* **Reference**: Complements API docs in providing deeper introduction into a specific API. Most documentation
|
||||
should fit elsewhere. *Example: ModelAdmin*
|
||||
* **Misc**: "Meta" documentation like coding conventions that doesn't directly relate to a feature or API.
|
||||
|
||||
See [What to write (jacobian.org)](http://jacobian.org/writing/great-documentation/what-to-write/) for an excellent
|
||||
introduction to the different types of documentation, and [Producing OSS: "Documentation"](http://producingoss.com/en/getting-started.html#documentation)
|
||||
for good rules of thumb for documenting opensource software.
|
||||
|
||||
### Structure
|
||||
|
||||
* Don't duplicate: Search for existing places to put your documentation. Do you really require a new page, or just a new paragraph
|
||||
of text somewhere?
|
||||
* Use PHPDoc in source code: Leave lowlevel technical documentation to code comments within PHP, in [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) format.
|
||||
* Use Markdown in Developer Guides: We have a slightly customized version of Markdown called [SSMarkdown](ss-markdown)
|
||||
* API and Developer Guides complement each other: Both forms of documenting sourcecode (API and Developer Guides) are valueable ressources.
|
||||
* Provide context: Give API documentation the "bigger picture" by referring to Developer Guides inside your PHPDoc.
|
||||
* Make your documentation findable: Documentation lives by interlinking content, so please make sure your contribution doesn't become an
|
||||
inaccessible island. Your page should at least be linked on the index page in the same folder. It can also appear
|
||||
as "related content" on other resource (e.g. `/topics/search` might link to `howto/search-dataobjects`).
|
||||
* Avoid FAQs: FAQs are not a replacement of a coherent, well explained documentation. If you've done a good job
|
||||
documenting, there shouldn't be any "frequently asked questions" left ;)
|
||||
* Commit early and often: You don't need to completely finish documentation, as long as you mark areas needing refinement.
|
||||
* Every file should have exactly one `<h1>` headline, roughly matching the filename. It should be short enough to be
|
||||
used in table of content lists.
|
||||
|
||||
### Writing Style
|
||||
|
||||
* Write in second plural form: Use "we" instead of "I". It gives the text an instructive and collaborative style.
|
||||
* Its okay to address the reader: For example "First you'll install a webserver" is good style.
|
||||
* Write in an active and direct voice
|
||||
* Mark up correctly: Use preformatted text, emphasis and bold to make technical writing more "scannable".
|
||||
|
||||
### Highlighted blocks ###
|
||||
|
||||
There are several built-in block styles for highlighting a paragraph of text.
|
||||
Please use these graphical elements sparingly.
|
||||
|
||||
<div class="hint" markdown='1'>
|
||||
"Tip box": Adds, deepens or accents information in the main text.
|
||||
Can be used for background knowledge, or "see also" links.
|
||||
</div>
|
||||
|
||||
Code:
|
||||
|
||||
<div class="hint" markdown='1'>
|
||||
...
|
||||
</div>
|
||||
|
||||
<div class="notice" markdown='1'>
|
||||
"Notification box": Technical notifications relating to the main text.
|
||||
For example, notifying users about a deprecated feature.
|
||||
</div>
|
||||
|
||||
Code:
|
||||
|
||||
<div class="notice" markdown='1'>
|
||||
...
|
||||
</div>
|
||||
|
||||
<div class="warning" markdown='1'>
|
||||
"Warning box": Highlight a severe bug or technical issue requiring
|
||||
a users attention. For example, a code block with destructive functionality
|
||||
might not have its URL actions secured to keep the code shorter.
|
||||
</div>
|
||||
|
||||
Code:
|
||||
|
||||
<div class="warning" markdown='1'>
|
||||
...
|
||||
</div>
|
||||
|
||||
See [Markdown Extra Documentation](http://michelf.com/projects/php-markdown/extra/#html) for more restriction
|
||||
on placing HTML blocks inside Markdown.
|
||||
|
||||
### Translating Documentation
|
||||
|
||||
Documentation is kept alongside the source code, typically in a module subdirectory like `framework/docs/en/`.
|
||||
Each language has its own subfolder, which can duplicate parts or the whole body of documentation.
|
||||
German documentation would for example live in `framework/docs/de/`.
|
||||
The [sapphiredocs](https://github.com/silverstripe/silverstripe-sapphiredocs) module that drives
|
||||
[doc.silverstripe.org](http://doc.silverstripe.org) automatically resolves these subfolders into a language dropdown.
|
||||
|
||||
### Further reading
|
||||
|
||||
* [Writing great documentation (jacobian.org)](http://jacobian.org/writing/great-documentation/)
|
||||
* [How tech writing sucks: Five Sins](http://www.slash7.com/articles/2006/11/15/tech-writing-the-five-sins)
|
||||
* [What is good documentation?](http://www.techscribe.co.uk/techw/whatis.htm)
|
||||
|
||||
## Translating the User Interface
|
||||
|
||||
The content for UI elements (button labels, field titles) and instruction texts shown in the CMS and
|
||||
elsewhere is stored in the PHP code for a module (see [i18n](/topics/i18n)).
|
||||
All content can be extracted as a "language file", and uploaded to an online translation editor interface.
|
||||
SilverStripe is already translated in over 60 languages, and we're relying on native speakers
|
||||
to keep these up to date, and of course add new languages.
|
||||
Please [register](translation-process) a free translator account to get started,
|
||||
even if you just feel like fixing up a few sentences.
|
||||
See [our translation workflow](translation-process) for more details.
|
||||
|
||||
## Related
|
||||
|
||||
* [Installation: From Source](/installation/from-source)
|
||||
* [Collaboration on Git](/misc/collaboration-on-git)
|
247
docs/en/misc/contributing/code.md
Normal file
247
docs/en/misc/contributing/code.md
Normal file
@ -0,0 +1,247 @@
|
||||
# Contributing Code - Submiting Bugfixes and Enhancements
|
||||
|
||||
SilverStripe will never be finished, and we need your help to keep making it better. If you're a developer a great way to get involved is to contribute patches to our modules and core codebase, fixing bugs or adding feautres.
|
||||
|
||||
The SilverStripe core modules (`framework` and `cms`), as well as some of the more popular modules are in
|
||||
git version control. SilverStripe hosts its modules on [github.com/silverstripe](http://github.com/silverstripe) and [github.com/silverstripe-labs](http://github.com/silverstripe-labs). After [installing git](http://help.github.com/git-installation-redirect) and creating a [free github.com account](https://github.com/signup/free), you can "fork" a module,
|
||||
which creates a copy that you can commit to (see github's [guide to "forking"](http://help.github.com/forking/)).
|
||||
|
||||
For other modules, our [module list on silverstripe.org](http://silverstripe.org/modules) lists the repository locations, typically using a version control system like "git" or "[subversion](subversion)".
|
||||
|
||||
<div class="hint" markdown="1">
|
||||
Note: By supplying code to the SilverStripe core team in patches, tickets and pull requests, you agree to assign copyright of that code to SilverStripe Limited, on the condition that SilverStripe Limited releases that code under the BSD license.
|
||||
|
||||
We ask for this so that the ownership in the license is clear and unambiguous, and so that community involvement doesn't stop us from being able to continue supporting these projects. By releasing this code under a permissive license, this copyright assignment won't prevent you from using the code in any way you see fit.
|
||||
</div>
|
||||
|
||||
## Step-by-step: From forking to sending the pull request
|
||||
|
||||
1. Follow the [Installation for contributions](../../installation/from-source#option-2-installation-for-contributions) instructions, which explain how to fork the core modules and add the correct "upstream" remote.
|
||||
|
||||
1. [Branch for new issue and develop on issue branch](code#branch-for-new-issue-and-develop-on-issue-branch)
|
||||
|
||||
$ git branch ###-description
|
||||
$ git checkout ###-description
|
||||
|
||||
1. As time passes, the upstream repository accumulates new commits. Keep your working copy's master branch and issue branch up to date by periodically [rebasing your development branch on the latest upstream](code#rebase-your-development-branch-on-the-latest-upstream).
|
||||
|
||||
# [make sure all your changes are committed as necessary in branch]
|
||||
$ git fetch upstream
|
||||
$ git rebase upstream/master
|
||||
|
||||
1. When development is complete, [squash all commit related to a single issue into a single commit](code#squash-all-commits-related-to-a-single-issue-into-a-single-commit).
|
||||
|
||||
$ git fetch upstream
|
||||
$ git rebase -i upstream/master
|
||||
|
||||
1. Push release candidate branch to GitHub
|
||||
|
||||
$ git push origin ###-description
|
||||
|
||||
1. Issue pull request on GitHub. Visit your forked respoistory on GitHub.com and click the "Create Pull Request" button nex tot the new branch.
|
||||
|
||||
The core team is then responsible for reviewing patches and deciding if they will make it into core. If
|
||||
there are any problems they will follow up with you, so please ensure they have a way to contact you!
|
||||
|
||||
### Workflow Diagram ###
|
||||
|
||||
![Workflow diagram](http://www.silverstripe.org/assets/doc-silverstripe-org/collaboration-on-github.png)
|
||||
|
||||
### Quickfire Do's and Don't's
|
||||
|
||||
If you aren't familiar with git and GitHub, try reading the ["GitHub bootcamp documentation"](http://help.github.com/).
|
||||
We also found the [free online git book](http://progit.org/book/) and the [git crash course](http://gitref.org/) useful.
|
||||
If you're familiar with it, here's the short version of what you need to know. Once you fork and download the code:
|
||||
|
||||
* **Don't develop on the master branch.** Always create a development branch specific to "the issue" you're working on (mostly on [open.silverstripe.org](http://open.silverstripe.org)). Name it by issue number and description. For example, if you're working on Issue #100, a `DataObject::get_one()` bugfix, your development branch should be called 100-dataobject-get-one. If you decide to work on another issue mid-stream, create a new branch for that issue--don't work on both in one branch.
|
||||
|
||||
* **Do not merge the upstream master** with your development branch; *rebase* your branch on top of the upstream master.
|
||||
|
||||
* **A single development branch should represent changes related to a single issue.** If you decide to work on another issue, create another branch.
|
||||
|
||||
* **Squash your commits, so that each commit addresses a single issue.** After you rebase your work on top of the upstream master, you can squash multiple commits into one. Say, for instance, you've got three commits in related to Issue #100. Squash all three into one with the message "Issue #100 Description of the issue here." We won't accept pull requests for multiple commits related to a single issue; it's up to you to squash and clean your commit tree. (Remember, if you squash commits you've already pushed to GitHub, you won't be able to push that same branch again. Create a new local branch, squash, and push the new squashed branch.)
|
||||
|
||||
|
||||
|
||||
### Editing files directly on GitHub.com
|
||||
|
||||
If you see a typo or another small fix that needs to be made, and you don't have an installation set up for contributions, you can edit files directly in the github.com web interface. Every file view has an "edit this file" link.
|
||||
|
||||
After you have edited the file, GitHub will offer to create a pull request for you. This pull request will be reviewed along with other pull requests.
|
||||
|
||||
## Check List
|
||||
|
||||
* Adhere to our [coding conventions](coding-conventions)
|
||||
* If your patch is extensive, discuss it first on the [silverstripe-dev google group](https://groups.google.com/group/silverstripe-dev) (ideally before doing any serious coding)
|
||||
* When working on existing tickets, assign them to you and provide status updates through ticket comments
|
||||
* Check your patches against the latest "trunk" or "master", as well as the latest release.
|
||||
Please not that the latest stable release will often not be sufficient! (of all modules)
|
||||
* Provide complete [unit test coverage](/topics/testing) - depending on the complexity of your work, this is a required
|
||||
step.
|
||||
* Do not set milestones. If you think your patch should be looked at with priority, mark it as "critical".
|
||||
* Describe specifics on how to test the effects of the patch
|
||||
* It's better to submit multiple patches with separate bits of functionality than a big patch containing lots of
|
||||
changes
|
||||
* Document your code inline through [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) syntax. See our
|
||||
[API documentation](http://api.silverstripe.org/trunk) for good examples.
|
||||
* Also check and update documentation on [doc.silverstripe.org](http://doc.silverstripe.org). Check for any references to functionality deprecated or extended through your patch. Documentation changes should be included in the patch.
|
||||
* We will attribute the change to you whereever possible (git does this automatically for pull requests)
|
||||
* If you get stuck, please post to the [forum](http://silverstripe.org/forum) or for deeper core problems, to the [core mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)
|
||||
* When working with the CMS, please read the ["CMS Architecture Guide"](/reference/cms-architecture) first
|
||||
|
||||
## Commit Messages
|
||||
|
||||
We try to maintain a consistent record of descriptive commit messages.
|
||||
Most importantly: Keep the first line short, and add more detail below.
|
||||
This ensures commits are easy to browse, and look nice on github.com
|
||||
(more info about [proper git commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)).
|
||||
|
||||
As we automatically generate [changelogs](http://doc.silverstripe.org/sapphire/en/trunk/changelogs/) from them, we need a way to categorize and filter.
|
||||
Please prefix **noteworthy** commit messages with one of the following tags:
|
||||
|
||||
* `NEW`: New feature or major enhancement (both for users and developers)
|
||||
* `API`: Addition of a new API, or modification/removal/deprecation of an existing API.
|
||||
Includes any change developers should be aware of when upgrading.
|
||||
* `BUG`: Bugfix or minor enhancement on something developers or users are likely to encounter.
|
||||
|
||||
All other commits should not be tagged if they are so trivial that most developers
|
||||
can ignore them during upgrades or when reviewing changes to the codebase.
|
||||
For example, adding unit tests or documentation would not be considered "noteworthy".
|
||||
Same goes for version control plumbing like merges, file renames or reverts.
|
||||
|
||||
Further guidelines:
|
||||
|
||||
* Each commit should form a logical unit - if you fix two unrelated bugs, commit each one separately
|
||||
* If you are fixing a ticket from our [bugtracker](http://open.silverstripe.com), please append `(fixes #<ticketnumber>)`
|
||||
* If your change is related to another commit, reference it with its abbreviated commit hash.
|
||||
* Mention important changed classes and methods in the commit summary.
|
||||
|
||||
Example: Bad commit message
|
||||
|
||||
finally fixed this dumb rendering bug that Joe talked about ... LOL
|
||||
also added another form field for password validation
|
||||
|
||||
Example: Good commit message
|
||||
|
||||
BUG Formatting through prepValueForDB()
|
||||
|
||||
Added prepValueForDB() which is called on DBField->writeToManipulation()
|
||||
to ensure formatting of value before insertion to DB on a per-DBField type basis (fixes #1234).
|
||||
Added documentation for DBField->writeToManipulation() (related to a4bd42fd).
|
||||
|
||||
## The steps in more detail
|
||||
|
||||
### Branch for new issue and develop on issue branch
|
||||
|
||||
Before you start working on a new feature or bugfix, create a new branch dedicated to that one change named by issue number and description. If you're working on Issue #100, a retweet bugfix, create a new branch with the issue number and description, like this:
|
||||
|
||||
$ git branch 100-dataobject-get-one
|
||||
$ git checkout 100-dataobject-get-one
|
||||
|
||||
Edit and test the files on your development environment. When you've got something the way you want and established that it works, commit the changes to your branch on your local git repo.
|
||||
|
||||
$ git add <filename>
|
||||
$ git commit -m 'Issue #100: Some kind of descriptive message'
|
||||
|
||||
You'll need to use git add for each file that you created or modified. There are ways to add multiple files, but I highly recommend a more deliberate approach unless you know what you're doing.
|
||||
|
||||
Then, you can push your new branch to GitHub, like this (replace `100-dataobject-get-one` with your branch name):
|
||||
|
||||
$ git push origin 100-dataobject-get-one
|
||||
|
||||
You should be able to log into your GitHub account, switch to the branch, and see that your changes have been committed. Then click the Pull button to request that your commits get merged into the development master.
|
||||
|
||||
### Rebase Your Development Branch on the Latest Upstream
|
||||
|
||||
To keep your development branch up to date, rebase your changes on top of the current state of the upstream master. See the [What is git rebase?](code#what-is-git-rebase) section below to learn more about rebasing.
|
||||
|
||||
If you've set up an upstream branch as detailed above, and a development branch called `100-dataobject-get-one`, you can update `upstream` and rebase your branch from it like so:
|
||||
|
||||
# [make sure all your changes are committed as necessary in branch]
|
||||
$ git fetch upstream
|
||||
$ git rebase upstream/master
|
||||
|
||||
Note that the example doesn't keep your own master branch up to date. If you wanted to that, you might take the following approach instead:
|
||||
|
||||
# [make sure all your changes are committed as necessary in branch]
|
||||
$ git fetch upstream
|
||||
$ git checkout master
|
||||
$ git rebase upstream/master
|
||||
$ git checkout 100-dataobject-get-one
|
||||
$ git rebase master
|
||||
|
||||
You may need to resolve conflicts that occur when a file on the development trunk and one of your files have both been changed. Edit each file to resolve the differences, then commit the fixes to your development server repo and test. Each file will need to be "added" before running a "commit."
|
||||
|
||||
Conflicts are clearly marked in the code files. Make sure to take time in determining what version of the conflict you want to keep and what you want to discard.
|
||||
|
||||
$ git add <filename>
|
||||
$ git rebase --continue
|
||||
|
||||
### Squash All Commits Related to a Single Issue into a Single Commit
|
||||
|
||||
Once you have rebased your work on top of the latest state of the upstream master, you may have several commits related to the issue you were working on. Once everything is done, squash them into a single commit with a descriptive message (see ["Contributing: Commit Messages"](code#commit-messages)).
|
||||
|
||||
To squash four commits into one, do the following:
|
||||
|
||||
$ git rebase -i upstream/master
|
||||
|
||||
In the text editor that comes up, replace the words "pick" with "squash" next to the commits you want to squash into the commit before it. Save and close the editor, and git will combine the "squash"'ed commits with the one before it. Git will then give you the opportunity to change your commit message to something like, "BUGFIX Issue #100: Fixed DataObject::get_one() parameter order"
|
||||
|
||||
Important: If you've already pushed commits to GitHub, and then squash them locally, you will have to force-push to your GitHub again. Add the `-f` argument to your git push command:
|
||||
|
||||
$ git push -f origin 100-dataobject-get-one
|
||||
|
||||
Helpful hint: You can always edit your last commit message by using:
|
||||
|
||||
$ git commit --amend
|
||||
|
||||
## Some gotchas
|
||||
|
||||
Be careful not to commit any of your configuration files, logs, or throwaway test files to your GitHub repo. These files can contain information you wouldn't want publicly viewable and they will make it impossible to merge your contributions into the main development trunk.
|
||||
|
||||
Most of these special files are listed in the `.gitignore` file and won't be included in any commit, but you should carefully review the files you have modified and added before staging them and committing them to your repo. The git status command will display detailed information about any new files, modifications and staged.
|
||||
|
||||
$ git status
|
||||
|
||||
One thing you do not want to do is to issue a git commit with the -a option. This automatically stages and commits every modified file that's not expressly defined in .gitignore, including your crawler logs.
|
||||
|
||||
$ git commit -a
|
||||
|
||||
## What is git rebase?
|
||||
|
||||
Using `git rebase` helps create clean commit trees and makes keeping your code up-to-date with the current state of the upstream master easy. Here's how it works.
|
||||
|
||||
Let's say you're working on Issue #212 a new plugin in your own branch and you start with something like this:
|
||||
|
||||
1---2---3 #212-my-new-plugin
|
||||
/
|
||||
A---B #master
|
||||
|
||||
You keep coding for a few days and then pull the latest upstream stuff and you end up like this:
|
||||
|
||||
1---2---3 #212-my-new-plugin
|
||||
/
|
||||
A---B--C--D--E--F #master
|
||||
|
||||
So all these new things (C,D,..F) have happened since you started. Normally you would just keep going (let's say you're not finished with the plugin yet) and then deal with a merge later on, which becomes a commit, which get moved upstream and ends up grafted on the tree forever.
|
||||
|
||||
A cleaner way to do this is to use rebase to essentially rewrite your commits as if you had started at point F instead of point B. So just do:
|
||||
|
||||
git rebase master 212-my-new-plugin
|
||||
|
||||
git will rewrite your commits like this:
|
||||
|
||||
1---2---3 #212-my-new-plugin
|
||||
/
|
||||
A---B--C--D--E--F #master
|
||||
|
||||
It's as if you had just started your branch. One immediate advantage you get is that you can test your branch now to see if C, D, E, or F had any impact on your code (you don't need to wait until you're finished with your plugin and merge to find this out). And, since you can keep doing this over and over again as you develop your plugin, at the end your merge will just be a fast-forward (in other words no merge at all).
|
||||
|
||||
So when you're ready to send the new plugin upstream, you do one last rebase, test, and then merge (which is really no merge at all) and send out your pull request. Then in most cases, we have a simple fast-forward on our end (or at worst a very small rebase or merge) and over time that adds up to a simpler tree.
|
||||
|
||||
More info on the ["Rebasing" chapter on progit.org](http://progit.org/book/ch3-6.html) and the [git rebase man page](http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html).
|
||||
|
||||
## License
|
||||
|
||||
Portions of this guide have been adapted from the ["Thinkup" developer guide](https://github.com/ginatrapani/ThinkUp/wiki/Developer-Guide%3A-Get-the-Source-Code-from-GitHub-and-Keep-It-Updated),
|
||||
with friendly permission from Gina Trapani/[thinkupapp.com](http://thinkupapp.com).
|
154
docs/en/misc/contributing/documentation.md
Normal file
154
docs/en/misc/contributing/documentation.md
Normal file
@ -0,0 +1,154 @@
|
||||
# Contributing Documentation
|
||||
|
||||
[« Back to Contributing page](.)
|
||||
|
||||
Documentation for a software project is a continued and collaborative effort,
|
||||
we encourage everybody to contribute, from simply fixing spelling mistakes, to writing recipes/howtos,
|
||||
reviewing existing documentation, and translating the whole thing.
|
||||
|
||||
Modifying documentation requires basic [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) and
|
||||
[Markdown](http://daringfireball.net/projects/markdown/)/[SSMarkdown](../ss-markdown) knowledge,
|
||||
and a GitHub user account.
|
||||
|
||||
## Editing online
|
||||
|
||||
The easiest way of making a change the the documentation is to find the appropriate .md
|
||||
file in the [github.com/silverstripe/sapphire](https://github.com/silverstripe/sapphire/edit/3.0/docs/) repository
|
||||
and press the "edit" button. You will need a GitHub account to do this.
|
||||
|
||||
* After you have made your change, describe it in the "commit summary" and "extended description" fields below, and press "Commit Changes".
|
||||
* After that you will see form to submit a Pull Request. You should just be able to submit the form, and your changes will be sent to the core team for approval.
|
||||
|
||||
Each documentation page has have an "edit" link, to make it easier for you to find this feature.
|
||||
|
||||
## Editing on your computer
|
||||
|
||||
If you prefer to edit the content on your local machine, you can "[fork](http://help.github.com/forking/)"
|
||||
the [github.com/silverstripe/sapphire](http://github.com/silverstripe/sapphire)
|
||||
and [github.com/silverstripe/silverstripe-cms](http://github.com/silverstripe/silverstripe-cms)
|
||||
repositories and send us "[pull requests](http://help.github.com/pull-requests/)". If you have
|
||||
downloaded SilverStripe or a module, chances are that you already have these checkouts.
|
||||
|
||||
The documentation is kept alongside the source code in the `docs/` subfolder.
|
||||
|
||||
**Note:** If you submit a new feature or an API change, we strongly recommend that your patch
|
||||
includes updates to the necessary documentation. This helps prevent our documentation from
|
||||
getting out of date.
|
||||
|
||||
## Repositories
|
||||
|
||||
* End-user: [userhelp.silverstripe.org](http://userhelp.silverstripe.org) - a custom SilverStripe project (not open sourced at the moment).
|
||||
* Developer Guides: [doc.silverstripe.org](http://doc.silverstripe.org) - powered by a
|
||||
SilverStripe project that uses the ["sapphiredocs" module](https://github.com/silverstripe/silverstripe-sapphiredocs)
|
||||
to convert Markdown formatted files into searchable HTML pages with index lists.
|
||||
Its contents are fetched from different releases automatically every couple of minutes.
|
||||
* Developer API Docuumentation: [api.silverstripe.org](http://api.silverstripe.org) - powered by a customized
|
||||
[phpDocumentor](http://www.phpdoc.org/) template, and is regenerated automatically every night.
|
||||
|
||||
## Source Control
|
||||
|
||||
In order to balance editorial control with effective collaboration, we keep
|
||||
documentation alongside the module source code, e.g. in `framework/docs/`,
|
||||
or as code comments within PHP code.
|
||||
Contributing documentation is the same process as providing any other patch
|
||||
(see [Contributing code](code)).
|
||||
|
||||
## What to write
|
||||
|
||||
* **API Docs**: Written alongside source code and displayed on [api.silverstripe.com](http://api.silverstripe.org).
|
||||
This documents the low-level, technical usage of a class, method or property.
|
||||
Not suited for longer textual descriptions, due to the limited support of PHPDoc formatting for headlines.
|
||||
* **Tutorials**: The first contact for new users, guiding them step-by-step through achievable projects, in a book-like style.
|
||||
*Example: Building a basic site*
|
||||
* **Topics**: Provides an overview on how things fit together, the "conceptual glue" between APIs and features.
|
||||
This is where most documentation should live, and is the natural "second step" after finishing the tutorials.
|
||||
*Example: Templates, Testing, Datamodel*
|
||||
* **Howto**: Recipes that solve a specific task or problem, rather than describing a feature.
|
||||
*Example: Export DataObjects as CSV, Customizing TinyMCE in the CMS*
|
||||
* **Reference**: Complements API docs in providing deeper introduction into a specific API. Most documentation
|
||||
should fit elsewhere. *Example: ModelAdmin*
|
||||
* **Misc**: "Meta" documentation like coding conventions that doesn't directly relate to a feature or API.
|
||||
|
||||
See [What to write (jacobian.org)](http://jacobian.org/writing/great-documentation/what-to-write/) for an excellent
|
||||
introduction to the different types of documentation, and [Producing OSS: "Documentation"](http://producingoss.com/en/getting-started.html#documentation)
|
||||
for good rules of thumb for documenting opensource software.
|
||||
|
||||
## Structure
|
||||
|
||||
* Don't duplicate: Search for existing places to put your documentation. Do you really require a new page, or just a new paragraph
|
||||
of text somewhere?
|
||||
* Use PHPDoc in source code: Leave lowlevel technical documentation to code comments within PHP, in [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) format.
|
||||
* Use Markdown in Developer Guides: We have a slightly customized version of Markdown called [SSMarkdown](../ss-markdown)
|
||||
* API and Developer Guides complement each other: Both forms of documenting sourcecode (API and Developer Guides) are valueable ressources.
|
||||
* Provide context: Give API documentation the "bigger picture" by referring to Developer Guides inside your PHPDoc.
|
||||
* Make your documentation findable: Documentation lives by interlinking content, so please make sure your contribution doesn't become an
|
||||
inaccessible island. Your page should at least be linked on the index page in the same folder. It can also appear
|
||||
as "related content" on other resource (e.g. `/topics/search` might link to `howto/search-dataobjects`).
|
||||
* Avoid FAQs: FAQs are not a replacement of a coherent, well explained documentation. If you've done a good job
|
||||
documenting, there shouldn't be any "frequently asked questions" left ;)
|
||||
* Commit early and often: You don't need to completely finish documentation, as long as you mark areas needing refinement.
|
||||
* Every file should have exactly one `<h1>` headline, roughly matching the filename. It should be short enough to be
|
||||
used in table of content lists.
|
||||
|
||||
## Writing Style
|
||||
|
||||
* Write in second plural form: Use "we" instead of "I". It gives the text an instructive and collaborative style.
|
||||
* Its okay to address the reader: For example "First you'll install a webserver" is good style.
|
||||
* Write in an active and direct voice
|
||||
* Mark up correctly: Use preformatted text, emphasis and bold to make technical writing more "scannable".
|
||||
|
||||
## Highlighted blocks
|
||||
|
||||
There are several built-in block styles for highlighting a paragraph of text.
|
||||
Please use these graphical elements sparingly.
|
||||
|
||||
<div class="hint" markdown='1'>
|
||||
"Tip box": Adds, deepens or accents information in the main text.
|
||||
Can be used for background knowledge, or "see also" links.
|
||||
</div>
|
||||
|
||||
Code:
|
||||
|
||||
<div class="hint" markdown='1'>
|
||||
...
|
||||
</div>
|
||||
|
||||
<div class="notice" markdown='1'>
|
||||
"Notification box": Technical notifications relating to the main text.
|
||||
For example, notifying users about a deprecated feature.
|
||||
</div>
|
||||
|
||||
Code:
|
||||
|
||||
<div class="notice" markdown='1'>
|
||||
...
|
||||
</div>
|
||||
|
||||
<div class="warning" markdown='1'>
|
||||
"Warning box": Highlight a severe bug or technical issue requiring
|
||||
a users attention. For example, a code block with destructive functionality
|
||||
might not have its URL actions secured to keep the code shorter.
|
||||
</div>
|
||||
|
||||
Code:
|
||||
|
||||
<div class="warning" markdown='1'>
|
||||
...
|
||||
</div>
|
||||
|
||||
See [Markdown Extra Documentation](http://michelf.com/projects/php-markdown/extra/#html) for more restriction
|
||||
on placing HTML blocks inside Markdown.
|
||||
|
||||
## Translating Documentation
|
||||
|
||||
Documentation is kept alongside the source code, typically in a module subdirectory like `framework/docs/en/`.
|
||||
Each language has its own subfolder, which can duplicate parts or the whole body of documentation.
|
||||
German documentation would for example live in `framework/docs/de/`.
|
||||
The [docsviewer](https://github.com/silverstripe/silverstripe-docsviewer) module that drives
|
||||
[doc.silverstripe.org](http://doc.silverstripe.org) automatically resolves these subfolders into a language dropdown.
|
||||
|
||||
## Further reading
|
||||
|
||||
* [Writing great documentation (jacobian.org)](http://jacobian.org/writing/great-documentation/)
|
||||
* [How tech writing sucks: Five Sins](http://www.slash7.com/articles/2006/11/15/tech-writing-the-five-sins)
|
||||
* [What is good documentation?](http://www.techscribe.co.uk/techw/whatis.htm)
|
14
docs/en/misc/contributing/index.md
Normal file
14
docs/en/misc/contributing/index.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Contributing
|
||||
|
||||
Any open source product is only as good as the community behind it. You can participate by sharing
|
||||
code, ideas, or simply helping others. No matter what your skill level is, every contribution counts.
|
||||
|
||||
See our [high level overview on silverstripe.org](http://silverstripe.org/contributing-to-silverstripe) on how you can help out.
|
||||
|
||||
Or, for more detailed guidance, read one of the following pages:
|
||||
|
||||
* [Sharing your **opinion** and raising **issues**](issues)
|
||||
* [Providing **code**, whether it's creating a feature or fixing a bug](code)
|
||||
* [Writing and translating **documentation**](documentation)
|
||||
* [**Translating** user-interface elements](translation)
|
||||
|
20
docs/en/misc/contributing/issues.md
Normal file
20
docs/en/misc/contributing/issues.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Contributing Issues and Opinions
|
||||
|
||||
[« Back to Contributing page](../contributing)
|
||||
|
||||
## Reporting Bugs
|
||||
|
||||
If you have discovered a bug in SilverStripe, we'd be glad to hear about it -
|
||||
well written bug reports can be half of the solution already!
|
||||
Our bugtracker is located on [open.silverstripe.org](http://open.silverstripe.org/) (create a [new ticket](http://open.silverstripe.org/newticket)).
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
Report security issues to [security@silverstripe.com](mailto:security@silverstripe.com). See our "[Release Process](release-process)" documentation for more info, and read our guide on [how to write secure code](/topics/security).
|
||||
|
||||
## Sharing your Opinion
|
||||
|
||||
* [silverstripe.org/forums](http://silverstripe.org/forums): Forums on silverstripe.org
|
||||
* [silverstripe-dev](http://groups.google.com/group/silverstripe-dev): Core development mailinglist
|
||||
* [silverstripe-documentation](http://groups.google.com/group/silverstripe-documentation): Documentation team mailing list
|
||||
|
116
docs/en/misc/contributing/translation.md
Normal file
116
docs/en/misc/contributing/translation.md
Normal file
@ -0,0 +1,116 @@
|
||||
# Contributing Translations for the User Interface
|
||||
|
||||
[« Back to Contributing page](../contributing)
|
||||
|
||||
We are always looking for new translators. Even if a specific language already is translated and has an official maintainer, we can use helping hands in reviewing and updating translations. Important: It is perfectly fine if you only have time for a partial translation or quick review work - our system accomodates many people collaborating on the same language.
|
||||
|
||||
The content for UI elements (button labels, field titles) and instruction texts shown in the CMS and elsewhere is stored in the PHP code for a module (see [i18n](/topics/i18n)). All content can be extracted as a "language file", and uploaded to an online translation editor interface. SilverStripe is already translated in over 60 languages, and we're relying on native speakers to keep these up to date, and of course add new languages.
|
||||
|
||||
Please register a free translator account to get started, even if you just feel like fixing up a few sentences.
|
||||
|
||||
## The online translation tool
|
||||
|
||||
We provide a GUI for translations through [getlocalization.com](http://getlocalization.com). If you don't have an account yet, please follow the links there to sign up. Select a project from the [list of translatable modules](http://www.getlocalization.com/profile/?username=silverstripe) and start translating online!
|
||||
|
||||
For all modules listed there, we automatically import new master strings as they get committed to the various codebases, so you're always translating on the latest and greatest version.
|
||||
|
||||
## FAQ
|
||||
|
||||
### How do I translate substituted strings? (e.g. '%s')
|
||||
|
||||
You don't have to - if the english master-string reads 'Hello %s', your german translation would be 'Hallo %s'. Strings prefixed by a percentage-sign are automatically replaced by silverstripe with dynamic content. See http://php.net/sprintf for details.
|
||||
|
||||
### Do I need to convert special characters (e.g. HTML-entities)?
|
||||
|
||||
Special characters (such as german umlauts) need to be entered in their native form. Please don't use HTML-entities ("ä" instead of "ä"). Silverstripe stores and renders most strings in UTF8 (Unicode) format.
|
||||
|
||||
### How can I check out my translation in the interface?
|
||||
|
||||
Currently translated entities are not directly factored into code (for security reasons and release/review-control), so you can't see them straight away.
|
||||
|
||||
It is strongly encouraged that you check your translation this way, as its a good way to doublecheck your translation works in the right context.
|
||||
Please use our [daily-builds](http://www.silverstripe.org/daily-builds/) for your local installation, to ensure you're looking at the most up to date interface. See "Download Translations" above
|
||||
to find out how to retrieve the latest translation files.
|
||||
|
||||
### Can I change a translation just for one SilverStripe version?
|
||||
|
||||
While we version control our translation files like all other source code,
|
||||
the online translation tool doesn't have the same capabilities.
|
||||
A translated string (as identified by its unique "entity name")
|
||||
is assumed to work well in all releases. If the interface changes
|
||||
in a non-trivial fashion, the new translations required should
|
||||
have new identifiers as well.
|
||||
|
||||
Example: We renamed the "Security" menu title to "Users"
|
||||
in our 3.0 release. As it would confuse users of older versions
|
||||
unnecessarily, we should be using a new entity name for this,
|
||||
and avoid the change propagating to an older SilverStripe version.
|
||||
|
||||
### How do I change my interface language?
|
||||
|
||||
Once you've logged into the CMS, you should see a "profile"-link on the lower right corner (direct link: http://www.site.com/admin/myprofile). You can set the "interface language" from a dropdown which automatically includes all found translations (based on the files in the `/lang` folders).
|
||||
|
||||
### I've found a piece of untranslatable text
|
||||
|
||||
It is entirely possible that we missed certain strings in preparing Silverstripe for translation-support. If you're technically minded, please read [i18n](/topics/i18n) on how to make it translatable. Otherwise just post your findings to the forum.
|
||||
|
||||
Note: JavaScript strings can't be translated through the online translation tool at the moment,
|
||||
you'll need to edit the file locally (e.g. cms/javascript/de_DE.js), and submit a patch.
|
||||
|
||||
### How do I add my own module?
|
||||
|
||||
Once you've built a translation-enabled module, you can run the "textcollector" on your local installation for this specific module (see [i18n](/topics/i18n)). This should find all calls to `_t()` in php and template files, and generate a new lang file with the default locale (path: <mymodule>/lang/en.yml). Upload this file to the
|
||||
online translation tool, and wait for hyour translators to do their magic!
|
||||
|
||||
### What about right-to-left (RTL) languages (e.g. Arabic)?
|
||||
|
||||
SilverStripe doesn't have built-in support for attribute-based RTL-modifications (`<html dir="rtl">`).
|
||||
We are currently investigating the available options, and are eager to get feedback on your experiences with translating silverstripe RTL.
|
||||
|
||||
### Can I translate/edit the language files in my favourite text editor (on my local installation)
|
||||
|
||||
Not for modules managed by getlocalization.com, including "framework" and "cms.
|
||||
It causes us a lot of work in merging these files back.
|
||||
Please use the online translation tool for all new and existing translations.
|
||||
|
||||
### How does my translation get into a SilverStripe release?
|
||||
|
||||
Currently this is a manual process of a core team member downloading approved translations and committing them into our source tree.
|
||||
|
||||
### How does my translation get approved, who is the maintainer?
|
||||
|
||||
The online translation tool (getlocalization.com) is designed to be decentralized and collaborative,
|
||||
so there's no strict approval or review process.
|
||||
Every logged-in user on the system can flag translations,
|
||||
and discuss them with other translators.
|
||||
|
||||
### I'm seeing lots of duplicated translations, what should I do?
|
||||
|
||||
For now, please translate all duplications - sometimes they might be intentional, but mostly the developer just didn't know his phrase was already translated.
|
||||
Please contact us about any duplicates that might be worth merging.
|
||||
|
||||
### What happened to translate.silverstripe.org?
|
||||
|
||||
This was a custom-built online translation tool serving us well for a couple of years,
|
||||
but started to show its age (performance and maintainability). It was replaced
|
||||
with getlocalization.com. All translations from translate.silverstripe.org were migrated.
|
||||
Unfortunately, the ownership of individual translations couldn't be migrated.
|
||||
|
||||
As the new tool doesn't support the PHP format used in SilverStripe 2.x,
|
||||
this means that we no longer have a working translation tool for PHP files.
|
||||
Please edit the PHP files directly and [send us pull requests](/misc/contributing).
|
||||
This also applies for any modules staying compatible with SilverStripe 2.x.
|
||||
|
||||
## Contact
|
||||
|
||||
Translators have their own [mailinglist](https://groups.google.com/forum/#!forum/silverstripe-translators),
|
||||
but you can also reach a core member on [IRC](http://silverstripe.org/irc).
|
||||
The getlocalization.com interface has a built-in discussion board if
|
||||
you have specific comments on a translation.
|
||||
|
||||
## Related
|
||||
|
||||
* [i18n](/topics/i18n): Developer-level documentation of Silverstripe's i18n capabilities
|
||||
* [translation-process](../translation-process): Information about managing translations for the core team and/or module maintainers.
|
||||
* [translatable](https://github.com/silverstripe/silverstripe-translatable): DataObject-interface powering the website-content translations
|
||||
* ["Translatable ModelAdmin" module](http://silverstripe.org/translatablemodeladmin-module/): An extension which allows translations of DataObjects inside ModelAdmin
|
@ -44,7 +44,7 @@ available for opensource projects, including wiki and bugtracker functionality
|
||||
your modules page on silverstripe.org
|
||||
* Be involved in our community
|
||||
* Subscripe to our developer mailing list and be available to answer questions on the forum.
|
||||
* Attend [irc:our weekly core discussions on IRC](irc/our weekly core discussions on IRC) as regularly as you can.
|
||||
* Attend our weekly core discussions on IRC as regularly as you can.
|
||||
* Create an **issue tracker** so your users can file bugs and feature requests (see ["Feedback and Bugtracking"](module-release-process#feedback-and-bugtracking) below)
|
||||
* Create a **roadmap** and **milestones** outlining future release planning
|
||||
|
||||
@ -64,7 +64,7 @@ release candidate. If your release candidate is found to be stable, then you ca
|
||||
|
||||
You should have both **developer documentation** and **user documentation**, and keep them updated with your releases.
|
||||
See [Producing OSS: "Documentation"](http://producingoss.com/en/getting-started.html#documentation) and our
|
||||
[contributing guide](contributing#writing-documentation).
|
||||
[contributing guide](contributing/documentation).
|
||||
|
||||
### README file
|
||||
|
||||
@ -236,7 +236,7 @@ trunk.
|
||||
## See Also
|
||||
|
||||
* [Module Development](/topics/module-development)
|
||||
* [Documentation Guide](contributing#writing-documentation)
|
||||
* [Contributing to SilverStripe](http://silverstripe.org/contributing-to-silverstripe/)
|
||||
* [Documentation Guide](contributing/documentation)
|
||||
* [Contributing to SilverStripe](contributing)
|
||||
* [Submit your Module](http://silverstripe.org/modules/manage/add)
|
||||
* [subversion](subversion)
|
||||
|
@ -112,4 +112,4 @@ Of course, the `sapphiredocs` code is BSD licensed - we're looking forward to yo
|
||||
|
||||
## Related ##
|
||||
|
||||
* [contributing](contributing#writing-documentation): The doc.silverstripe.org website has certain styling and writing conventions
|
||||
* [contributing/documentation](contributing/documentation): The doc.silverstripe.org website has certain styling and writing conventions
|
@ -1,45 +1,8 @@
|
||||
# Translation Process #
|
||||
|
||||
## Overview ##
|
||||
This page covers a few advanced topics related to SilverStripe's translation system.
|
||||
|
||||
We are always looking for new translators. Even if a specific language already is translated and has an official maintainer, we can use helping hands in reviewing and updating translations. Important: It is perfectly fine if you only have time for a partial translation or quick review work - our system accomodates many people collaborating on the same language.
|
||||
|
||||
SilverStripe contains language files for user-facing strings (see [i18n](/topics/i18n)).
|
||||
These are stored in YML format, which is fairly readable,
|
||||
but also sensitive to whitespace and formatting changes,
|
||||
so not ideally suited for non-technical editors.
|
||||
|
||||
Note: Until SilverStripe 3.0, we used a PHP storage format.
|
||||
This format is now deprecated, and we don't provide tools
|
||||
for editing the files. Please see below for information on
|
||||
how to convert these legacy files and existing translations to YML.
|
||||
|
||||
## Download Translations
|
||||
|
||||
We are managing our translations through a tool called [getlocalization.com](http://getlocalization.com).
|
||||
Most modules are managed under the "silverstripe" user there,
|
||||
see [list of translatable modules](http://www.getlocalization.com/profile/?username=silverstripe).
|
||||
|
||||
Translations are exported from there into YML files, generated every hour,
|
||||
and committed to a special "translation-staging" branch on github.
|
||||
You can download individual files by opening them on github.com (inside the `lang/` folder), and using the "Raw" view.
|
||||
Place those files in the appropriate directories on a local silverstripe installation.
|
||||
|
||||
* ["translation-staging" branch for framework module](https://github.com/silverstripe/sapphire/tree/translation-staging)
|
||||
* ["translation-staging" branch for cms module](https://github.com/silverstripe/silverstripe-cms/tree/translation-staging)
|
||||
|
||||
## Help as a translator
|
||||
|
||||
### The online translation tool
|
||||
|
||||
We provide a GUI for translations through [getlocalization.com](http://getlocalization.com).
|
||||
If you don't have an account yet, please follow the links there to sign up.
|
||||
Select a project from the [list of translatable modules](http://www.getlocalization.com/profile/?username=silverstripe)
|
||||
and start translating online!
|
||||
|
||||
For all modules listed there, we automatically import new master strings
|
||||
as they get committed to the various codebases, so you're always translating
|
||||
on the latest and greatest version.
|
||||
To find out about how to assist with translating SilverStripe, see the [Contributing Translations page](contributing/translation).
|
||||
|
||||
## Set up your own module for localization
|
||||
|
||||
@ -110,102 +73,23 @@ Use the following task to copy & commit the specific files instead:
|
||||
The conversion from PHP format to YML is taken care of by a module
|
||||
called [i18n_yml_converter](https://github.com/chillu/i18n_yml_converter).
|
||||
|
||||
## FAQ
|
||||
## Download Translations from GetLocalization.com
|
||||
|
||||
### How do I translate substituted strings? (e.g. '%s')
|
||||
We are managing our translations through a tool called [getlocalization.com](http://getlocalization.com).
|
||||
Most modules are managed under the "silverstripe" user there,
|
||||
see [list of translatable modules](http://www.getlocalization.com/profile/?username=silverstripe).
|
||||
|
||||
You don't have to - if the english master-string reads 'Hello %s', your german translation would be 'Hallo %s'. Strings prefixed by a percentage-sign are automatically replaced by silverstripe with dynamic content. See http://php.net/sprintf for details.
|
||||
Translations are exported from there into YML files, generated every hour,
|
||||
and committed to a special "translation-staging" branch on github.
|
||||
You can download individual files by opening them on github.com (inside the `lang/` folder), and using the "Raw" view.
|
||||
Place those files in the appropriate directories on a local silverstripe installation.
|
||||
|
||||
### Do I need to convert special characters (e.g. HTML-entities)?
|
||||
* ["translation-staging" branch for framework module](https://github.com/silverstripe/sapphire/tree/translation-staging)
|
||||
* ["translation-staging" branch for cms module](https://github.com/silverstripe/silverstripe-cms/tree/translation-staging)
|
||||
|
||||
Special characters (such as german umlauts) need to be entered in their native form. Please don't use HTML-entities ("ä" instead of "ä"). Silverstripe stores and renders most strings in UTF8 (Unicode) format.
|
||||
|
||||
### How can I check out my translation in the interface?
|
||||
|
||||
Currently translated entities are not directly factored into code (for security reasons and release/review-control), so you can't see them straight away.
|
||||
|
||||
It is strongly encouraged that you check your translation this way, as its a good way to doublecheck your translation works in the right context.
|
||||
Please use our [daily-builds](http://www.silverstripe.org/daily-builds/) for your local installation, to ensure you're looking at the most up to date interface. See "Download Translations" above
|
||||
to find out how to retrieve the latest translation files.
|
||||
|
||||
### Can I change a translation just for one SilverStripe version?
|
||||
|
||||
While we version control our translation files like all other source code,
|
||||
the online translation tool doesn't have the same capabilities.
|
||||
A translated string (as identified by its unique "entity name")
|
||||
is assumed to work well in all releases. If the interface changes
|
||||
in a non-trivial fashion, the new translations required should
|
||||
have new identifiers as well.
|
||||
|
||||
Example: We renamed the "Security" menu title to "Users"
|
||||
in our 3.0 release. As it would confuse users of older versions
|
||||
unnecessarily, we should be using a new entity name for this,
|
||||
and avoid the change propagating to an older SilverStripe version.
|
||||
|
||||
### How do I change my interface language?
|
||||
|
||||
Once you've logged into the CMS, you should see a "profile"-link on the lower right corner (direct link: http://www.site.com/admin/myprofile). You can set the "interface language" from a dropdown which automatically includes all found translations (based on the files in the `/lang` folders).
|
||||
|
||||
### I've found a piece of untranslatable text
|
||||
|
||||
It is entirely possible that we missed certain strings in preparing Silverstripe for translation-support. If you're technically minded, please read [i18n](/topics/i18n) on how to make it translatable. Otherwise just post your findings to the forum.
|
||||
|
||||
Note: JavaScript strings can't be translated through the online translation tool at the moment,
|
||||
you'll need to edit the file locally (e.g. cms/javascript/de_DE.js), and submit a patch.
|
||||
|
||||
### How do I add my own module?
|
||||
|
||||
Once you've built a translation-enabled module, you can run the "textcollector" on your local installation for this specific module (see [i18n](/topics/i18n)). This should find all calls to `_t()` in php and template files, and generate a new lang file with the default locale (path: <mymodule>/lang/en.yml). Upload this file to the
|
||||
online translation tool, and wait for hyour translators to do their magic!
|
||||
|
||||
### What about right-to-left (RTL) languages (e.g. Arabic)?
|
||||
|
||||
SilverStripe doesn't have built-in support for attribute-based RTL-modifications (`<html dir="rtl">`).
|
||||
We are currently investigating the available options, and are eager to get feedback on your experiences with translating silverstripe RTL.
|
||||
|
||||
### Can I translate/edit the language files in my favourite text editor (on my local installation)
|
||||
|
||||
Not for modules managed by getlocalization.com, including "framework" and "cms.
|
||||
It causes us a lot of work in merging these files back.
|
||||
Please use the online translation tool for all new and existing translations.
|
||||
|
||||
### How does my translation get into a SilverStripe release?
|
||||
|
||||
Currently this is a manual process of a core team member downloading approved translations and committing them into our source tree.
|
||||
|
||||
### How does my translation get approved, who is the maintainer?
|
||||
|
||||
The online translation tool (getlocalization.com) is designed to be decentralized and collaborative,
|
||||
so there's no strict approval or review process.
|
||||
Every logged-in user on the system can flag translations,
|
||||
and discuss them with other translators.
|
||||
|
||||
### I'm seeing lots of duplicated translations, what should I do?
|
||||
|
||||
For now, please translate all duplications - sometimes they might be intentional, but mostly the developer just didn't know his phrase was already translated.
|
||||
Please contact us about any duplicates that might be worth merging.
|
||||
|
||||
### What happened to translate.silverstripe.org?
|
||||
|
||||
This was a custom-built online translation tool serving us well for a couple of years,
|
||||
but started to show its age (performance and maintainability). It was replaced
|
||||
with getlocalization.com. All translations from translate.silverstripe.org were migrated.
|
||||
Unfortunately, the ownership of individual translations couldn't be migrated.
|
||||
|
||||
As the new tool doesn't support the PHP format used in SilverStripe 2.x,
|
||||
this means that we no longer have a working translation tool for PHP files.
|
||||
Please edit the PHP files directly and [send us pull requests](/misc/contributing).
|
||||
This also applies for any modules staying compatible with SilverStripe 2.x.
|
||||
|
||||
## Contact
|
||||
|
||||
Translators have their own [mailinglist](https://groups.google.com/forum/#!forum/silverstripe-translators),
|
||||
but you can also reach a core member on [IRC](http://silverstripe.org/irc).
|
||||
The getlocalization.com interface has a built-in discussion board if
|
||||
you have specific comments on a translation.
|
||||
|
||||
## Related
|
||||
# Related
|
||||
|
||||
* [i18n](/topics/i18n): Developer-level documentation of Silverstripe's i18n capabilities
|
||||
* [contributing/translation](contributing/translation): Information for translators looking to contribute translations of the SilverStripe UI.
|
||||
* [translatable](https://github.com/silverstripe/silverstripe-translatable): DataObject-interface powering the website-content translations
|
||||
* ["Translatable ModelAdmin" module](http://silverstripe.org/translatablemodeladmin-module/): An extension which allows translations of DataObjects inside ModelAdmin
|
@ -55,7 +55,7 @@ Example Forum:
|
||||
|
||||
Module developers can bundle developer documentation with their code by producing
|
||||
plain text files inside a 'docs' folder located in the module folder. These files
|
||||
can be written with the Markdown syntax (See ["Writing Documentation"](/misc/contributing#writing-documentation))
|
||||
can be written with the Markdown syntax (See [Contributing Documentation](/misc/contributing/documentation))
|
||||
and include media such as images or videos.
|
||||
|
||||
Inside the docs folder, developers should organize the markdown files into each
|
||||
|
@ -355,6 +355,7 @@ Example Translation Table (mymodule/javascript/lang/de_DE.js)
|
||||
|
||||
## Links
|
||||
|
||||
* [Help to translate](/misc/translation-process) - Instructions for online collaboration to translate core, as well as your own modules
|
||||
* [Help to translate](/misc/contribute/translation) - Instructions for online collaboration to translate core
|
||||
* [Help to translate](/misc/translation-process) - Instructions for adding translation to your own modules
|
||||
* [http://www.i18nguy.com/](http://www.i18nguy.com/)
|
||||
* [balbus.tk i18n notes](http://www.balbus.tk/internationalize)
|
||||
|
@ -266,14 +266,15 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
|
||||
ed.init(config);
|
||||
|
||||
// Avoid flicker (also set in CSS to apply as early as possible)
|
||||
self.css('visibility', '');
|
||||
|
||||
// Create editor instance and render it.
|
||||
// Similar logic to adapter/jquery/jquery.tinymce.js, but doesn't rely on monkey-patching
|
||||
// jQuery methods, and avoids replicate the script lazyloading which is already in place with jQuery.ondemand.
|
||||
ed.create(this.attr('id'), config, function() {
|
||||
self.css('visibility', 'visible');
|
||||
// Delayed show because TinyMCE calls hide() via setTimeout on removing an element,
|
||||
// which is called in quick succession with adding a new editor after ajax loading new markup
|
||||
setTimeout(function() {
|
||||
$(ed.getContainer()).show();
|
||||
}, 10);
|
||||
});
|
||||
|
||||
this._super();
|
||||
|
Loading…
Reference in New Issue
Block a user