Git Product home page Git Product logo

radiant-globalize2-extension's Introduction

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 RC1.

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 <r:locale /> tag to render the current locale.
  • Use the <r:locales /> tag to render the locales you use in the application.
  • Use the <r:with_locale /> tag to temporarly switch the locale within the block.
  • Use the <r:if_translation_title /> and <r:unless_translation_title /> tags to render the page only if/unless the title is translated.
  • Use the <r:if_translation_content /> and <r:unless_translation_content /> tags to render the page only if/unless the content is translated.
  • If you pass to <r:link /> tag the locale attribute it will generate the link to the translated version of the current document
  • The <r:children:each /> 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 <r:paginate:each /> 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:

You need to load Copy-Move before Globalize2

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

You need to load Custom Fields before Globalize2

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

You need to migrate Reorder extension before Globalize2

You need to load Paginate before Globalize2

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

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

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

radiant-globalize2-extension's People

Contributors

lunich avatar cristi avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.