Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Translate content in Radiant CMS using the Globalize2 Rails plugin.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 features
Octocat-spinner-32 lib
Octocat-spinner-32 public
Octocat-spinner-32 spec
Octocat-spinner-32 vendor
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 cucumber.yml
Octocat-spinner-32 globalize2_extension.rb
Octocat-spinner-32 radiant-globalize2-extension.gemspec
Octocat-spinner-32 readme.md
readme.md

Radiant Globalize2 Extension

About

An extension by Aissac that helps translating content in Radiant CMS using the Globalize2 Rails Plugin.

Requires Radiant >= 0.8. Tested on Radiant 0.9.1.

Check out a screencast presenting the extension and one on compatibility issues

Features

  • Provides the ability to translate your pages (title, slug, breadcrumb, description, keywords) using the Radiant admin interface.
  • Provides the ability to translate your snippets and layouts using the Radiant admin interface.
  • Radius tags for accessing the locales and translations.
  • Possibility to completely delete the translation for a page.

Important Notice!

The git branches of this repository hold stable versions of the extension for older versions of Radiant CMS. For example the 0.8 branch is compatible with Radiant 0.8.

To checkout one of these branches:

git clone git://github.com/Aissac/radiant-globalize2-extension.git vendor/extensions/globalize2
cd vendor/extensions/globalize2
git checkout -b <branch-name> origin/<remote-branch-name>

As an example, if you're working on Radiant 0.8 you will need to checkout the 0.8 branch:

cd vendor/extensions/globalize2
git checkout -b my_branch origin/0.8

Installation

Globalize2 Extension has no known dependencies. Globalize2 Rails Plugin is bundled.

Because Globalize2 Extension keeps the settings in the Radiant::Config table it is highly recommended to install the Settings Extension

git clone git://github.com/Squeegy/radiant-settings.git vendor/extensions/settings

Finally, install Globalize2 Extension

git clone git://github.com/Aissac/radiant-globalize2-extension.git vendor/extensions/globalize2

Then run the rake tasks:

rake radiant:extensions:globalize2:migrate
rake radiant:extensions:globalize2:update

Configuration

Settings

Globalize2 Extension keeps its settings in Radiant::Config table, so in order to use correctly the extension you need to create some settings:

Radiant::Config['globalize.default_language'] = 'en'
Radiant::Config['globalize.languages'] = 'ro,de'

Usage

You have the possibility to change the locale either on the pages/snippets/layouts index page, or on the page/snippet/layout edit page. Changing the locale using either option will change the locale for the entire application.

When you need to delete a translation, on the page edit action, you need to check the "Delete Translation" checkbox, before saving the page. Saving the page with the checked "Delete Translation" will erase only the translation for that particular locale.

When creating a new page, the locale will be changed automatically to the default language.

Available Tags

  • See the "available tags" documentation built into the Radiant page admin for more details.
  • Use the tag to render the current locale.
  • Use the tag to render the locales you use in the application.
  • Use the tag to temporarly switch the locale within the block.
  • Use the and tags to render the page only if/unless the title is translated.
  • Use the and tags to render the page only if/unless the content is translated.
  • If you pass to tag the locale attribute it will generate the link to the translated version of the current document
  • The tag cycles through all of the translated children. If you need to cycle through all the children (regardless if they are translated or not) set the tag's locale attribute to false
  • If you're using the Paginate Extension, the tag will find only translated children. If you need to find all the children (regardless if they are translated or not) set the tag's locale attribute to false

Compatibility

The following extensions were tested and work with Globalize2 Extension:

Copy-Move

You need to load Copy-Move before Globalize2

config.extensions = [ :copy_move, :globalize2, :all ]

Custom Fields

You need to load Custom Fields before Globalize2

config.extensions = [ :custom_fields, :globalize2, :all ]

Reoder

You need to migrate Reorder extension before Globalize2

Paginate

You need to load Paginate before Globalize2

config.extensions = [ :paginate, :globalize2, :all ]

Paperclipped

You need to install Globalize2Paperclipped Extension. Follow the installation notes on the extension's official page.

Tiny Paper

Because Tiny Paper is based on Paperclipped, you neeed to install Globalize2Paperclipped.

Out-of-the-box compatible

Other extensions that have been tested and don't need any special treatment: Mailer Extension, Stereotype Extension, SNS Extension, SNS Minifier, SNS SASS Filter Extension, Database Mailer Extension, Super Export Extension

TODO

Contributors

Something went wrong with that request. Please try again.