Merge remote-tracking branch 'origin/2.1'

# Conflicts:
#	code/model/Translatable.php
This commit is contained in:
Damian Mooyman 2016-01-14 13:24:26 +13:00
commit b0ffbfa3a1
26 changed files with 184 additions and 39 deletions

13
changelog.md Normal file
View File

@ -0,0 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [2.1.0]
* Changelog added
* Update translations
* Add tests for 3.2 and php 5.6
* Updated Travis build status branch
* Fixed 3.x deprecations, updated dep from 3.1 to 3.2

View File

@ -2083,7 +2083,7 @@ class Translatable_Transformation extends FormTransformation
* @param FormField $originalField The original editable field containing the translated value
* @return CheckboxField The field with a modified label
*/
protected function transformCheckboxField(CheckboxField $nonEditableField, CheckboxField $originalField)
protected function transformCheckboxField(CheckboxField_Readonly $nonEditableField, CheckboxField $originalField)
{
$label = $originalField->Title();
$fieldName = $originalField->getName();

View File

@ -128,37 +128,6 @@ See http://www.w3.org/International/articles/language-tags/ for a detailed descr
To ensure that your template declares the correct content language, please see [i18n](i18n#declaring_the_content_language_in_html).
### User Permissions
Permissions to view and create translations are managed through the CMS, based on security groups
defined in the "Security" section (`admin/security`). By default, all CMS users with rights to create and edit pages
can also create translations. This can be restricted by removing the "Translate into all available languages" permission,
and replacing it with language specific permissions.
You can further restrict viewing and editing rights on a specific language through the "Settings" section (`admin/settings`).
Each language has its own configuration "translation", and you can configure access to groups there.
Here's an example setup which allows content authors to write only English master content,
while translators can only write German translations, but still see readonly versions of the English master content.
Group: Administrator
* Has "Full administrative rights" permission
Group: Content Author English
* Has "View language dropdown" permission
* Has "Translate into English" permission
* Is part of "Who can edit pages?" in "Settings" for "English"
* Is part of "Who can create pages?" in "Settings" for "English"
Group: Translator German
* Has "View language dropdown" permission
* Has "Translate into German" permission
* Is part of "Who can edit pages?" in "Settings" for "German"
* Is part of "Who can create pages?" in "Settings" for "German"
### Usage
Getting a translation for an existing instance:

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -0,0 +1,16 @@
# Understanding translatable content
The SilverStripe Translatable module allows you to create and edit multiple pages in various languages. This module also adds the ability for your users to select which language of a page they wish to view.
<div class="note" markdown="1">
Notes:
The SilverStripe Translatable module does not translate content automatically, content authors will need to enter the translated content manually for each translated page.
</div>
To begin translating content select a page in your site tree from the "Pages" admin. You can see in the below image:
* The language drop down above your site tree - This allows you to select which translated pages to edit
* The 'Translations' tab - This allows you to create a translated version of the selected page
![Translatable Default Pages Form](_images/TranslatableInstalledDefault.jpg)

View File

@ -0,0 +1,17 @@
title: Working with translations
summary: Adding translated content to your website.
# Working with translations
## Before we begin
- Make sure that your SilverStripe CMS installation has the [Translatable](https://addons.silverstripe.org/add-ons/silverstripe/translatable/) module installed.
- Make sure you have permissions to apply translations to pages in available languages
## Translation features
- [About translations in SilverStripe CMS](about-translatable.md)
- [Translating content](translating-content.md)
- [Translating site wide settings](translating-settings.md)
- [User permissions](user-permissions.md)

View File

@ -0,0 +1,23 @@
# Translating content
To translate a selected page, click on the 'Translations' tab.
![Add Translation](_images/TranslatableCreateForm.jpg)
Then select the desired language you want to translate the content into from the 'Language' drop down field.
![Select language dropdown menu](_images/SelectlanguagetoCreate.jpg)
Then click 'Create'.
You will then be presented with a new site tree in the "Pages" admin containing a duplicated page for the language you selected:
![Translated Site tree](_images/EnsureLangaugeSelect.jpg)
![Translatable page](_images/TranslatedPage.jpg)
You can now edit this page's content with the desired translated content. You can enter translated content directly into each field of the page, for example you can enter translated content into the Page Name, Navigation Label and content fields.
![Translatable page after content as been added](_images/TranslatedPageFinished.jpg)
Just like publishing your standard content, click 'Save & Publish' and you now have a translated version of the original page you selected.

View File

@ -0,0 +1,9 @@
# Translating your site title and settings
To translate your site title and settings, select 'Settings' from the left menu, then click the 'Translations' tab, then select the language from the list of existing languages you wish to edit.
![Translatable settings](_images/SettingsJapanSelect.jpg)
You can then add your translated content into each field:
![Translatable settings Japanese](_images/JapanSiteTitleandSettings.jpg)

View File

@ -0,0 +1,30 @@
# User Permissions
Permissions to view and create translations are managed through the CMS, based on security groups
defined in the "Security" section (`admin/security`). By default, all CMS users with rights to create and edit pages
can also create translations. This can be restricted by removing the "Translate into all available languages" permission,
and replacing it with language specific permissions.
You can further restrict viewing and editing rights on a specific language through the "Settings" section (`admin/settings`).
Each language has its own configuration "translation", and you can configure access to groups there.
Here's an example setup which allows content authors to write only English master content,
while translators can only write German translations, but still see readonly versions of the English master content.
Group: Administrator
* Has "Full administrative rights" permission
Group: Content Author English
* Has "View language dropdown" permission
* Has "Translate into English" permission
* Is part of "Who can edit pages?" in "Settings" for "English"
* Is part of "Who can create pages?" in "Settings" for "English"
Group: Translator German
* Has "View language dropdown" permission
* Has "Translate into German" permission
* Is part of "Who can edit pages?" in "Settings" for "German"
* Is part of "Who can create pages?" in "Settings" for "German"

24
lang/cs.yml Normal file
View File

@ -0,0 +1,24 @@
cs:
CMSMain:
LANGUAGEDROPDOWNLABEL: Jazyk
CMSMain_left:
GO: Jdi
Form:
LANGAOTHER: 'Jiné jazyky'
LANGAVAIL: 'Dostupné jazyky'
Translatable:
ALLCREATED: 'Všechny povolené překlady byly vytvořeny.'
CREATE: 'Vytvořit nový překlad'
CREATEBUTTON: Vytvořit
EXISTING: 'Existující překlady'
NEWLANGUAGE: 'Nový jazyk'
NOTICENEWPAGE: 'Před vytvořením překladu uložte tuto stránku prosím'
TRANSLATEALLPERMISSION: 'Přeložit do všech dostupných jazyků'
TRANSLATEPERMISSION: 'Překlad %s'
TRANSLATEVIEWLANGS: 'Zobrazit seznam jazyků'
TRANSLATIONS: Překlady
Translatable_Transform:
CheckboxValueNo: 'Ne'
CheckboxValueYes: 'Ano'
OriginalCheckboxLabel: 'Původní: {value}'
OriginalFieldLabel: 'Původní {title}'

View File

@ -18,5 +18,7 @@ cs_CZ:
TRANSLATEVIEWLANGS: 'Zobrazit jazykový rozbalovací seznam'
TRANSLATIONS: Překlady
Translatable_Transform:
CheckboxValueNo: 'Ne'
CheckboxValueYes: 'Ano'
OriginalCheckboxLabel: 'Původní: {value}'
OriginalFieldLabel: 'Původní {title}'

View File

@ -18,5 +18,7 @@ de:
TRANSLATEVIEWLANGS: 'Kann die verfügbaren Sprachen sehen'
TRANSLATIONS: Übersetzungen
Translatable_Transform:
CheckboxValueNo: 'Nein'
CheckboxValueYes: 'Ja'
OriginalCheckboxLabel: 'Original: {value}'
OriginalFieldLabel: 'Original {title}'

View File

@ -18,5 +18,7 @@ eo:
TRANSLATEVIEWLANGS: 'Vidigi lingvan falliston'
TRANSLATIONS: Tradukoj
Translatable_Transform:
CheckboxValueNo: 'Ne'
CheckboxValueYes: 'Jes'
OriginalCheckboxLabel: 'Origina: {value}'
OriginalFieldLabel: 'Origina: {title}'

View File

@ -14,5 +14,11 @@ fa_IR:
NEWLANGUAGE: 'زبان جدید'
NOTICENEWPAGE: 'لطفا قبل از ایجاد یک ترجمه این صفحه را ذخیره کنید'
TRANSLATEALLPERMISSION: 'ترجمه به تمام زبان های موجود'
TRANSLATEPERMISSION: 'ترجمه %s'
TRANSLATEVIEWLANGS: 'نمایش منوی زبان'
TRANSLATIONS: ترجمه
Translatable_Transform:
CheckboxValueNo: 'خیر'
CheckboxValueYes: 'بله'
OriginalCheckboxLabel: 'اصل: {value}'
OriginalFieldLabel: 'اصل {title}'

24
lang/sk.yml Normal file
View File

@ -0,0 +1,24 @@
sk:
CMSMain:
LANGUAGEDROPDOWNLABEL: Jazyk
CMSMain_left:
GO: Choď
Form:
LANGAOTHER: 'Iné jazyky'
LANGAVAIL: 'Dostupné jazyky'
Translatable:
ALLCREATED: 'Všetky povolené preklady boli vytvorené.'
CREATE: 'Vytvoriť nový preklad'
CREATEBUTTON: Vytvoriť
EXISTING: 'Existujúce preklady'
NEWLANGUAGE: 'Nový jazyk'
NOTICENEWPAGE: 'Pred vytvorením prekladu uložte túto stránku prosím'
TRANSLATEALLPERMISSION: 'Preložiť do všetkých dostupných jazykov'
TRANSLATEPERMISSION: 'Preložiť %s'
TRANSLATEVIEWLANGS: 'Zobraziť zoznam jazykov'
TRANSLATIONS: Preklady
Translatable_Transform:
CheckboxValueNo: 'Nie'
CheckboxValueYes: 'Áno'
OriginalCheckboxLabel: 'Pôvodné: {value}'
OriginalFieldLabel: 'Pôvodné {title}'

View File

@ -18,5 +18,7 @@ sk_SK:
TRANSLATEVIEWLANGS: 'Zobraziť jazykový rozbaľovací zoznam'
TRANSLATIONS: Preklady
Translatable_Transform:
CheckboxValueNo: 'Nie'
CheckboxValueYes: 'Áno'
OriginalCheckboxLabel: 'Pôvodné: {value}'
OriginalFieldLabel: 'Pôvodné {title}'

View File

@ -1,18 +1,24 @@
tr:
CMSMain:
LANGUAGEDROPDOWNLABEL: Lisan
LANGUAGEDROPDOWNLABEL: Dil
CMSMain_left:
GO: Git
GO: Başla
Form:
LANGAOTHER: 'Diğer Lisanlar'
LANGAVAIL: 'Mevcut Lisanlar'
LANGAOTHER: 'Diğer diller'
LANGAVAIL: 'Mevcut diller'
Translatable:
ALLCREATED: 'Tüm geçerli çeviriler oluşturuldu.'
CREATE: 'Yeni çeviri oluştur'
CREATEBUTTON: Oluştur
EXISTING: 'Mevcut Çeviriler'
NEWLANGUAGE: 'Yeni Lisan'
NEWLANGUAGE: 'Yeni dil'
NOTICENEWPAGE: 'Yeni bir çeviri oluşturmadan önce lütfen sayfayı kaydediniz'
TRANSLATEALLPERMISSION: 'Tüm mevcut dillere çevir'
TRANSLATEPERMISSION: '%s diline çevir'
TRANSLATEVIEWLANGS: 'Mevcut dilleri görebilir'
TRANSLATIONS: Çeviriler
Translatable_Transform:
OriginalCheckboxLabel: 'Orjinal: {değer}'
OriginalFieldLabel: 'Orjinal {başlık}'
CheckboxValueNo: 'Hayır'
CheckboxValueYes: 'Evet'
OriginalCheckboxLabel: 'Orijinal: {value}'
OriginalFieldLabel: 'Orijinal {title}'