Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Mar 19 16:00:32 -0700 2008 | |
| |
.gitmodules | Thu Mar 26 18:31:10 -0700 2009 | |
| |
README.rdoc | Wed May 20 22:50:17 -0700 2009 | |
| |
Rakefile | Thu Mar 26 18:31:10 -0700 2009 | |
| |
app/ | Sat Oct 17 12:53:05 -0700 2009 | |
| |
db/ | Fri Mar 27 05:13:57 -0700 2009 | |
| |
lib/ | Tue Jun 16 02:32:38 -0700 2009 | |
| |
public/ | Wed Feb 18 08:37:23 -0800 2009 | |
| |
site_language_extension.rb | Mon Jun 15 04:07:26 -0700 2009 | |
| |
spec/ | Thu Mar 26 18:31:10 -0700 2009 | |
| |
test/ | Wed Mar 19 16:00:32 -0700 2008 | |
| |
vendor/ | Thu Mar 26 18:31:10 -0700 2009 |
Site Language
Uses Globalize2 to let you translate pages, page parts and snippets. If you are still working with Radiant < 0.7, you can check out github.com/jomz/site_language/commits/pre-radiant-0.7 This version still works with the original globalize, but stopped working after 0.6.9.
Allows you to translate pages (title, slug, keywords, …), page parts and snippets, using the globalize plugin.
Installation:
- You need to be on rails 2.2, which means Radiant edge at the moment, so you’ll need to
rake radiant:freeze:edge
- If you have not installed the extension yet, do a
rake ray:ext name=site_language hub=jomz
or
git submodule add git://github.com/jomz/radiant-site_language-extension.git vendor/extensions
- cd into the site_language folder to init and update the globalize2 submodule;
cd vendor/extensions/site_language git submodule init; git submodule update cd ../../..
- If you do not want English to be the default language, set the default language like so:
Radiant::Config["site_language.default_language"] = 'fr'
- Run the migrations and update tasks
rake db:migrate:extensions
- Start the server and go to the "Languages" tab in the admin, add some language-codes (en-UK, nl-BE, …)
- Reboot the server, and translate away!
Available tags:
<r:sitelanguages:nav />
Returns an <ul>-based language navigation. It will put a "current" class on the current language link, and you can hide languages from it by setting so under the Languages tab. The links will go to the translated url of the current page, i.e. not the homepage. Also, if you have set up a domain for a certain language, the link will point to the correct domain.
<r:langcode />
Returns the language code for the currently set language.
<r:sitelanguages:each> .. </r:sitelanguages:each>
Allows you to loop over each site language
<r:translated_slug [lang="nl"] />
Will provide the translated slug of a page
Overridden tags:
<r:link /> and <r:breadcrumbs/> have been made site_language-aware
Beware that you may have other extensions that also override these tags, i.e. the trike_tags extension. This would result in r:link tags not prefixing the link with the language part, i.e. /about-us instead of /en/about-us If this is the case, you’ll want to make sure that the site_language is loaded after other extensions that override the standard tags. You can change the load order for extensions in config/environment.rb;
config.extensions = [ :all, :site_language ]







